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
I looked at that as well.
I also found a few connection issues after which the mentioned KyeNotFoundException started to occur. I guess this somehow messed up everything.


May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: System.IO.IOException: Unable to write data to the transport connection: Broken pipe.#012 ---> System.Net.Sockets.SocketException (32): Broken pipe#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   --- End of inner exception stack trace ---#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   at System.Net.Security.SslStream.WriteSingleChunk[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.WriteAsyncInternal[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet)#012   at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute)#012   at MySql.Data.MySqlClient.NativeDriver.Close(Boolean isOpen)
May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28  #033[41m#033[30mfail#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
May  5 06:21:28        An unhandled exception has occurred while executing the request.
May  5 06:21:28  Autofac.Core.DependencyResolutionException: An exception was thrown while activating Nop.Web.Framework.WebWorkContext -> Nop.Services.Directory.CurrencyService -> Nop.Services.Directory.ExchangeRatePluginManager -> Nop.Services.Plugins.PluginService -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28   ---> System.AggregateException: One or more errors occurred. (Connection refused xx.xxx.xxx.xxx:3306)
May  5 06:21:28   ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused xx.xxx.xxx.xxx:3306
May  5 06:21:28     at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
2 years ago
bojanadejanovic wrote:
I looked at that as well.
I also found a few connection issues after which the mentioned KyeNotFoundException started to occur. I guess this somehow messed up everything.


May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: System.IO.IOException: Unable to write data to the transport connection: Broken pipe.#012 ---> System.Net.Sockets.SocketException (32): Broken pipe#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   --- End of inner exception stack trace ---#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   at System.Net.Security.SslStream.WriteSingleChunk[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.WriteAsyncInternal[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet)#012   at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute)#012   at MySql.Data.MySqlClient.NativeDriver.Close(Boolean isOpen)
May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28  #033[41m#033[30mfail#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
May  5 06:21:28        An unhandled exception has occurred while executing the request.
May  5 06:21:28  Autofac.Core.DependencyResolutionException: An exception was thrown while activating Nop.Web.Framework.WebWorkContext -> Nop.Services.Directory.CurrencyService -> Nop.Services.Directory.ExchangeRatePluginManager -> Nop.Services.Plugins.PluginService -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28   ---> System.AggregateException: One or more errors occurred. (Connection refused xx.xxx.xxx.xxx:3306)
May  5 06:21:28   ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused xx.xxx.xxx.xxx:3306
May  5 06:21:28     at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)


I noticed this error message "May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts."
     - Have you added any PORT variable in your connection string? - if so, make sure that is placed in the right order (the order of the variable should be something like this: "server=;port=;database=;uid=;pwd=" or "server=;database=;uid=;pwd=".) or remove it from the connection string.
     - Also, make sure the port used by MySQL is available (open) and listening for connections (firewall settings and so on).
2 years ago
daniel.siljanovski wrote:
I looked at that as well.
I also found a few connection issues after which the mentioned KyeNotFoundException started to occur. I guess this somehow messed up everything.


May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: System.IO.IOException: Unable to write data to the transport connection: Broken pipe.#012 ---> System.Net.Sockets.SocketException (32): Broken pipe#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   --- End of inner exception stack trace ---#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   at System.Net.Security.SslStream.WriteSingleChunk[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.WriteAsyncInternal[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet)#012   at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute)#012   at MySql.Data.MySqlClient.NativeDriver.Close(Boolean isOpen)
May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28  #033[41m#033[30mfail#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
May  5 06:21:28        An unhandled exception has occurred while executing the request.
May  5 06:21:28  Autofac.Core.DependencyResolutionException: An exception was thrown while activating Nop.Web.Framework.WebWorkContext -> Nop.Services.Directory.CurrencyService -> Nop.Services.Directory.ExchangeRatePluginManager -> Nop.Services.Plugins.PluginService -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28   ---> System.AggregateException: One or more errors occurred. (Connection refused xx.xxx.xxx.xxx:3306)
May  5 06:21:28   ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused xx.xxx.xxx.xxx:3306
May  5 06:21:28     at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)


