linuxserver / docker-grocy

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

[BUG] Fresh install - Unable to run Grocy: config.php in data directory (/app/www/public/../data) not found. #80

Closed dewoodruff closed 11 months ago

dewoodruff commented 11 months ago

Is there an existing issue for this?

Current Behavior

I am attempting a fresh, first time install with:

docker run -d \
  --name=grocy \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/New_York \
  -p 9283:80 \
  -v /container-data/grocy:/config \
  lscr.io/linuxserver/grocy:latest

And when I visit :9283, I get this error:

Unable to run Grocy: config.php in data directory (/app/www/public/../data) not found. Have you copied config-dist.php to the data directory and renamed it to config.php?

It appears there is an invalid relative path specified somewhere:

# docker exec -it grocy /bin/bash
root@64688d8158d8:/# ls -la /app/www/public/../data
total 50
drwxrwxr-x 1 root root  6 Dec 12 21:38 .
drwxr-xr-x 1 root root  3 Dec 10 02:44 ..
lrwxrwxrwx 1 root root 12 Dec 12 21:38 data -> /config/data
drwxrwxr-x 1 root root  4 Dec 12 21:38 plugins
root@64688d8158d8:/# ls -la /app/www/public/../data/data
lrwxrwxrwx 1 root root 12 Dec 12 21:38 /app/www/public/../data/data -> /config/data

Expected Behavior

According to the readme a fresh install should run without any customizations/modifications. I don't see anything in the readme or issues to resolve this.

Steps To Reproduce

Run the docker run command specified above and try to visit the :9283

Environment

- OS: Debian GNU/Linux 11 (bullseye)

- How docker service was installed: The official instructions for installing from the docker apt repo here were followed: https://docs.docker.com/engine/install/debian/#install-using-the-repository

CPU architecture

arm64

Docker creation

docker run -d \
  --name=grocy \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/New_York \
  -p 9283:80 \
  -v /container-data/grocy:/config \
  lscr.io/linuxserver/grocy:latest

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: executing...
[migrations] 01-nginx-site-confs-default: succeeded
[migrations] 02-default-location: executing...
[migrations] 02-default-location: succeeded
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

Setting resolver to  172.16.20.254
Setting worker_processes to 4
generating self-signed keys in /config/keys, you can replace these with your own keys if required
.+..+...+......+.+........+.+........+.+..+.........+.+.........+.....+.........+....+..+.+++++++++++++++++++++++++++++++++++++++*.....+++++++++++++++++++++++++++++++++++++++*.+............+.............+..+...+....+..+.............+......+......+..............+.+...+.....+......++++++
..........+...+................+......+++++++++++++++++++++++++++++++++++++++*......+........+......+.+...+..+++++++++++++++++++++++++++++++++++++++*.+..+...+...+............+.........+......+...+......+.............+...........+.+......+..+.+......+........+.++++++
-----
mv: cannot remove '/app/www/data/plugins': Invalid argument
[custom-init] No custom files found, skipping...
[ls.io-init] done.
github-actions[bot] commented 11 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 11 months ago

Zfs?

dewoodruff commented 11 months ago

Yes, ZFS backed but overlayfs docker storage driver.

j0nnymoe commented 11 months ago

I believe you need to be using the zfs storage driver if you plan to use zfs for your /config mounts.

thespad commented 11 months ago

You need to use the ZFS storage driver if your docker directory (typically /var/lib/docker) is on zfs storage as that's where it keeps all of the image layers and running container filesystems.

If you're using bind mounts and it's only your bind mounts that are on ZFS then you shouldn't need the ZFS storage driver.

dewoodruff commented 11 months ago

Got it, thank you. I have 9 other containers running on this system with docker directory and bind mounts both on zfs without issue so I'm not sure what's different here. I'll see what I can do.

aptalca commented 11 months ago

Got it, thank you. I have 9 other containers running on this system with docker directory and bind mounts both on zfs without issue so I'm not sure what's different here.

What's different is this container needs to do a move operation within the container file system and it fails due to a bug if the disk filesystem (where the container layers are stored) is zfs and the docker driver is overlay2