Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database error -> error creating tables: unable to open database file: out of memory (14) #6

Open
iHarshad opened this issue Oct 16, 2024 · 0 comments

Comments

@iHarshad
Copy link

iHarshad commented Oct 16, 2024

I am running gullak using rootless podman. The container is built successfully as I get an exit code: 0 message. I have made minor changes to the Dockerfile and docker-compose.yml.

Error log

Command: $ podman logs -ft --details backend

2024-10-16T16:45:03.324330000+05:30 time=2024-10-16T11:15:03.324Z level=INFO msg="Successfully initialized OpenAI client" model=gpt-4o
2024-10-16T16:45:03.325637000+05:30 time=2024-10-16T11:15:03.324Z level=ERROR msg="Error initializing database" error="error creating tables: unable to open database file: out of memory (14)"
Dockerfile edits
diff --git a/Dockerfile b/Dockerfile
index 04f33bb..a6887f1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1,13 @@
-FROM golang:1.22.4 AS builder
+FROM docker.io/library/golang:1.22.4 AS builder
WORKDIR /app/build

# Copy the binary
COPY --from=builder /app/build/bin/gullak.bin ./gullak.bin
-COPY config.sample.toml config.toml
+COPY config.toml config.toml
docker-compose.yml edits I need the database to persist, hence adding volumes.
diff --git a/docker-compose.yml b/docker-compose.yml
index 1120208..23a5c75 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,8 +2,11 @@
version: "3.8"
services:
 backend:
+    container_name: backend
   build:
     context: .
     dockerfile: Dockerfile
   ports:
     - 3333:3333
+    volumes:
+      - $DOCKER_DATA_VOL/gullak:/vol
config.toml
[app]
debug = true
currency = "INR"
db_path = "./vol/expenses.db"

[http]
enabled=true
address=":3333"
timeout="30s"

[openai]
base_url = "https://api.openai.com"
token = "xxxxx"
model = "gpt-4o"
timeout = "10s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant