jobsync icon indicating copy to clipboard operation
jobsync copied to clipboard

SQLite database error

Open koshrf opened this issue 11 months ago • 5 comments

Tried to do a compose up -d after a git clone of the repository, waited for the build and after few seconds the container goes down.

npm WARN exec The following package was not found and will be installed: [email protected]
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "dev.db" at "file:/data/dev.db"

Error: Schema engine error:
SQLite database error
unable to open database file: /data/dev.db

npm notice 
npm notice New major version of npm available! 9.6.4 -> 11.0.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.0.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 

Tried to create the database by hand but I'm getting a read-only problem when the application try to reach it.

koshrf avatar Jan 06 '25 21:01 koshrf

Temporal fix:

sudo touch jobsyncdb/data/dev.db

And edit the docker-compose.yml to run as root with a user: "0"

The container run normally as nextjs user and was getting read-only problems even when the file had 0666 permissions, didn't want to deal with it atm so just ran the container as root and will change the dockerfile and compose later to accomodate for the missing sqlite3 file.

koshrf avatar Jan 06 '25 21:01 koshrf

Are you running it on a local machine or server? Is it a clean install or overwrite? What OS are you running it on? I will try to replicate the issue, glad that you found a work around.

Gsync avatar Jan 06 '25 23:01 Gsync

Are you running it on a local machine or server? Is it a clean install or overwrite? What OS are you running it on? I will try to replicate the issue, glad that you found a work around.

I did run it on my local machine and in a homelab, both with ubuntu 24.04, I did change the docker-compose a little bit to fit my env. It is a clean installation, first time trying it out.

https://github.com/Gsync/jobsync/issues/10#issuecomment-2450002968 is having the same issue

services:
  app:
    container_name: jobsync_app
    build:
      context: .
      dockerfile: Dockerfile
    image: jobsync_app_image
    user: "0"
    ports:
      - "3001:3000"
    environment:
      NODE_ENV: production
      DATABASE_URL: file:/data/dev.db
      # Change your initial username and password here
      USER_EMAIL: <my-email>
      USER_PASSWORD: <my-password>
      # Refer to readme to generate auth secret
      #AUTH_SECRET: Cft42eLmgapfLoot7ByiCL9ToNfbqZ4xaaMuOJsbm+9u
      AUTH_SECRET: <my-auth-secret>
      #NEXTAUTH_URL: http://localhost:3000
      #AUTH_TRUST_HOST: http://localhost:3000
      NEXTAUTH_URL: https://jobsync.<local-fqdn>
      AUTH_TRUST_HOST: https://jobsync.<local-fqdn> 
    volumes:
      - ./jobsyncdb/data:/data
    networks:
      - compose_default
networks:
  compose_default:
    external: true
Client: Docker Engine - Community
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:40:59 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.3.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Fri Sep 20 11:40:59 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.24
  GitCommit:        88bf19b2105c8b17560993bee28a01ddc2f97182
 runc:
  Version:          1.2.2
  GitCommit:        v1.2.2-0-g7cb3632
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble

koshrf avatar Jan 07 '25 13:01 koshrf

Seems like it is related to permissions when running in homelab, Thanks for raising this, I will work on the resolve soon.

Gsync avatar Jan 07 '25 20:01 Gsync

Hi. This seems like a great tool. Wondering if there was any update on the permissions issue when running in a homelab?

muhdusama avatar Mar 24 '25 09:03 muhdusama

Should be able to run on server, permission issue is fixed, closing this issue

Gsync avatar Dec 11 '25 22:12 Gsync