Skip to content

After Updating to SQLITE problems changing settings. #1643

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

Closed
MRC-Karel opened this issue Dec 9, 2021 · 5 comments
Closed

After Updating to SQLITE problems changing settings. #1643

MRC-Karel opened this issue Dec 9, 2021 · 5 comments

Comments

@MRC-Karel
Copy link

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
Updated from the mariadb to sqlite using the provided tutorial. All looks ok, but when trying to add an entry it says "internal error". Looks like an issue with SQLITE: SQLITE_CONSTRAINT: NOT NULL constraint failed: proxy_host.id

Nginx Proxy Manager Version
v2.9.12

** Docker Compose

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
      - '5900:5900'
    environment:
      - DB_SQLITE_FILE=/data/database.sqlite
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    restart: unless-stopped

*** Logs
https://pastebin.com/zeAbPriY

@MRC-Karel MRC-Karel added the bug label Dec 9, 2021
@PlasmatikSteak
Copy link

Could you please link to the tutorial you used when you updated from MariaDB to SQLite?

@MRC-Karel
Copy link
Author

MRC-Karel commented Dec 17, 2021

I used this one.
#1529

What I remember, is using dbreaver export the db, convert to sqlite file and use that in the dockder-compose file.

In the end I used a fresh instance, and rentered everything manually.

@sadrian80
Copy link

sadrian80 commented Sep 19, 2022

I'm encountering the same issue. I deployed a fresh instance, stopped it, migrated the MariaDB to SQLITE via the tutorial posted above. Then I copied the data and ssl volumes over. Everything is working fine but I can't make any changes as they will result in an SQLITE error:

{… data to be written …} SQLITE_CONSTRAINT: NOT NULL constraint failed: proxy_host.id

database.sqlite has permissions 644. Location unaltered.
I used the default compose.yml and only altered the volumes to persistent ones and added my network.

== EDIT ==
I compared the structure of a fresh SQLITE database against the migrated one. They are different:
https://capture.dropbox.com/JSU4fd8VVRWRJHfX

== SOLUTION ==
The issue comes from the different table properties after migration. I verfied it by altering the table «proxy_host». Once verfied I did the following:

  1. Deploy fresh instance
  2. Get the database.sqlite from the fresh instance
  3. Migrate via DBeaver, either from MariaDB or SQLite
  4. Don't choose "Truncate target tables" (leave unchecked!)
  5. Migrate and put back the SQLite database
  6. Restart Nginx container

The SQLite database from a freshly deployed instance has all tables setup as they should but no entries, so there's no need to truncate (wipe clean) the target DB. If you do, all tables will be created with the settings from origin, and there seems to be the issue.

Copy link

Issue is now considered stale. If you want to keep it open, please comment 👍

@github-actions github-actions bot added the stale label Feb 29, 2024
Copy link

Issue was closed due to inactivity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2025
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

3 participants