<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

NopCommerce Upgrade Error

Published on
9,858 Points
3,858 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
Author:giuseppepi
0 Comments

Featured Post

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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:
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month