linuxserver / docker-grocy

A container for grocy - the ERP application for your kitchen https://grocy.info
GNU General Public License v3.0
340 stars 43 forks source link

Migrations scripts logs errors but migration is successfully #58

Closed edenhaus closed 1 year ago

edenhaus commented 1 year ago

linuxserver.io


Expected Behavior

I expect that the migrations completes without an error being logged.

Current Behavior

The migration is successful but there are still error messages in the logs. My first reaction was to check manually, that the migration was completed successfully.

Steps to Reproduce

  1. Setup grocy with version v3.3.1-ls166 and older
  2. Upgrade to version v3.3.1-ls167
  3. During the migration the errors are logged (see docker log below)

Environment

OS: Ubuntu Server 20.04.5 LTS CPU architecture: x86_64 How docker service was installed: from the distro repo

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

---
version: "3.6"

networks:
  traefik-with-internet:
    external: true

services:
  grocy:
    image: ghcr.io/linuxserver/grocy
    restart: unless-stopped
    networks:
      traefik-with-internet:
    environment:
      PUID: 1000
      PGID: 1000
      TZ: Europe/Rome
    labels:
      traefik.enable: "true"
      traefik.docker.network: traefik-with-internet
      traefik.http.routers.grocy.entrypoints: internal,cloudflare
      traefik.http.routers.grocy.rule: Host(`[REMOVED]`)
      traefik.http.services.grocy.loadbalancer.server.port: 80
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /usr/share/zoneinfo/Europe/Rome:/usr/share/zoneinfo/Europe/Rome:ro

      - ./config:/config

Docker logs

I pasted here only the relevant logs:

grocy_1  | cont-init: info: running /etc/cont-init.d/01-migrations
grocy_1  | [migrations] started
grocy_1  | [migrations] 01-nginx-site-confs-default: executing...
grocy_1  | /etc/cont-init.d/01-migrations: line 22: [[: found /config/nginx/site-confs/default
grocy_1  | moving to /config/nginx/site-confs/default.conf
grocy_1  | 0: division by 0 (error token is "config/nginx/site-confs/default
grocy_1  | moving to /config/nginx/site-confs/default.conf
grocy_1  | 0")
grocy_1  | [migrations] 01-nginx-site-confs-default: succeeded
grocy_1  | [migrations] 02-default-location: executing...
grocy_1  | /etc/cont-init.d/01-migrations: line 22: [[: updating root in /config/nginx/site-confs/default.conf
grocy_1  | 0: syntax error in expression (error token is "root in /config/nginx/site-confs/default.conf
grocy_1  | 0")
grocy_1  | [migrations] 02-default-location: succeeded
grocy_1  | [migrations] done
grocy_1  | cont-init: info: /etc/cont-init.d/01-migrations exited 0
github-actions[bot] commented 1 year ago

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

nemchik commented 1 year ago

I see this happening in the logs reporting issues on a few other nginx based containers. The issue could actually be all the way in the lowest base image (alpine). I'll look into it.

nemchik commented 1 year ago

v3.3.1-ls170 should include a fix from https://github.com/linuxserver/docker-baseimage-alpine/pull/154

The migration should work correctly and logs shouldn't show errors now.