szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.66k stars 167 forks source link

JSON DB in Docker image does not appear to work properly #219

Open mcridermca opened 1 year ago

mcridermca commented 1 year ago

The docker image runs on SQLite beautifully, but when enabling JSON DB in Docker (MICROBIN_JSON_DB: "true"), the docker image fails to start, returning the following errors in the docker log:

2023-09-10T18:37:34 [ERROR] - Failed to create database file pasta_data/database.json: No such file or directory (os error 2)! thread 'main' panicked at 'Failed to create database file pasta_data/database.json: No such file or directory (os error 2)!', src/util/db_json.rs:38:21 stack backtrace: 0: 0x55a0fcafe1ae - 1: 0x55a0fc8346ff - 2: 0x55a0fcad6c84 - 3: 0x55a0fcaffa0f - 4: 0x55a0fcaff60e - 5: 0x55a0fcb00680 - 6: 0x55a0fcb00164 - 7: 0x55a0fcb000c6 - 8: 0x55a0fcb000b1 - 9: 0x55a0fc70df42 - 10: 0x55a0fc76416a - 11: 0x55a0fc7644bf - 12: 0x55a0fc94e314 - 13: 0x55a0fc941435 - 14: 0x55a0fc93a743 - 15: 0x55a0fc93f24b - 16: 0x7f5743c9b18a - 17: 0x7f5743c9b245 - __libc_start_main 18: 0x55a0fc7268fa - 19: 0x0 -

I have tried to create the "pasta_data" directory manually in the mapped docker folder, but that does not appear to work.

Love the application. Keep up the good work!

Matszwe02 commented 6 months ago

I fixed it with that config option:

volumes:
  - ./microbin/data:/app/microbin_data
  - ./microbin/pasta:/app/pasta_data

But yeah, @szabodanika move it to microbin_data to avoid confusion