ConvertX icon indicating copy to clipboard operation
ConvertX copied to clipboard

SQLiteError when starting the image in Docker

Open andrevalenteai opened this issue 6 months ago • 4 comments

Describe the bug When I start the container in docker (on a Mac) I get an error message:

Bun v1.2.2 (Linux x64 baseline) ConvertX v0.14.1 1 | import { Database } from "bun:sqlite"; 2 | 3 | const db = new Database("./data/mydb.sqlite", { create: true }); ^ SQLiteError: unable to open database file errno: 14, byteOffset: -1, code: "SQLITE_CANTOPEN" at new Database (bun:sqlite:236:28) at /app/src/db/db.ts:3:12

To Reproduce Steps to reproduce the behavior:

  1. Go to Docker and click play to start the image. Image is up to date for c4illin/convertx:latest
  2. Click on logs
  3. See error message above

Checklist:

  • [X] I am accessing ConvertX over HTTPS or have HTTP_ALLOWED=true

andrevalenteai avatar Jul 03 '25 21:07 andrevalenteai

I had this too, initially I had the folder setup incorrectly for the Docker mount.

Once I fixed that it worked great.

Here is my full configuration if it helps:

  convertx:
    image: ghcr.io/c4illin/convertx
    container_name: convertx
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - JWT_SECRET=${CONVERTX_JWT_SECRET}
      - HTTP_ALLOWED=true
      - ALLOW_UNAUTHENTICATED=true
      - TZ=Europe/London
      - AUTO_DELETE_EVERY_N_HOURS=72
    volumes:
      - /home/user/convertx:/app/data

Rooster212 avatar Jul 17 '25 20:07 Rooster212

This is a permission issue or bad volume/mountpoint declaration. Verify your volumes section and paths;

/this/is/the/real/path:/this/is/the/app/path

So /home/user/convertx_dir:/app/data as Rooster212 pointed out. You shouldn't have permission errors if you are in your home directory. If you are elsewhere, you will need to do some chmod and possibly chown's.

fruitwerks avatar Jul 18 '25 05:07 fruitwerks

Having the same error

I made sure the path is correct and even made sure permissions are correct.

below is my config file

services:
  convertx:
    build:
      context: .
      # dockerfile: Debian.Dockerfile
    environment: # Defaults are listed below. All are optional.
      - ACCOUNT_REGISTRATION=true # true or false, doesn't matter for the first account (e.g. keep this to false if you only want one account)
      - JWT_SECRET= #will use randomUUID() by default
      - HTTP_ALLOWED=true # setting this to true is unsafe, only set this to true locally
      - ALLOW_UNAUTHENTICATED=true # allows anyone to use the service without logging in, only set this to true locally
      - AUTO_DELETE_EVERY_N_HOURS=24 # checks every n hours for files older then n hours and deletes them, set to 0 to disable
      # - FFMPEG_ARGS=-hwaccel vulkan # additional arguments to pass to ffmpeg
      # - WEBROOT=/convertx # the root path of the web interface, leave empty to disable
      # - HIDE_HISTORY=true # hides the history tab in the web interface, defaults to false
      - TZ=Europe/Stockholm # set your timezone, defaults to UTC
    ports:
      - 3000:3000
    volumes:
      - /home/user/git_repos/ConvertX/data:/app/data

Aztek1337 avatar Jul 21 '25 02:07 Aztek1337

As folks mentioned earlier it's likely a permission issue. I'm using fedora where SELinux is enabled by default so chmod-attempts to grant more permissions to the mounted folder didn't make any effect. Smth similar to ... helped me:

mkdir /var/convertx-data
semanage fcontext -a -t container_file_t "/var/convertx-data(/.\*)?" && restorecon -Rv /var/convertx-data
docker run -p 3000:3000 -v /var/convertx-data:/app/data ghcr.io/c4illin/convertx

0v3rt1r3d avatar Aug 16 '25 17:08 0v3rt1r3d