nopcommerce dead all of the sudden

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Version of the nopCommerce is 4.30 and it's not built from source, I took the release version 4.30 from the github (linux_x64) and deployed that. Database used is MySql (Ver 8.0.29-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu)).
There were no server updates so I am trying to figure out what might 'cause this sudden fail.

Yes I found the very same SO article, but the thing is, and as far as I know, this mysql net/connector  is "baked" as a dependency (probably MySql.Data.dll ?) with these release .dlls from the nopCommerce release, so I don't think I can do much there. I tried some configurations with the mysql server and these character encodings but without any luck.

Also here is the setup for system variables regarding character_set for nopCommerce db:

mysql> show variables like '%character_set%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8mb4                    |
| character_set_connection | utf8mb4                    |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8mb4                    |
| character_set_server     | utf8mb4                    |
| character_set_system     | utf8mb3                    |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
2 years ago
Just to add that the exception that OP mentioned is the one that ocurrs  when trying to start nopcommerce app:

Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:Nop.Core.Domain.Common.CommonSettings -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
---> System.Collections.Generic.KeyNotFoundException: The given key '24941' was not present in the dictionary.

I even looked a bit through the source code but couldn't decypher anything useful other than "some service wasn't resolved on the startup" or rather during db initialise phase. Which one and why I have no clue.
2 years ago
Yes sorry its all new to me
You need to try to narrow down the issue
One option is to backup the settings files then delete and let the install run and create a new database. If that works then it must be database.
If that does not work the other option is to create a new website on the same server. And see if it is the website
If that does not work then I guess it probably be server.
2 years ago
Hi,
I'm not using MySQL with nopCommerce but your version of nopCommerce (4.3) should be (as i remember) the first version with MySQL support added to it. Its always a good approach to use the latest nopCommerce version if possible (4.5) in case if there were some  improvements (or bug fixes).

SUGGESTION: Beside your MySQL server-side settings, can you also check if there is any character set specified (used to encode the queries sent to mysql) in your ConnectionString (App_Data\appsettings.json)?
  - Please check out this link https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-character-set/

bojanadejanovic wrote:
Version of the nopCommerce is 4.30 and it's not built from source, I took the release version 4.30 from the github (linux_x64) and deployed that. Database used is MySql (Ver 8.0.29-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu)).
There were no server updates so I am trying to figure out what might 'cause this sudden fail.

Yes I found the very same SO article, but the thing is, and as far as I know, this mysql net/connector  is "baked" as a dependency (probably MySql.Data.dll ?) with these release .dlls from the nopCommerce release, so I don't think I can do much there. I tried some configurations with the mysql server and these character encodings but without any luck.

Also here is the setup for system variables regarding character_set for nopCommerce db:

mysql> show variables like '%character_set%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8mb4                    |
| character_set_connection | utf8mb4                    |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8mb4                    |
| character_set_server     | utf8mb4                    |
| character_set_system     | utf8mb3                    |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
2 years ago
daniel.siljanovski wrote:
Hi,
I'm not using MySQL with nopCommerce but your version of nopCommerce (4.3) should be (as i remember) the first version with MySQL support added to it. Its always a good approach to use the latest nopCommerce version if possible (4.5) in case if there were some  improvements (or bug fixes).

SUGGESTION: Beside your MySQL server-side settings, can you also check if there is any character set specified (used to encode the queries sent to mysql) in your ConnectionString (App_Data\appsettings.json)?
  - Please check out this link https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-character-set/

Version of the nopCommerce is 4.30 and it's not built from source, I took the release version 4.30 from the github (linux_x64) and deployed that. Database used is MySql (Ver 8.0.29-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu)).
There were no server updates so I am trying to figure out what might 'cause this sudden fail.

Yes I found the very same SO article, but the thing is, and as far as I know, this mysql net/connector  is "baked" as a dependency (probably MySql.Data.dll ?) with these release .dlls from the nopCommerce release, so I don't think I can do much there. I tried some configurations with the mysql server and these character encodings but without any luck.

Also here is the setup for system variables regarding character_set for nopCommerce db:

mysql> show variables like '%character_set%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8mb4                    |
| character_set_connection | utf8mb4                    |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8mb4                    |
| character_set_server     | utf8mb4                    |
| character_set_system     | utf8mb3                    |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+


Hi,

