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

BUG: Docker Container Crash and UnhandledPromiseRejectionWarning Error #51

Closed
tucker19 opened this issue Jul 14, 2021 · 8 comments
Closed

Comments

@tucker19
Copy link

Been running this a few days within my Docker stack with 17 other containers. After starting up my container I see this in my logs

> uptime-kuma@1.0.4 start-server /app
> node server/server.js

Copy Database

Connect to Database

JWT secret is not found, generate one.

(node:18) UnhandledPromiseRejectionWarning: Error: SELECT COUNT(*) FROM `user`  limit 1 - SQLITE_CORRUPT: database disk image is malformed

(Use `node --trace-warnings ...` to show where the warning was created)

(node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Where is the DB stored for this container as it is not in the config directory I specified either.

@tucker19
Copy link
Author

This is running on Ubuntu and Docker 2.4

@louislam
Copy link
Owner

louislam commented Jul 15, 2021

It looks like your sqlite db is corrupted. You may try to repair it.
The db is located at "/app/data/kuma.db". It should be binding to your volume.

@tucker19
Copy link
Author

tucker19 commented Jul 15, 2021

Thank you for getting back with me. I have tried doing a exec into the container and I am seeing a error

$docker exec -it uptime-kuma /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

I try this same command on other containers and it works fine. I cannot find this directory you have stated to either delete the db or repair it.

@rezzorix
Copy link
Contributor

rezzorix commented Jul 15, 2021

@tucker19 you got the docker exec error because you need to go into /bin/sh instead of /bin/bash

docker exec -it uptime-kuma /bin/sh

Edit:
I also suggest mounting the kuma.db somewhere outside the container; so you could start the container like this for example:

docker run -d --name uptime-kuma --restart=always -p 3001:3001 -v /home/user/uptime/data:/app/data louislam/uptime-kuma:latest

@tucker19
Copy link
Author

@rezzorix Thank you for that info. Never really used /bin/sh, I have only ever used /bin/bash. I am actually using Docker-Compose file for this and I do have a Volume in there but this container never puts anything in there

uptime-kuma:
    image: louislam/uptime-kuma
    container_name: uptime-kuma
    environment:
      PUID: $PUID
      PGID: $PGID
      TZ: $TZ
    ports:
      - 3001:3001
    volumes:
      - $DOCKER_PATH/uptime-kuma/config:/config
    restart: unless-stopped

Do I need to change this to something different?

@rezzorix
Copy link
Contributor

I do have a Volume in there but this container never puts anything in there

- $DOCKER_PATH/uptime-kuma/config:/config

Well the data folder of uptime-kuma is /app/data

So you need to change to this:

uptime-kuma:
    image: louislam/uptime-kuma
    container_name: uptime-kuma
    environment:
      PUID: $PUID
      PGID: $PGID
      TZ: $TZ
    ports:
      - 3001:3001
    volumes:
      - $DOCKER_PATH/uptime-kuma/config:/app/data
    restart: unless-stopped

Anyway, make sure that the path $DOCKER_PATH/uptime-kuma/config exists and the read/write permissions are set

@louislam
Copy link
Owner

Sadly, you mapped to a wrong path, the db should be lost.

@tucker19
Copy link
Author

Thanks for all the help. Looks like I have been able to get everything fixed now.

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

3 participants