Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » 9.6.13 to 9.7 - An item with the same key has already been added

9.6.13 to 9.7 - An item with the same key has already been added

Kim Søjborg Pedersen
Reply

Hi after upgrading a solution from 9.6.13 to 9.7 all paragraphs with the Product Catalogue using Index is returning this error:

System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Dynamicweb.Ecommerce.Frontend.Frontend.HandleParameters(IQuery query, IDictionary`2 parameters, IDictionary`2 parametersTypes, Boolean isDefault) at Dynamicweb.Ecommerce.Frontend.Frontend.GetProductsFromIndexQuery(ProductCatalogShowType settingsType)

Is there anything I should be aware of in regards to my indexs going from 9.6.13 to 9.7 ?

I did go back to 9.6.13 and it worked fine again

/Kim


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

We have noticed the same issue when Upgrading to 9.6.14.

Apparently some products are added twice to the index.

We have noticed that the initial count of the products is not equal to the number of products indexed.

Downgrading to 9.6.13 solved it.

This might be related to some changes in 9.6.14.

Adrian

 

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Kim,

The upgrade process should be smooth. While a lot of nice features have been added to Indexing, they shouldn't cause upgrade issues.

I've tried to reproduce your issue but I was not able to do so. I started by taking a clean Rapido 3.1.1 and installing it on a clean 9.6.13 and verified that everything worked as expected. Then I upgraded to 9.7.0 and it was still working as expected.

You can try to download 9.7 again. If you downloaded it using NuGet, then try and download it from the Downloads section here on the site. If you did download 9.7 from the Documentation site, then please try and do that again. Maybe the initial download was corrupt in some way.

If that doesn't fix the issue, we'd need a copy of the solution so we can debug further. You can get in touch with the Service Desk by sending an email to support@dynamicweb.dk that specifies the issue and more detail about your solution.

- Jeppe

 
Nicolai Pedersen
Reply
This post has been marked as an answer

And - can you check that you do not have 2 parameters with the same name in your query definition? I could reproduce it by doing that - see dumps.

I can see there is a change to how values of parameters are parsed - and that can cause this issue. NTS: never add items to dictionaries without a key check first...

Capture.PNG Capture1.PNG
Votes for this answer: 1
 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi again,

I didn't see Adrian's post before I posted my response.

Dynamicweb 9.6.14 hasn't been released, so I'm not sure which version you're using. The latest version of 9.6.13 is the latest of the 9.6 branch but 9.6.14 maybe out in the next week or two.

With regard to the indexing of products, I am also unable to reproduce the issue with mismatched product count. In any case, if redownloading the software doesn't fix the issue, you should contact the Service Desk so we can get a copy of the solution and debug the issue.

- Jeppe

 
Nicolai Pedersen
Reply

TFS#68949

 
Kim Søjborg Pedersen
Reply

Hi Nicolai

There was 2 parameters with the same name, so I try fix that and if it works I marke this as the answer.

/Kim

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

My bad. I had 9.6.12 with 9.6.13.

9.6.12 works but 9.6.13 does not work.

I will check the parameters on my end as well.

In my case, I thought the problem was related to how the Variants were added to the index.

I might be wrong.

In any case, downgrading from 9.6.13 to 9.6.12 solved it without having to change anything else.

Thank you,
Adrian

 
Nicolai Pedersen
Reply

It is the HandleParameters method that throws the exception - that kind of indicates that it is related to parameters and not something else...

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Understood.

I will check the parameters.

Thank you,

Adrian

 

You must be logged in to post in the forum