linuxserver / docker-grocy

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

[BUG] FPM initialization failed, fastcgi address in use #77

Closed tobinstultiens closed 1 year ago

tobinstultiens commented 1 year ago

Is there an existing issue for this?

Current Behavior

Currently when running this docker file I will receive the following error in the webpage: File not found.

While when I look at the logs I see these errors.

FPM initialization failed
unable to bind listening socket for address '127.0.0.1:9000': Address in use (98)

This is related to a nginx configuration not being set correctly / not being able to change it with the current setup. If I go to config/grocy/nginx/site-confs/default.conf I see the following port set which is causing the issues. image

Expected Behavior

I would expect grocy to launch when going to the webpage.

Steps To Reproduce

  1. Setup the docker file.
  2. Have a program running that is using the 9000 port. (Honestly nothing is running at that port for me but I'm still receiving the error.)
  3. ???
  4. Profit

Environment

- OS: Arch 6.4.12-arch
- How docker service was installed: Pacman

CPU architecture

x86-64

Docker creation

---
- vars:
    service: "grocy"
    labels:
    - key: "com.centurylinklabs.watchtower.enable"
      value: "true"
    - key: "traefik.enable"
      value: "true"
    - key: "traefik.http.routers.{{ service }}.rule"
      value: "Host(`{{ service }}.{{ DOMAIN }}`)"
    - key: "traefik.http.routers.{{ service }}.service"
      value: "{{ service }}"
    - key: "traefik.http.routers.{{ service }}.entrypoints"
      value: "https"
    - key: "traefik.http.routers.{{ service }}.tls"
      value: "true"
    - key: "traefik.http.routers.{{ service }}.tls.certresolver"
      value: "letsencrypt"
    - key: "traefik.http.services.{{ service }}.loadbalancer.server.port"
      value: "80"

  hosts: all
  vars_files: 
    - ../vars/vars.yml
    - ../vars/vault.yml

  tasks:
    - name: Start grocy
      docker_container:
        image: linuxserver/grocy
        name: "{{ service }}"
        env:
          PUID: "1000"
          PGID: "1000"
          TZ: Europe/Amsterdam
        volumes:
          - "{{ docker_config_dir }}/{{ service }}:/config"
        restart_policy: unless-stopped
        network_mode: container:vpn
        labels: "{{ labels | items2dict}}"

Container logs

[03-Nov-2023 20:25:58] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Add
ress in use (98)
[03-Nov-2023 20:25:58] ERROR: FPM initialization failed
[03-Nov-2023 20:25:59] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Add
ress in use (98)
[03-Nov-2023 20:25:59] ERROR: FPM initialization failed
[03-Nov-2023 20:26:00] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Add
ress in use (98)
[03-Nov-2023 20:26:00] ERROR: FPM initialization failed
[03-Nov-2023 20:26:01] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Add
ress in use (98)
[03-Nov-2023 20:26:01] ERROR: FPM initialization failed
[03-Nov-2023 20:26:02] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Add
ress in use (98)
[03-Nov-2023 20:26:02] ERROR: FPM initialization failed
github-actions[bot] commented 1 year ago

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

Roxedus commented 1 year ago

network_mode: container:vpn this is the culprit. We dont support routing containers trough other containers.

aptalca commented 1 year ago

network_mode: container:vpn

You're telling grocy to use another container's network stack. Something else is bound to port 9000 in that network, perhaps yet another container using that one's network stack.

tobinstultiens commented 1 year ago

Ah yes that would resolve it. Maybe a follow up question are there plans or will it ever be possible to manage these values?

Roxedus commented 1 year ago

No, it will complicate the codebase a lot for a very niche type of setup.

aptalca commented 1 year ago

You can route via routing tables https://www.linuxserver.io/blog/routing-docker-host-and-container-traffic-through-wireguard#routing-a-containers-traffic-through-the-wireguard-container-via

tobinstultiens commented 1 year ago

Oh, interesting didn't know that was possible with wireguard thanks.

Thanks for the help.