linuxserver / docker-budge

GNU General Public License v3.0
58 stars 2 forks source link

First run fails - problems with migrations? #11

Closed andy47 closed 2 years ago

andy47 commented 2 years ago

linuxserver.io


Expected Behavior

On first run of the container the application starts and I am able to create an account via the link on the login page of the web application

Current Behavior

When I click on the 'Create Account' link in the web application I get an error message. Reviewing the logs from docker I see this entry;

budge  | QueryFailedError: SQLITE_ERROR: no such table: users
budge  |     at QueryFailedError.TypeORMError [as constructor] (/app/budge/backend/node_modules/typeorm/error/TypeORMError.js:9:28)

Looking further back in the log I see this entry;

budge  | > BudgE@0.0.6 migrate
budge  | > npx --yes ts-node ./node_modules/typeorm/cli.js migration:run
budge  | 
budge  | Error during migration run:
budge  | src/entities/User.ts(12,20): error TS7016: Could not find a declaration file for module 'bcrypt'. '/app/budge/backend/node_modules/bcrypt/bcrypt.js' implicitly has an 'any' type.
budge  |   Try `npm i --save-dev @types/bcrypt` if it exists or add a new declaration (.d.ts) file containing `declare module 'bcrypt';`
budge  | src/entities/User.ts(13,17): error TS7016: Could not find a declaration file for module 'jsonwebtoken'. '/app/budge/backend/node_modules/jsonwebtoken/index.js' implicitly has an 'any' type.
budge  |   Try `npm i --save-dev @types/jsonwebtoken` if it exists or add a new declaration (.d.ts) file containing `declare module 'jsonwebtoken';`
budge  | 

Steps to Reproduce

  1. Create docker-compose.yml based on instructions on this site. Mine looks like this;
version: "2.1"
services:
  budge:
    image: lscr.io/linuxserver/budge
    container_name: budge
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Sydney
    volumes:
      - /Users/andy47/Work/docker/budge/config:/config
    ports:
      - 8007:80
      - 8447:443
    restart: unless-stopped
  1. Start the container with docker-compose up -d
  2. Go to http://localhost:8007 and click on the 'Create Account' button

Environment

OS: Mac OS 12.3 CPU architecture: x86_64/arm32/arm64 - arm64 How docker service was installed:

Running Docker Desktop for Mac (Apple Silicon)

Command used to create docker container (run/create/compose/screenshot)

Docker logs

docker_log_budge.log

github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

MadFrog1205 commented 2 years ago

I have the same issue

fudnet commented 2 years ago

Same issue here as well

luclu commented 2 years ago

I'm also affected by this issue.

Log messages ``` [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 01-envfile: executing... [cont-init.d] 01-envfile: exited 0. [cont-init.d] 02-tamper-check: executing... [cont-init.d] 02-tamper-check: exited 0. [cont-init.d] 10-adduser: executing... ------------------------------------- _ () | | ___ _ __ | | / __| | | / \ | | \__ \ | | | () | |_| |___/ |_| \__/ Brought to you by linuxserver.io ------------------------------------- To support LSIO projects visit: https://www.linuxserver.io/donate/ ------------------------------------- GID/UID ------------------------------------- User uid: 1000 User gid: 1000 ------------------------------------- [cont-init.d] 10-adduser: exited 0. [cont-init.d] 20-config: executing... [cont-init.d] 20-config: exited 0. [cont-init.d] 30-keygen: executing... generating self-signed keys in /config/keys, you can replace these with your own keys if required Generating a RSA private key .......................................................................+++++ .................+++++ writing new private key to '/config/keys/cert.key' ----- [cont-init.d] 30-keygen: exited 0. [cont-init.d] 40-config: executing... New container detected. Setting up app folder and fixing permissions. > BudgE@0.0.6 migrate > npx --yes ts-node ./node_modules/typeorm/cli.js migration:run Error during migration run: src/entities/User.ts(12,20): error TS7016: Could not find a declaration file for module 'bcrypt'. '/app/budge/backend/node_modules/bcrypt/bcrypt.js' implicitly has an 'any' type. Try `npm i --save-dev @types/bcrypt` if it exists or add a new declaration (.d.ts) file containing `declare module 'bcrypt';` src/entities/User.ts(13,17): error TS7016: Could not find a declaration file for module 'jsonwebtoken'. '/app/budge/backend/node_modules/jsonwebtoken/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jsonwebtoken` if it exists or add a new declaration (.d.ts) file containing `declare module 'jsonwebtoken';` 2022-04-22T23:58:44.601194907+02:00 [cont-init.d] 40-config: exited 0. [cont-init.d] 90-custom-folders: executing... [cont-init.d] 90-custom-folders: exited 0. [cont-init.d] 99-custom-files: executing... [custom-init] no custom files found exiting... [cont-init.d] 99-custom-files: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] { errno: -13, code: 'EACCES', syscall: 'scandir', path: '/root/.npm/_logs' } > BudgE@0.0.6 start > node build/src/server.js !!!WARNING!!! Running in development mode! Server listening on: http://0.0.0.0:5000 ```
Helm Release YAML ``` --- apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: name: budge namespace: collab spec: interval: 5m chart: spec: chart: /charts/kah-common/ sourceRef: kind: GitRepository name: flux-system namespace: flux-system interval: 5m values: image: repository: lscr.io/linuxserver/budge tag: 0.0.6 nameOverride: budge env: TZ: ${SECRET_TIMEZONE} PUID: 1000 PGID: 1000 service: main: ports: http: port: 80 ingress: main: enabled: true ingressClassName: "traefik" annotations: traefik.ingress.kubernetes.io/router.entrypoints: "websecure" traefik.ingress.kubernetes.io/router.middlewares: "networking-external-auth@kubernetescrd" hosts: - host: "budge.${SECRET_DOMAIN}" paths: - path: / pathType: Prefix tls: - hosts: - "*.${SECRET_DOMAIN}" persistence: config: enabled: true existingClaim: budge-config mountPath: /config ```
andy47 commented 2 years ago

I pulled the latest image today and this problem is no longer occurring for me.