Upgrading working 3.90 to 4.00 results in server error when starting website

5 days ago
I have run into an issue that I am not sure where to look for resolution. I asked my webhost to upgrade my nopCommerce from 3.90 to 4.00. nopCommerce 3.90 works perfectly. When they upgraded they get the following error when you run the website - https://www.smdeigns.com/store

Application startup exception: System.Exception: Unexpected character encountered while parsing value: D. Path '', line 0, position 0.
---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: D. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Nop.Core.Plugins.PluginManager.GetInstalledPluginNames(String filePath)
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   at Nop.Core.Infrastructure.NopEngine.Initialize(IServiceCollection services)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception
System.Exception: Unexpected character encountered while parsing value: D. Path '', line 0, position 0.
---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: D. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Nop.Core.Plugins.PluginManager.GetInstalledPluginNames(String filePath)
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   at Nop.Core.Infrastructure.NopEngine.Initialize(IServiceCollection services)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Hosting environment: Production
Content root path: h:\root\home\stevethatcher1-001\www\smtdesigns\store
Now listening on: http://localhost:28455
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.smtdesigns.com/store  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 172.6139ms 500 text/html; charset=utf-8

They offered no help in a resolution other than returning it to the 3.90 installation - I have already done that because I do need the store up and running.

Anyone have any ideas where I can look? Thank you!
5 days ago
It depends on what they did to update.I assume they upgraded the database using the upgrade scripts ? Did they provide a new v4.0 website and attach the database ?

One issue maybe the plugins - do you have custom plugins ?
If so they will need to be updated to v4.0

Ideally the support service should be making a standard nopCommerce test site so you can transition. Updating the database and attaching the test database to the new test website. Which should run no worries. Then you can install updated plugins. Later when all is checked you can change the site url from the old site to the new website. Or use some similar transition process.

But why go from c3.9 to v4.0 why not the latest version v4.3 ?
5 days ago
I don't have any custom plugins. I do have a Nivo slider that I don't use anymore and a FoxNet PayPal plugin that I purchased. The FoxNet plugin does support 3.9 and above and the Nivo slider was installed but not enabled. The rest of the plugins are the usual nopCommerce ones for discounts and shipping.

They did run the script and took care of the settings.txt and plugins text file. The images, etc were all copied over, so everything looked like it was done correctly. I will have to check directory permissions to see if there was a problem there, but I would expect them to know what has to be done. I can't have been the only customer that they have upgraded... at least I would hope not.

I did keep the 4.00 work they did, so I could research this problem and fix it.... They did leave the 3.90 version except for the database script. I created a 390 database and restored the 3.90 data to that and modified the saved 3.90 version to point to the new 390 database. It wasn't difficult getting the 3.90 version back up and running.

As for upgrading to 4.30. I can't yet anyway because of a issue I have read about for the USPS plugin. The upgrade to 4.00 would take care of all the new directories, the database script changes, and give me a newer baseline that I would upgrade myself when I have time.  Although my web host was unsuccessful doing the 4.00 upgrade, they would have charged me $30 for each step up if it had worked. I figured them making sure all the directory permissions and upgrading to 4.00 for $30 would save me time in the long run and wasn't to bug of a money bite.

By the way, thanks for the ideas.
4 days ago
I figured out the the FoxNet PayPal plugin was not in the 4.00 installation, so I am thinking the exception was thrown because of that. I will be working on going back to the 4.00 installation without the foxnet plugin, so I can check it for operation.
4 days ago
the outside plugin does not seem to be the cause. I ran 3.90 and removed USPS and FoxNetSoft (both plugins were not in the 4.00 attempt). Made copies... setup a 3.90 upgrade directory so I could easily go back to a running site.

Followed the upgrade instructions explicitly (no source version) and get a server error when I tried to run the store.

The only thing out of the ordinary (as I think of it) about my 3.90 installation is that it is located in a folder called store rather than being at the root of the web host. I really can't change that. If I could figure out how to do a URL redirect from store to the root, I would do that, but have not been successful in figuring that out either.

I need to upgrade, but I can't seem to figure out what the background problem is. If I had lots of money I would hire someone to do the job, but I am pretty low budget right now.

If anyone has more suggestions, please let me know.

Thanks!
4 days ago
You can check for Stdout errors:
https://www.selectsystems.com.au/checking-for-errors-on-a-new-installation-of-nopcommerce

But sorry I am confused at what you are trying to do.
You set up a new website with nop4.0 (no source)
You run the website and it does an install it creates a database (just to check everything works out of the box)
You have your other database which has been converted
You edit datasettings.json to point it at the new database by changing Initial Catalog
You run the website again - it all works

