<

NopCommerce Upgrade Error

Published on
9,788 Points
3,788 Views
Last Modified:
Approved
The aim of this article is to help you solve the error "Cannot insert the value NULL into column 'ShortDescription', table 'albert_store.dbo.Nop_Product'; column does not allow nulls. UPDATE fails." problem and allow you to continue updating your NopCommerce version.

Warning: I do NOT advise using these instructions on a live application, but instead recommend you create a development environment first and deploy the new upgraded version of NopCommerce there.

It is important before proceeding to backup all your data, making a copy of your running DB before you execute the described operation. Backup can be performed either from your hosting control panel or from the admin menu of NopCommerce.


Problem.

During the upgrade of your NopCommerce version, may happen that the installation fails and it shows up the following error message:

An error occured: Cannot insert the value NULL into column 'ShortDescription', table 'albert_store.dbo.Nop_Product'; column does not allow nulls. UPDATE fails.
The statement has been terminated. Running scripts from file: C:\inetpub\wwwroot\nopCommerce_1.60\NopCommerceStore\install\Scripts\1.60\nopCommerce_upgrade.sql

Please note that the path included (C:\inetpub\wwwroot\nopCommerce_1.70_Source\NopCommerceStore\install\Scripts\1.60) may vary. In general the path (relative to the application) should be something like:
YOUR STORE \ install \ Scripts \ VERSION \ nopCommerce_upgrade.sql

Open in new window



Solution.

The described procedure is valid (and tested) on upgrades from version 1.4 and above (1.5 - 1.6 - 1.7 - 1.8).

In this case, it is possible that the upgrade fails because in the Nop_Product table there are some rows with NULL value for the field "ShortDescription". The error comes up because the upgrade script alters the field ShortDescription and reapplies the NOT NULL constraint, which causes records having NULL to fail this new constraint.

To sort out this issue, run the following SQL query to see if any records have a NULL value in their ShortDescription field:
SELECT COUNT(*)
FROM Nop_Product
WHERE (ShortDescription IS NULL)

Open in new window


If the executed query shows that you have records that are NULL, run the following query to fix the problem:
UPDATE Nop_Product
SET ShortDescription = ''
WHERE (ShortDescription IS NULL)

Open in new window


This will give a value for the field and you should be able to proceed with planned upgrade.
0
Comment
Author:giuseppepi
0 Comments

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Join & Write a Comment

Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month