I noticed this error message "May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts."
     - Have you added any PORT variable in your connection string? - if so, make sure that is placed in the right order (the order of the variable should be something like this: "server=;port=;database=;uid=;pwd=" or "server=;database=;uid=;pwd=".) or remove it from the connection string.
     - Also, make sure the port used by MySQL is available (open) and listening for connections (firewall settings and so on).


Yes, I did, but it worked even with that.
I tried removing it now but no success.
I have it like this serv=, db=, uid=, pwd=
Still getting KeyNotFoundException.
Mysql server is online and listening for connections:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:33060         0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      -
2 years ago
My data settings.json hasn't been changed. So I'm guessing it's something either a file, or one of the tasks has an issue.

I'll disable the tasks and see if that works.
2 years ago
Already disabled them, no results.
2 years ago
bojanadejanovic wrote:
I looked at that as well.
I also found a few connection issues after which the mentioned KyeNotFoundException started to occur. I guess this somehow messed up everything.


May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: System.IO.IOException: Unable to write data to the transport connection: Broken pipe.#012 ---> System.Net.Sockets.SocketException (32): Broken pipe#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   --- End of inner exception stack trace ---#012   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)#012   at System.Net.Security.SslStream.WriteSingleChunk[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.WriteAsyncInternal[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)#012   at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count)#012   at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet)#012   at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute)#012   at MySql.Data.MySqlClient.NativeDriver.Close(Boolean isOpen)
May  5 06:21:28  dotnet: Nop.Web Error: 0 :
May  5 06:21:28  dotnet: Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28  #033[41m#033[30mfail#033[39m#033[22m#033[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
May  5 06:21:28        An unhandled exception has occurred while executing the request.
May  5 06:21:28  Autofac.Core.DependencyResolutionException: An exception was thrown while activating Nop.Web.Framework.WebWorkContext -> Nop.Services.Directory.CurrencyService -> Nop.Services.Directory.ExchangeRatePluginManager -> Nop.Services.Plugins.PluginService -> Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.
May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
May  5 06:21:28   ---> System.AggregateException: One or more errors occurred. (Connection refused xx.xxx.xxx.xxx:3306)
May  5 06:21:28   ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused xx.xxx.xxx.xxx:3306
May  5 06:21:28     at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
May  5 06:21:28     at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)


I noticed this error message "May  5 06:21:28   ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts."
     - Have you added any PORT variable in your connection string? - if so, make sure that is placed in the right order (the order of the variable should be something like this: "server=;port=;database=;uid=;pwd=" or "server=;database=;uid=;pwd=".) or remove it from the connection string.
     - Also, make sure the port used by MySQL is available (open) and listening for connections (firewall settings and so on).

Yes, I did, but it worked even with that.
I tried removing it now but no success.
I have it like this serv=, db=, uid=, pwd=
Still getting KeyNotFoundException.
Mysql server is online and listening for connections:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:33060         0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      -



Please check this link too https://docs.nopcommerce.com/en/installation-and-upgrading/installing-nopcommerce/installing-on-linux.html
2 years ago
dotnet: System.IO.IOException: Unable to write data
Sounds like a Permission issue.

Let me try to install this on Ubuntu with Mysql. It's about time now.
Hopefully, you have root permissions assigned to the "username" and "disabled root user" on your ubuntu.

Let me check
2 years ago
I have experienced similar issue with nopCommerce 4.30.

Even though I didn't upgrade anything myself it looks like mysql packages were updated by "/usr/bin/unattended-upgrade" on 05-05-2022:
- mysql-client-core-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-client-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-server:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-server-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2), mysql-server-core-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)

I tried to downgrade the "mysql-client" packages to "8.0.19-0ubuntu5", but it didn't help. On the other hand I didn't even try to downgrade "mysql-server", because I was too afraid of messing up my configuration.

So the solution for me was to upgrade "MySql.Data" nuget package to the newest version 8.0.29.

Based on the fact that I've seen the same error messages as mentioned above about database collation I believe the recent MySQL changes around utf8 -> utf8mb3 were the culprit (https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-29.html#mysqld-8-0-29-charset), even though my databases use utf8mb4 collation. But I'm not 100% sure about that and I can't exactly pin point which change broke the nopCommerce.
2 years ago
SzmergieL wrote:
I have experienced similar issue with nopCommerce 4.30.

Even though I didn't upgrade anything myself it looks like mysql packages were updated by "/usr/bin/unattended-upgrade" on 05-05-2022:
- mysql-client-core-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-client-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-server:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-server-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2), mysql-server-core-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)