No, I try with and without adding charset to the connection string without any success.
I tried creating new db with new user (same sql server), with nopCommerce 4.30 release, freshly downloaded, and I get the same error. Not sure if it is entirely same because I see the portion, and I cannot see the full one in service log or in the system log. So I guess something must be off with the db server and nopCommerce4.30. I will try with fresh install of 4.50 and see how that goes.

    Setup failed: An exception was thrown while activating Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
2 years ago
I tried with the 4.50 release and it throws the same error. Something on the db server bothers nop, but I don't know what.
2 years ago
Same here.

Nopcommerce 4.30
SO: Linux
DB: Mysql

I was checking the syslog and I see a bunch of lines similar to these:

at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.UseNopResponseCompression(IApplicationBuilder application) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 202

why is it c:\andrei... ?
Is there a better way to install nopcommerce in Linux? I followed the documentation, which is just unzip a file that has everything there already.
Shouldn't we compile it locally?

Another thing which is exactly the same as the other user having problems:

System.Collections.Generic.KeyNotFoundException: The given key '24941' was not present in the dictionary.

What's that 24941 key?

I am able to connect to the DB from the server side using normal MySQL client.
2 years ago
jmonreal wrote:
Same here.

Nopcommerce 4.30
SO: Linux
DB: Mysql

I was checking the syslog and I see a bunch of lines similar to these:

at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.UseNopResponseCompression(IApplicationBuilder application) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 202

why is it c:\andrei... ?
Is there a better way to install nopcommerce in Linux? I followed the documentation, which is just unzip a file that has everything there already.
Shouldn't we compile it locally?

Another thing which is exactly the same as the other user having problems:

System.Collections.Generic.KeyNotFoundException: The given key '24941' was not present in the dictionary.

What's that 24941 key?

I am able to connect to the DB from the server side using normal MySQL client.


Yeah I see the same errors.
Regarding the path I guess the release dlls where built there.
You can compile from source, but no-one will guarantee you that it will work, if I use release dlls from the official github repo I sort of expect that they work, I dont' know.

Regarding the key, I don't know, wish I knew,  I guess the connector is trying to read data from somewhere.
Also can confirm that other clients connect to MySQL without issues.
This is now really becoming frustrating. :)
2 years ago
I was checking the syslogs, and just before it started failing over and over (because it has auto-restart), it was running scheduled tasks without a problem.

Could be that there is a folder that needs to be cleaned up? Or might be something in the scheduled tasks that left something odd in the db? how can this be checked?
2 years ago
I have checked the db, and compared to syslogs time.
nopcommerce starts failing after 06:29:29, seems like the send emails task could be the culprit.
How to check this?



mysql> select * from ScheduleTask;
+----+--------------------------------+-------------------------------------------------------------+---------+---------+-------------+---------------------+---------------------+---------------------+
| Id | Name                           | Type                                                        | Seconds | Enabled | StopOnError | LastStartUtc        | LastEndUtc          | LastSuccessUtc      |
+----+--------------------------------+-------------------------------------------------------------+---------+---------+-------------+---------------------+---------------------+---------------------+
|  1 | Send emails                    | Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services  |      60 |       1 |           0 | 2022-05-04 06:28:29 | 2022-05-04 06:28:29 | 2022-05-04 06:28:29 |
|  2 | Keep alive                     | Nop.Services.Common.KeepAliveTask, Nop.Services             |     300 |       1 |           0 | 2022-05-04 06:26:59 | 2022-05-04 06:26:59 | 2022-05-04 06:26:59 |
|  3 | Delete guests                  | Nop.Services.Customers.DeleteGuestsTask, Nop.Services       |     600 |       1 |           0 | 2022-05-04 06:21:48 | 2022-05-04 06:21:48 | 2022-05-04 06:21:48 |
|  4 | Clear cache                    | Nop.Services.Caching.ClearCacheTask, Nop.Services           |     600 |       0 |           0 | NULL                | NULL                | NULL                |
|  5 | Clear log                      | Nop.Services.Logging.ClearLogTask, Nop.Services             |    3600 |       0 |           0 | 2022-03-02 14:02:50 | 2022-03-02 14:02:50 | 2022-03-02 14:02:50 |
|  6 | Update currency exchange rates | Nop.Services.Directory.UpdateExchangeRateTask, Nop.Services |    3600 |       1 |           0 | 2022-05-04 04:45:51 | 2022-05-04 04:45:51 | 2022-05-04 04:45:51 |
+----+--------------------------------+-------------------------------------------------------------+---------+---------+-------------+---------------------+---------------------+---------------------+

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.