Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot initialise new mysql database: An exception was thrown while activating Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader #4888

Closed
sami016 opened this issue Jun 24, 2020 · 21 comments

Comments

@sami016
Copy link

sami016 commented Jun 24, 2020

nopCommerce version:

4.30

Steps to reproduce the problem:

  • Go to install page for fresh install
  • Enter in a valid connection string to an empty database
  • Click install

The following error prevents the installation from succeeding:

Setup failed: An exception was thrown while activating Nop.Data.Migrations.MigrationManager -> λ:FluentMigrator.Runner.IVersionLoader.

MySqlException: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

@AndreiMaz
Copy link
Member

@sami016 We cannot reproduce the issue. The installation works fine.

Please provide more information on how we can reproduce the issue

@exileDev
Copy link
Contributor

Error description speaks for itself. When the system variable 'sql_require_primary_key' is set to ON MySQL requires tables to contain a primary key, but nopCommerce has some tables without PK. Please set the system variable 'sql_require_primary_key' to OFF and try to install again

@tcorps
Copy link

tcorps commented Jul 16, 2021

hello I have exactly the same problem as described below despite having set the primary sql key off the problem is always done I have configured my sql table like this
sudo mysql_secure_installation
sudo mysql
mysql> CREATE USER 'sammy' @ 'localhost' IDENTIFIED BY 'password';
mysql> GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *. * TO 'sammy' @ 'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> exit

mysqladmin Ver 8.0.25-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
Copyright (c) 2000, 2021, Oracle and / or its affiliates.

Oracle is a registered trademark of Oracle Corporation and / or its
affiliates. Other names may be trademarks of their respective
owners.

Server version 8.0.25-0ubuntu0.20.04.1
Protocol version 10
Localhost connection via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 1 day 7 hours 51 min 47 sec

Threads: 2 Questions: 146 Slow queries: 0 Opens: 234 Flush tables: 3 Open tables: 153 Queries per second avg: 0.001

@PeterZhukov
Copy link

2021-09-02 21:04:32.130 MSK [8576] ERROR: type "citext" does not exist at character 63
2021-09-02 21:04:32.130 MSK [8576] STATEMENT: ALTER TABLE "public"."MigrationVersionInfo" ADD "Description" citext NULL

@exileDev
Copy link
Contributor

exileDev commented Sep 3, 2021

@PeterZhukov CREATE EXTENSION citext; then try again. This extension is required because the nopCommerce is case insensitive when working with a database.

@ozgurerdogan
Copy link

hello I have exactly the same problem as described below despite having set the primary sql key off the problem is always done I have configured my sql table like this sudo mysql_secure_installation sudo mysql mysql> CREATE USER 'sammy' @ 'localhost' IDENTIFIED BY 'password'; mysql> GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *. * TO 'sammy' @ 'localhost' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> exit

mysqladmin Ver 8.0.25-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) Copyright (c) 2000, 2021, Oracle and / or its affiliates.

Oracle is a registered trademark of Oracle Corporation and / or its affiliates. Other names may be trademarks of their respective owners.

Server version 8.0.25-0ubuntu0.20.04.1 Protocol version 10 Localhost connection via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 1 day 7 hours 51 min 47 sec

Threads: 2 Questions: 146 Slow queries: 0 Opens: 234 Flush tables: 3 Open tables: 153 Queries per second avg: 0.001

Did you find a solution?

@trofunenko
Copy link

I have the same error during installation process with empty database.

Server: Ubuntu 18.04.6 LTS
PostgreSQL 10.18 (Ubuntu 10.18-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu.

Build and deploy follows way :
Commit: b81e355
Branch: develop
dotnet restore ./src/NopCommerce.sln
dotnet build ./src/Nop.Web.csproj -c Release -o /app
dotnet publish ./src/Presentation/Nop.Web/Nop.Web.csproj -c Release -o ./app/published

Database and user have been created :
postgres=# CREATE USER user WITH ENCRYPTED PASSWORD 'userpass';
postgres=# create database XXX;
postgres=# grant all privileges on database XXX to user;

@ozgurerdogan
Copy link

I had to install mysql 5.7 and error gone.

@trofunenko
Copy link

trofunenko commented Nov 8, 2021

I'm trying investigate root of issue. I've changed web.config, stdoutLogEnable = "true" and restart application but can't find full description of the exception. Looks like the one related with permission #5304

tail -f /var/log/syslog - the way how to view nopcommerce info and error messages.

I've dropped data base then install password for default postgres user and start installation process with one. It works for me.

@sandeep18051989
Copy link

Hi,
I am also trying to install fresh nopcommerce 4.4 on a azure hosted MySql instance, but getting the same issue. In first run, app generated tables but while inserting default/required data throwed exception "Transaction" related exception.
Then I removed the schema and creatred a new database to try again, then it is not going to the installation loading screen, after I click Install button, it starts throwing this exception we are talking about.
It is veri wiered, we have tried MySQL, PostGreSQL database on 2 different hosting servers AWS and Azure, but not getting any luck.

@ryanlee714
Copy link

I try to install nopCommerce 4.50.3 with MySql 8.0.29 on Ubuntu 20.04. The installation page was able to load. After I clicked Install, following error message was shown:

Setup failed: An exception was thrown while activating λ:FluentMigrator.Runner.IVersionLoade
Screenshot (1)

@kevingermain
Copy link

@ryanlee714 I got the same trouble today

@digitalray
Copy link

@ryanlee714 The issue is with the version of MySQL. You need to change it in code to 8.0.29 and recompile the app. Please see: #6284

@ryanlee714
Copy link

@digitalray I had the same issue while I was installing nopCommerce 4.50.2. I knew it must be related to MySQL 8.0.29. But I couldn't fix it. I was waiting for 4.50.3 to be released. Hopefully nop developers could fix the problem. Same issue happened with nopCommerce 4.50.3. I'm not an expert with Visual Studio. I can change the code to 8.0.29, but I can't publish it to server correctly. I need someone who can help me. My email is ryanlee714@gmail.com, please email me, so we can get in touch.
Thank you in advance

@pranjalSL
Copy link

Getting the same issue 'Setup failed: An exception was thrown while activating λ:FluentMigrator.Runner.IVersionLoader.' on Configuration screen of Nop Commerce after building and running the web app via VS.

@glhays
Copy link

glhays commented Jun 28, 2022 via email

@ryanlee714
Copy link

@glhays I tried solution suggested by @digitalray, this issue didn't pop up again. But installation process crashed and timed out.
They updated Linux installation guide to 4.50.3. They haven't done enough tests on 4.50.3 with MySQL 8.0.29 on Ubuntu. A lot of people, myself included, can't install it correctly. I'm not happy with nopCommerce team.

@kevingermain
Copy link

kevingermain commented Jun 30, 2022

@glhays I use PostgreSQL in my side so it's not question of MySQL version for my side.

@glhays
Copy link

glhays commented Jun 30, 2022 via email

@pranjalSL
Copy link

pranjalSL commented Jul 15, 2022

I am also getting the same exception. I tried to debug and found out that error is happening at line no. 226 inside the InstallController.cs class (Nop.web -> Controllers -> InstallController.cs). Also attaching a snapshot for reference
Screenshot 2022-07-15 at 5 03 01 PM
.
Screenshot 2022-07-15 at 5 06 04 PM

@exileDev

@zzt0341011
Copy link

这么多相同的问题,官方为啥不给解决办法?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests