# Unable to lock level db error

**URL:** <https://forum.gitea.com/t/unable-to-lock-level-db-error/5456>\
**Category:** Install/Maintain/Configure\
**Created:** [July 7, 2022, 8:22am UTC](https://forum.gitea.com/t/unable-to-lock-level-db-error/5456 "2022-07-07T08:22:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OCram85](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ocram85/32/4947_2.png) [@OCram85](https://forum.gitea.com/u/OCram85)\
**Post date:** [July 7, 2022, 8:22am UTC](https://forum.gitea.com/t/unable-to-lock-level-db-error/5456/1 "2022-07-07T08:22:27Z")

</div>

Due to the recent discussions about github ([GiveUpGithub](https://giveupgithub.org/)) I’ve decided to migrate all my repos to my personal gitea instance. I’m using gitea already in different environments and just started a new docker based instance.

But I’m getting these errors from time to time, and the container instance restarts: `unable to lock level db at /data/gitea/queues/common`.

Any idea what could be the cause?

Containerl log:

```auto
Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
2022/07/07 09:28:44 cmd/web.go:102:runWeb() [I] Starting Gitea on PID: 18
2022/07/07 09:28:44 cmd/web.go:150:runWeb() [I] Global init
2022/07/07 09:28:44 routers/init.go:107:GlobalInitInstalled() [I] Git Version: 2.30.3, Wire Protocol Version 2 Enabled
2022/07/07 09:28:44 routers/init.go:110:GlobalInitInstalled() [I] AppPath: /usr/local/bin/gitea
2022/07/07 09:28:44 routers/init.go:111:GlobalInitInstalled() [I] AppWorkPath: /app/gitea
2022/07/07 09:28:44 routers/init.go:112:GlobalInitInstalled() [I] Custom path: /data/gitea
2022/07/07 09:28:44 routers/init.go:113:GlobalInitInstalled() [I] Log path: /data/gitea/log
2022/07/07 09:28:44 routers/init.go:114:GlobalInitInstalled() [I] Configuration file: /data/gitea/conf/app.ini
2022/07/07 09:28:44 routers/init.go:115:GlobalInitInstalled() [I] Run Mode: Prod
2022/07/07 09:28:44 ...dules/setting/log.go:287:newLogService() [I] Gitea v1.16.8 built with GNU Make 4.3, go1.18.2 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2022/07/07 09:28:44 ...dules/setting/log.go:334:newLogService() [I] Gitea Log Mode: Console(Console:)
2022/07/07 09:28:44 ...dules/setting/log.go:250:generateNamedLogger() [I] Router Log: Console(console:)
2022/07/07 09:28:44 ...les/setting/cache.go:78:newCacheService() [I] Cache Service Enabled
2022/07/07 09:28:44 ...les/setting/cache.go:93:newCacheService() [I] Last Commit Cache Service Enabled
2022/07/07 09:28:44 ...s/setting/session.go:75:newSessionService() [I] Session Service Enabled
2022/07/07 09:28:44 ...es/setting/mailer.go:127:newMailService() [I] Mail Service Enabled
2022/07/07 09:28:44 ...es/setting/mailer.go:138:newRegisterMailService() [I] Register Mail Service Enabled
2022/07/07 09:28:44 ...es/setting/mailer.go:149:newNotifyMailService() [I] Notify Mail Service Enabled
2022/07/07 09:28:44 ...s/storage/storage.go:171:initAttachments() [I] Initialising Attachment storage with type: 
2022/07/07 09:28:44 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments
2022/07/07 09:28:44 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type: 
2022/07/07 09:28:44 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars
2022/07/07 09:28:44 ...s/storage/storage.go:183:initRepoAvatars() [I] Initialising Repository Avatar storage with type: 
2022/07/07 09:28:44 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars
2022/07/07 09:28:44 ...s/storage/storage.go:177:initLFS() [I] Initialising LFS storage with type: 
2022/07/07 09:28:44 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs
2022/07/07 09:28:44 ...s/storage/storage.go:189:initRepoArchives() [I] Initialising Repository Archive storage with type: 
2022/07/07 09:28:44 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: level for notification-service cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"notification-service-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: level for mail cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mail-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: level for push_update cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"push_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: unique-level for repo-archive cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo-archive-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 routers/init.go:131:GlobalInitInstalled() [I] SQLite3 support is enabled
2022/07/07 09:28:45 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.
2022/07/07 09:28:45 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2022/07/07 09:28:45 cmd/web.go:153:runWeb() [I] PING DATABASE postgres
2022/07/07 09:28:45 cmd/web.go:153:runWeb() [W] Table user Column max_repo_creation db default is '-1', struct default is -1
2022/07/07 09:28:45 routers/init.go:137:GlobalInitInstalled() [I] ORM engine initialization successful!
2022/07/07 09:28:45 ...les/queue/setting.go:53:CreateQueue() [W] Unable to create queue for issue_indexer: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...les/queue/setting.go:54:CreateQueue() [W] Attempting to create wrapped queue
2022/07/07 09:28:45 ...er/issues/indexer.go:144:func2() [I] PID 18: Initializing Issue Indexer: bleve
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: unique-level for repo_stats_update cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo_stats_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...xer/stats/indexer.go:39:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: unique-level for pr_patch_checker cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"pr_patch_checker-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: unique-level for mirror cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mirror-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 1] Failed to create queue: level for task cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"task-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:45 ...xer/stats/indexer.go:85:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2022/07/07 09:28:45 cmd/web.go:208:listen() [I] Listen: http://0.0.0.0:3000
2022/07/07 09:28:45 cmd/web.go:212:listen() [I] AppURL(ROOT_URL): https://gitea.ocram85.com/
2022/07/07 09:28:45 cmd/web.go:215:listen() [I] LFS server enabled
2022/07/07 09:28:45 ...s/graceful/server.go:61:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 18
2022/07/07 09:28:53 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: unique-level for repo-archive cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo-archive-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:53 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: level for push_update cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"push_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:53 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: level for notification-service cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"notification-service-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:53 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: level for mail cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mail-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:54 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: level for task cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"task-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:54 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: unique-level for mirror cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mirror-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:54 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: unique-level for pr_patch_checker cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"pr_patch_checker-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:28:54 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 2] Failed to create queue: unique-level for repo_stats_update cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo_stats_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:02 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: level for mail cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mail-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:02 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: level for push_update cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"push_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:02 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: unique-level for repo-archive cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo-archive-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:02 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: level for notification-service cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"notification-service-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:03 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: unique-level for repo_stats_update cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo_stats_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:03 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: unique-level for mirror cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mirror-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:03 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: level for task cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"task-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:03 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 3] Failed to create queue: unique-level for pr_patch_checker cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"pr_patch_checker-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:11 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: level for notification-service cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"notification-service-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:11 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: unique-level for repo-archive cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo-archive-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:11 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: level for push_update cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"push_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:11 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: level for mail cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mail-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:12 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: unique-level for repo_stats_update cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:20, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"repo_stats_update-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:12 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: unique-level for pr_patch_checker cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"pr_patch_checker-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:12 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: level for task cfg: queue.LevelQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"task-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:12 ...eue/queue_wrapped.go:73:setInternal() [W] [Attempt: 4] Failed to create queue: unique-level for mirror cfg: queue.LevelUniqueQueueConfiguration{ByteFIFOQueueConfiguration:queue.ByteFIFOQueueConfiguration{WorkerPoolConfiguration:queue.WorkerPoolConfiguration{QueueLength:1000, BatchLength:20, BlockTimeout:1000000000, BoostTimeout:300000000000, BoostWorkers:1, MaxWorkers:5}, Workers:0, Name:"mirror-level", WaitOnEmpty:false}, DataDir:"/data/gitea/queues/common", ConnectionString:"", QueueName:""} error: unable to lock level db at /data/gitea/queues/common: resource temporarily unavailable
2022/07/07 09:29:15 ...er/issues/indexer.go:230:func3() [F] Issue Indexer Initialization timed-out after: 30s
Received signal 15; terminating.

```

Used docker stack:

```auto
version: "3.8"

services:
  gitea:
    image: gitea/gitea:1.16.8
    container_name: gitea
    restart: unless-stopped
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA __database__ DB_TYPE=postgres
      - GITEA __database__ HOST=giteadb:5432
      - GITEA __database__ NAME=gitea
      - GITEA __database__ USER=giteausr
      - GITEA __database__ PASSWD=giteapasswd
      #- GITEA __mailer__ IS_TLS_ENABLED=false
      # - GITEA __webhook__ ALLOWED_HOST_LIST=*
    deploy:
      replicas: 1
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        - "traefik.http.routers.gitea.rule=Host(`gitea.ocram85.com`)"
        - "traefik.http.routers.gitea.tls.certresolver=myresolver"
        - "traefik.http.services.gitea-srv.loadbalancer.server.port=3000"
    networks:
      - cicd
      - traefik-public
    volumes:
      - /opt/volumes/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - giteadb

  giteadb:
    image: postgres:14.4
    container_name: giteadb
    restart: unless-stopped
    environment:
      - POSTGRES_USER=giteausr
      - POSTGRES_PASSWORD=giteapasswd
      - POSTGRES_DB=gitea
    networks:
      - cicd
    volumes:
      - /opt/volumes/giteadb:/var/lib/postgresql/data
  
networks:
  cicd:
    external: false
    attachable: false
  traefik-public:
    external: true

```

---

<div class="post-metadata">

**Author:** ![scubbo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/scubbo/32/3331_2.png) [@scubbo](https://forum.gitea.com/u/scubbo)\
**Post date:** [January 3, 2023, 6:43pm UTC](https://forum.gitea.com/t/unable-to-lock-level-db-error/5456/2 "2023-01-03T18:43:06Z")

</div>

I’m getting similar errors - did you find a fix for this?

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [January 3, 2023, 9:36pm UTC](https://forum.gitea.com/t/unable-to-lock-level-db-error/5456/3 "2023-01-03T21:36:27Z")

</div>

I am not familiar with Docker, but the error received `error: unable to lock level db at ...: resource temporarily unavailable` means that LevelDB file is in use by another program. My guess is that Gitea is already running when you’re trying to start the container, or maybe an anti-virus or similar program is scanning the file.

---

<div class="post-metadata">

**Author:** ![nickyquinn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nickyquinn/32/6673_2.png) [@nickyquinn](https://forum.gitea.com/u/nickyquinn)\
**Post date:** [February 15, 2025, 9:07am UTC](https://forum.gitea.com/t/unable-to-lock-level-db-error/5456/4 "2025-02-15T09:07:06Z")

</div>

I had this issue after my docker server lost power suddenly; the solution that worked for me (as long as you’re sure there really isn’t any other instance using the db) is to go to `/data/gitea/queues/common` and remove the LOCK file, then start up/restart gitea.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [June 15, 2025, 1:20am UTC](https://forum.gitea.com/t/unable-to-lock-level-db-error/5456/5 "2025-06-15T01:20:02Z")

</div>

> This issue is caused by LevelDB corruption, which can occur after a power loss. Deleting the LevelDB files and restarting the application should resolve the problem.
