Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Upgrade script seems to be missing GroupType field for EcomGroups

Upgrade script seems to be missing GroupType field for EcomGroups

Chris Søgaard
Chris Søgaard
Reply

Hi DW

I have updated a DW solution for our client from 9.13.5 to 9.14.3. This will result in an similar to this when trying to navigate the group structure:

System.IndexOutOfRangeException: GroupType
   at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at System.Data.SqlClient.SqlDataReader.get_Item(String name)
   at Dynamicweb.Ecommerce.Products.GroupRepository.ExtractGroup(IDataReader dataReader)
   at Dynamicweb.Ecommerce.Products.GroupRepository.GetGroups()

This is caused by a missing column in the database. The missing column is:

- EcomGroups --> GroupType (int, null)

This does not seem to be included in the update scripts to add this column. I have added of course added the column manually, but I thought you might want to know.

BR Chris


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi

I've tried to reproduce the issue via creating new database by wizard under 9.13.5 (to have EcomGroups without the field) and moving to 9.14.3 but was not able to catch it - the field is added successfully. I see "SqlUpdate.AddColumn("2", this, "EcomGroups", "GroupType", "[int] NULL")," code exists in C:\Projects\Dynamicweb\src\77 - Ecommerce\Dynamicweb.Ecommerce\Updates\EcommerceUpdateProvider.cs in fact and performed successfully per log (attached). So, the issue is specific one related to your solution only. Please, have a look at Monitoring-Event viewer's logs, 'Application/Update' or 'Application/Database' category to find error(s) related to the upgrade and show here if possible.

BR, Oleg QA 

2022-11-14_11-51-30.png 2022-11-14_12-25-21.png
 
Chris Søgaard
Chris Søgaard
Reply

Hi Oleg

Hmm weird, I was browsing the .aspx files in admin/update folder that was previously used for updating database, did you change this on 9.14.x to not use this anymore?

This is a solution that has been updated multiple times, and is not a fresh install of 9.13.5, and also running with Rapido as well, I don't know if that could have any impact. 

Where does the information found in "Monitoring" --> "Event Viewer" come from, is it from a table in the database or from files or somewhere else. Because my log indicate that an update script ran on 20. september, and we did run an update on this solution on 20. september, but it was on another environment and therefore another database.

Could this be the problem, that the solution thinks that this update already ran, but just not on this database?

The update applied last week skips these steps, because it seems like those we're run on 20. september:

  • 1 Dynamicweb.Ecommerce.Updates.EcommerceUpdateProvider
  • 2 Dynamicweb.Ecommerce.Updates.EcommerceUpdateProvid

BR Chris

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Chris,

Yup, old upgrade via script is not longer used, it's implemented using provider instead now. I've extra digged the issue and see the upgrade version (2) is specific one where upgrade was codded in not correct way initially (the version was related to other db change and changed to current one later). Probably, your db took initial upgrade but was not able to take correct last one. Sorry for inconvience, I supose the case like yours won't be exist in future. Thanks for commenting.

BR, Oleg QA 

 
Søren Jakobsen
Reply

Hi,

Did you manage to solve this? and how?

I have the same issue. Upgraded from 9.8.7 -> 9.13.13 -> 9.14.5.

Have tried to rerun upgrade scripts but it doesn't solve the issue

[IndexOutOfRangeException: GroupType]
   System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +2158379
   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +141
   System.Data.SqlClient.SqlDataReader.get_Item(String name) +21
   Dynamicweb.Ecommerce.Products.GroupRepository.ExtractGroup(IDataReader dataReader) +3505
   Dynamicweb.Ecommerce.Products.GroupRepository.GetGroups() +212
   Dynamicweb.Ecommerce.Products.GroupService.InitializeCache() +122
   Dynamicweb.Caching.DictionaryCache`2.InitializeCacheDictionary() +155
 
Morten Buhl Dynamicweb Employee
Morten Buhl
Reply
This post has been marked as an answer

Hi Søren,

to fix run TRUNCATE TABLE Updates and recycle. The column is created by Dynamicweb.Updates.dll instead of the updatescript

 

/Morten Buhl, DW

Votes for this answer: 1
 
Søren Jakobsen
Reply

Thanks. Worked like a charm

 

You must be logged in to post in the forum