[GH-ISSUE #1678] SQLITE_BUSY: database is locked #1252

Closed
opened 2026-02-26 06:36:25 +03:00 by kerem · 5 comments
Owner

Originally created by @miberecz on GitHub (Dec 23, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1678

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

After setting up everything as it written on the https://nginxproxymanager.com/guide/#quick-setup page, I get 'Bad Gateway' at login.
Checking the logs shows the following:

docker logs nginx-app-1

[12/23/2021] [3:16:46 PM] [Global   ] › ℹ  info      No valid environment variables for database provided, using default SQLite file '/data/database.sqlite'
[12/23/2021] [3:16:47 PM] [Global   ] › ✖  error     create table `knex_migrations` (`id` integer not null primary key autoincrement, `name` varchar(255), `batch` integer, `migration_time` datetime) - SQLITE_BUSY: database is locked

cat fallback_error.log

2021/12/23 15:17:01 [error] 285#285: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.111, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "192.168.0.104:81", referrer: "http://192.168.0.104:81/login"

Nginx Proxy Manager Version

v2.9.13

Expected behavior

To be able to login

Screenshots

image

Operating System

Linux, x86

Additional context

Content of docker-compose.yml

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
Originally created by @miberecz on GitHub (Dec 23, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1678 **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** <!-- A clear and concise description of what the bug is. --> After setting up everything as it written on the https://nginxproxymanager.com/guide/#quick-setup page, I get 'Bad Gateway' at login. Checking the logs shows the following: docker logs nginx-app-1 ``` [12/23/2021] [3:16:46 PM] [Global ] › ℹ info No valid environment variables for database provided, using default SQLite file '/data/database.sqlite' [12/23/2021] [3:16:47 PM] [Global ] › ✖ error create table `knex_migrations` (`id` integer not null primary key autoincrement, `name` varchar(255), `batch` integer, `migration_time` datetime) - SQLITE_BUSY: database is locked ``` cat fallback_error.log ``` 2021/12/23 15:17:01 [error] 285#285: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.111, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "192.168.0.104:81", referrer: "http://192.168.0.104:81/login" ``` **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> v2.9.13 **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> To be able to login **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> ![image](https://user-images.githubusercontent.com/13240971/147260111-f34615ad-cf08-438f-9558-6b878b1ee484.png) **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> Linux, x86 **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. --> Content of docker-compose.yml ```yml version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '81:81' - '443:443' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt ```
kerem 2026-02-26 06:36:25 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@TimekillerTK commented on GitHub (Jan 2, 2022):

@miberecz I came across this issue when trying to use a mounted SMB share with specific UID/GID, this was a file permissions issue and I resolved it by using different mounts with correct permissions.

<!-- gh-comment-id:1003721170 --> @TimekillerTK commented on GitHub (Jan 2, 2022): @miberecz I came across this issue when trying to use a mounted SMB share with specific UID/GID, this was a file permissions issue and I resolved it by using different mounts with correct permissions.
Author
Owner

@sunjx97 commented on GitHub (Jan 4, 2022):

I also had this problem before when I used a mounted SMB share. I mounted my folders with the fstab file like this

//myserver /mymount cifs username=*,password=*,uid=1000,gid=1000

As a result, I faced the same problem.
Finally, I resolved it by setting a parameter nolock, just like this:

//myserver /mymount cifs username=*,password=*,nolock,uid=1000,gid=1000

You can get more infomation with this url: Database is locked

<!-- gh-comment-id:1004705740 --> @sunjx97 commented on GitHub (Jan 4, 2022): I also had this problem before when I used a mounted SMB share. I mounted my folders with the fstab file like this ``` //myserver /mymount cifs username=*,password=*,uid=1000,gid=1000 ``` As a result, I faced the same problem. Finally, I resolved it by setting a parameter **nolock**, just like this: ``` //myserver /mymount cifs username=*,password=*,nolock,uid=1000,gid=1000 ``` You can get more infomation with this url: [Database is locked](https://blog.archiware.com/blog/pure_forum/pure-question-answers/database-is-locked/)
Author
Owner

@miberecz commented on GitHub (Jan 4, 2022):

Thank you guys, it makes sense now!

<!-- gh-comment-id:1005088215 --> @miberecz commented on GitHub (Jan 4, 2022): Thank you guys, it makes sense now!
Author
Owner

@Krojack commented on GitHub (Mar 6, 2023):

An update if someone comes across this now....

The nolock mount option is no longer valid for cifs. You need to nobrl

<!-- gh-comment-id:1456999745 --> @Krojack commented on GitHub (Mar 6, 2023): An update if someone comes across this now.... The `nolock` mount option is no longer valid for cifs. You need to `nobrl`
Author
Owner

@aogg commented on GitHub (Sep 7, 2023):

+1

<!-- gh-comment-id:1709440029 --> @aogg commented on GitHub (Sep 7, 2023): +1
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1252
No description provided.