linuxserver / docker-grocy

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

mkdir and cp fail when using PID 1000 #24

Closed UnlimitedCookies closed 4 years ago

UnlimitedCookies commented 4 years ago

linuxserver.io


Expected Behavior

mkdir and cp do not fail.

Current Behavior

mkdir and cp do fail.

As seen in

cp: cannot create regular file '/config/data/config.php': No such file or directory

After the container initialization finished, the web application shows Unable to run grocy: config.php in data directory (/app/grocy/public/../data) not found. Have you copied config-dist.php to the data directory and renamed it to config.php?

Steps to Reproduce

  1. Clear the /config volume beforehand
  2. Pull the image
  3. docker-compose up -d
  4. see errors

Environment

OS: Alpine Linux v3.11 x86_64 Kernel: 5.4.34-0-virt
CPU architecture: x86_64/arm32/arm64
How docker service was installed: Using apk add docker

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

Docker-compose file:

# grocy
  grocy:
    container_name: grocy
    hostname: grocy
    image: linuxserver/grocy:latest
    ports:
      - "443:443"
    networks:
      networkconfig:
        ipv4_address: 192.168.x.x
    environment:
      TZ: 'Europe/Berlin'
      PUID: 1000
      PGID: 1000
    volumes:
      - './grocy/config/:/config'
    restart: unless-stopped

Docker logs

[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] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

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
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
mkdir: cannot create directory ‘/app/grocy/data’: File exists
cp: cannot create regular file '/config/data/config.php': No such file or directory
[cont-init.d] 50-config: 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.
j0nnymoe commented 4 years ago

Is this still an issue? It seems like a permissions issue on the folder you're using for /config

j0nnymoe commented 4 years ago

No Response, Closing.