datasettings.json is
{
  "DataProvider": "sqlserver",
  "DataConnectionString": "Data Source=Server;Initial Catalog=nopCommerce40;Integrated Security=True;Persist Security Info=False",
  "RawDataSettings": {}
}

Also Note: you can not run the new website as a subdirectory of another website
4 days ago
sorry for the confusion...
the domain name is smtdesigns.com and the store is located in the "store" directory. You access the store through https://www.smtdesigns.com/store, so it is not a different website.

the upgrade instructions lead me to believe I have to do the following  and I thought I did it all correctly.
back up everything first
then for upgrade -
back up images, .txt files and database
delete everything in the "store" directory except the .txt files in the App_Data directory
write 4.00 image into the "store" directory
run sql script on database referenced in settings.txt
change names on .txt file (settings.txt and InstalledPlugins.txt) to dataSettings.json and installedPlugins.json naming.
Copy "images" directory to wwwroot
I also copied files over to wwwroot that are pdf invoice and pdf diagrams that are available
At that point I thought you would access the website and run 4.00 which would start things going.

I am assuming this procedure was exactly what the admin at my web host did... If there is something wrong with the procedure I followed, any comments would be arppreciated.

If I should be actually installing 4.00 and then converting, I can do that.

Thanks again for taking an interest in the upgrade I am trying to do.
3 days ago
a bit of an update

I did a new install of 4.00, changed the dataSettings.json for a 3.90 database that I ran the SQL script on. Uploaded two plugins that I needed and ran the 4.00 version. Also copied images and files that came from 3.90. to their wwwroot locations. After clearing cache and restarting, everything is there except the images. I would prefer not having to set all of them up (there are hundreds).  I setup the two plugins I had uploaded and so far it is all good except for the graphics. I will spend more time on it during daylight hours tomorrow. Thanks for the ideas!
3 days ago
all is working as of last night. The problem with images was a web host control panel regarding copying files. I solved that by zipping directories and then unzipping elsewhere so all the files would be included ( the panel was limiting the number of files copied when doing anything but a directory and it total contents.

The only other thing that needed to be done is to re-link any files that I had included in a content page (PDFs, images that were not category or product uploads). Basically everything that had been uploaded by Roxy. The files were in the new 4.00 location, but the SQL upgrade did not fix those paths. All I needed to do was edit the page, press the link button and use Roxy to select the moved file on each of the broken links.
1 day ago
the rest of the story...  I have now upgraded to 4.30. the biggest hurdles were 3.90 to 4.00 and then 4.10 to 4.20.

4.00 was working last Thursday night and now on Sunday 4.30 is up and running.

For 4.00 to 4.10 to 4.20 to 4.30 -
1) In each step, I installed the no source self contained package, copied the version plugins, files, and images to the directory structure (set directory/subdirectory permissions for Read/Write for installation and setup).
2) ran a new installation of nopCommerce  (I had created 3 databases, so there was one for each) I brought up plugins configuration and installed the two I needed.
3) deleted the specific database and recreated an empty one (kept the same name, username, and password of course).
4) restored the empty database with one from the previous version and applied the sql upgrade script to the database (worked perfect for 4.10 and 4.30). The 4.20 sql upgrade script failed due to indexes that prevented some tables from being altered (Product, Customer, QueuedMail). I deleted the three offending indexes - 'idx_DCh_5314_5313_Customer', 'idx_DCh_1266_1265_Product', and 'idx_DCh_3911_3910_QueuedEmail'). Once I did that, the script ran without any errors and the 4.20 web site ran perfectly (as far as I could tell).
5) cleared cache on a browser and brought up a working new version. I went into the plugins again just to de-install any I did not need.
6) went through and set directory/subdirectory permissions
7) repeat until I finished 4.30

I backed up all working versions and their related databases. I cleaned up everything and left just the one store directory at the web host.

The biggest pain I had doing this all, was the web host control panel that I had to use. Images had to be a zip file because file copy simply did not copy all files, but only the only the ones that it had displayed (250 at a time rather than all of them). At least I only needed to have the one zip file which I dumped into all three version directories that I upgraded through.

Thank you to FileZilla, HeidiSQL, and the Microsoft SQL Server Management software... also thanks to the people here that made a few suggestions. I should even thank my web host that couldn't upgrade to 4.00 for me.  It forced me to bite the bullet and do it myself. Now I have the business site upgraded to the latest version and hopefully the next upgrade won't be as painful... :)