I tried to downgrade the "mysql-client" packages to "8.0.19-0ubuntu5", but it didn't help. On the other hand I didn't even try to downgrade "mysql-server", because I was too afraid of messing up my configuration.

So the solution for me was to upgrade "MySql.Data" nuget package to the newest version 8.0.29.

Based on the fact that I've seen the same error messages as mentioned above about database collation I believe the recent MySQL changes around utf8 -> utf8mb3 were the culprit (https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-29.html#mysqld-8-0-29-charset), even though my databases use utf8mb4 collation. But I'm not 100% sure about that and I can't exactly pin point which change broke the nopCommerce.



Yes, I just found out that the very same upgrade of packages seems to broke nopCommerce.
The time of errors in the service matches the upgrade time of these packages on the db server.

bojana@350t:~$ grep -E ' (install|upgrade) ' /var/log/dpkg.log
2022-05-05 06:20:58 upgrade mysql-client-8.0:amd64 8.0.28-0ubuntu0.20.04.3 8.0.29-0ubuntu0.20.04.2
2022-05-05 06:21:09 upgrade mysql-server-8.0:amd64 8.0.28-0ubuntu0.20.04.3 8.0.29-0ubuntu0.20.04.2
2022-05-05 06:21:14 upgrade mysql-server-core-8.0:amd64 8.0.28-0ubuntu0.20.04.3 8.0.29-0ubuntu0.20.04.2
2022-05-05 06:21:48 upgrade mysql-client-core-8.0:amd64 8.0.28-0ubuntu0.20.04.3 8.0.29-0ubuntu0.20.04.2
2022-05-05 06:21:57 upgrade mysql-server:all 8.0.28-0ubuntu0.20.04.3 8.0.29-0ubuntu0.20.04.2
2022-05-06 06:41:31 upgrade mysql-client-8.0:amd64 8.0.29-0ubuntu0.20.04.2 8.0.29-0ubuntu0.20.04.3
2022-05-06 06:41:41 upgrade mysql-server:all 8.0.29-0ubuntu0.20.04.2 8.0.29-0ubuntu0.20.04.3
2022-05-06 06:41:51 upgrade mysql-server-8.0:amd64 8.0.29-0ubuntu0.20.04.2 8.0.29-0ubuntu0.20.04.3
2022-05-06 06:41:55 upgrade mysql-server-core-8.0:amd64 8.0.29-0ubuntu0.20.04.2 8.0.29-0ubuntu0.20.04.3
2022-05-06 06:42:25 upgrade mysql-client-core-8.0:amd64 8.0.29-0ubuntu0.20.04.2 8.0.29-0ubuntu0.20.04.3

And I thought I disabled unattended upgrades. -.-
So downgrading didn't help? I thought to try that first.
How did you updated MySql.Data.dll? You've built from source v4.30?
2 years ago
SzmergieL wrote:
I have experienced similar issue with nopCommerce 4.30.

Even though I didn't upgrade anything myself it looks like mysql packages were updated by "/usr/bin/unattended-upgrade" on 05-05-2022:
- mysql-client-core-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-client-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-server:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)
- mysql-server-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2), mysql-server-core-8.0:amd64 (8.0.28-0ubuntu0.20.04.3, 8.0.29-0ubuntu0.20.04.2)

I tried to downgrade the "mysql-client" packages to "8.0.19-0ubuntu5", but it didn't help. On the other hand I didn't even try to downgrade "mysql-server", because I was too afraid of messing up my configuration.

So the solution for me was to upgrade "MySql.Data" nuget package to the newest version 8.0.29.

Based on the fact that I've seen the same error messages as mentioned above about database collation I believe the recent MySQL changes around utf8 -> utf8mb3 were the culprit (https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-29.html#mysqld-8-0-29-charset), even though my databases use utf8mb4 collation. But I'm not 100% sure about that and I can't exactly pin point which change broke the nopCommerce.


I want to thank you because it's seems that upgrading MySql.Data.dll to 8.0.29 and replacing it with old 8.0.20 fixed the problem! I was able to start nopCommerce service! Yay!
Thanks a ton!

Also I made sure that unattended upgrades are disabled! :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.