Operating system
Linux
Joplin version
3.4.1
Sync target
Joplin Server
What issue do you have?
Long story, some highlights:
- deployed per the GitHub with docker-compose and basically no customization otherwise (Postgres DB, no storage driver)
- on a modest VPS (~1 GB RAM)
- accidentally uploaded maybe a dozen or two non-scaled images that are like 40MP, almost immediately started getting 504 gateway issues when trying to sync
took a number of actions already,
- restored to a recent db backup, no change
- figured out that the db was getting killed+restarted due to OOM; added a new swap file and reconfigured compose config to use it, verified that this issue is resolved, but 504 persists
- changed some nginx settings for timeouts and buffer sizes --> now 504 is gone, instead getting:
[error] App: 154.27.160.58 KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
- added DB_POOL_SIZE=20 to the environment variables, and via psql ran REINDEX and VACUUM full; --> no change
since I'm on a DB version without the large files and took several steps to add margin, not clear why it's still failing; maybe some cache somewhere still being processed but I have not been able to locate it?
anyway, searching I stumbled on this, and decided that maybe running everything through the DB is not viable on my modest system:
I added the relevant env variables (STORAGE_DRIVER, STORAGE_DRIVER_FALLBACK) and restarted the containers, no issues --> I assume working
but that doesn't address the issue if it's db performance and all of the data is in the db still, so I tried to migrate per the GitHub; this fails because of duplicated part of the path, I guess the GitHub needs to be updated?
- as follows:
/opt/joplin # docker exec -it joplin-app-1 node packages/server/dist/app.js storage import --connection 'Type=Filesystem; Path=/opt/joplin/storage'
node:internal/modules/cjs/loader:1143
throw err;
^
Error: Cannot find module '/home/joplin/packages/server/packages/server/dist/app.js'
- correcting that path issue, it tries to run and fails, repeating the last line incessantly:
2025-08-24 03:53:50: ImportContentCommand: Importing to storage: { type: 2, path: '/opt/joplin/storage' }
2025-08-24 03:53:50: ImportContentCommand: Batch size: 1000
2025-08-24 03:53:50: ImportContentCommand: Max content size: 200000000
2025-08-24 03:53:50: ImportContentCommand: Processing items 0 / 16421
2025-08-24 03:53:50: [error] ImportContentCommand: [Error: EACCES: permission denied, mkdir '/opt/joplin'] {
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/opt/joplin'
}
so here is where I am stuck. I will also point out one sentence from the above forum post that seems important but I don't see it reflected in the GitHub documentation:
You also need to add a docker volume ./data:/path/to/dir to persist the data on server.
any thoughts on where to go next? I'd really rather not nuke the existing db and start over, but it's starting to sound more and more attractive. but not sure how clients are going to handle that if there are conflicting local versions now... (sync has been broken for a couple weeks)
thanks!
