question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DB Connection Issues - Upgrade - 2.9.4

See original GitHub issue

Seem to have db connection issues with every upgrade and they are probably unrelated to NPM but always best to check.

I’ve updated to 2.9.4 and since the update, the app is reporting is unhealthy with connection issues to the db. Existing rules are working but I cannot login to NPM.

App logs are showing - error select * from migrations_lock - ER_UNKNOWN_STORAGE_ENGINE: Unknown storage engine ‘InnoDB’

Every second or so. Anyone else seeing similar issues? Have removed existing containers and re-pulled without success.

This is on an RPI4.

My Docker compose -

version: ‘3’ services: app: image: ‘jc21/nginx-proxy-manager:latest’ restart: always ports: - ‘80:80’ - ‘81:81’ - ‘443:443’ environment: DB_MYSQL_HOST: “db” DB_MYSQL_PORT: 3306 DB_MYSQL_USER: “DBUSERNAME” DB_MYSQL_PASSWORD: “DBPASSWORD” DB_MYSQL_NAME: “DBNAME” volumes: - /home/pi/Docker/npm/data:/data - /home/pi/Docker/npm/letsencrypt:/etc/letsencrypt depends_on: - db db: image: ‘jc21/mariadb-aria:latest’ restart: always environment: MYSQL_ROOT_PASSWORD: ROOTPASSWORD MYSQL_DATABASE: DBNAME MYSQL_USER: DBUSERNAME MYSQL_PASSWORD: DBPASSWORD volumes: - /home/pi/Docker/npm/data/mysql:/var/lib/mysql

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jiriteachcommented, Jun 22, 2021

Sure -

Backup your configuration first!

  1. Use mysqldump to dump out the structure as a .sql file.

mysqldump -h DBHOSTNAME -u DBUSERNAME -pDBPASSWORD DBNAME > npm_mariadb_backup.sql

  1. Use mysql2sqlite (https://github.com/dumblob/mysql2sqlite) to convert the parse the content in the .sql file through to a Sqlite3 database.

./mysql2sqlite npm_mariadb_backup.sql | sqlite3 npm_database.db

  1. Move the new Sqlite3 database file into the correct location.

/npm/data/npm_database.db

  1. Create a database configuration file for NPM to use a Sqlite3 database and save this as something like db_config.json.

{ “database”: { “engine”: “knex-native”, “knex”: { “client”: “sqlite3”, “connection”: { “filename”: “/data/npm_database.sqlite” }, “useNullAsDefault”: true } } }

  1. Update the docker-compose.yml to use the Sqlite3 database.

version: ‘3’ services: app: image: ‘jc21/nginx-proxy-manager:latest’ restart: always ports: - ‘80:80’ - ‘81:81’ - ‘443:443’ environment: DB_SQLITE_FILE: “/data/npm_database.sqlite” volumes: - /home/pi/Docker/npm/data:/data - /home/pi/Docker/npm/letsencrypt:/etc/letsencrypt - /home/pi/Docker/npm/config/db_configuration.json:/app/config/production.json

Should be all that is required. Keep an eye on the log - best way to do this is via Portainer and then you can clear up the other mysql directories inside /npm/data/ as they are no longer required.

1reaction
best-74commented, Jun 22, 2021

Ended up running a mysql dump then converting this to a sqlite3 db and using that. Works well against 2.9.4. This can be closed now. Thanks for the assistance.

Hmm, can you be helpfull and point on how to achieve this. I tried making a dump of my mariadb and convert it with at script, but when i tried to start with sqlite3 file it just deleted the file and startet from scratch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DB Connection Issues - Upgrade - 2.9.4 #1198 - GitHub
I've updated to 2.9.4 and since the update, the app is reporting is unhealthy with connection issues to the db. Existing rules are...
Read more >
AssertionError: database connection isn't set to UTC
I have done server setup multiple times with the same settings but this time, I am seeing the error message.
Read more >
ArcGIS Pro 2.9.2 SDE Database Connection Rename Issues
Solved: I am using ArcGIS Pro 2.9.2 software. When I make a connection to an SDE geodatabase on our SQL Server, I can...
Read more >
Database connection error on new install that has never worked.
Hi Folks, Ok, I'm relatively new to Linux but now know enough to just be dangerous. I've been doing Windows Server admin tasks...
Read more >
DBCP – Overview - Apache Commons
The application itself logs into the DBMS, and handles any user account issues internally. There are several Database Connection Pools already ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found