RAKWireless / portainer-templates

Curated list of services to deploy on a RAK WisGate Developer Gateway using Portainer
MIT License
7 stars 9 forks source link

Error deploying Chirpstack V4 portainer stack - mosquitto.conf can't mount #8

Closed Aweptimum closed 5 months ago

Aweptimum commented 5 months ago

In creating the chirpstack v4 image available in portainer, the process errors out when trying to start the mosquitto container. I've copied a portion of the event log below, but the full one (with really bad formatting, sorry) is here: https://pastebin.com/L9V9xe0E

Starting Container chirpstack-redis
Starting Container chirpstack-postgres
Starting Container chirpstack-certificates
Starting Container chirpstack-postgres
Started Container chirpstack-redis
Started Container chirpstack-certificates
Started Error response from daemon:
    failed to create task for container:
    failed to create shim task: OCI runtime create
    failed: runc create
    failed: unable to start container process:
        error during container init:
        error mounting "/data/compose/4/Stack/ChirpStack4/configuration/mosquitto/mosquitto.conf" to rootfs at "/mosquitto/config/mosquitto.conf":
            mount /data/compose/4/Stack/ChirpStack4/configuration/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf (via /proc/self/fd/6), flags: 0x5000:
                not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)?
                Check if the specified host path exists and is the expected type

I can confirm the config file is on the host at the expected path: image

/data/compose/4/Stack/ChirpStack4/configuration/mosquitto/mosquitto.conf

So for some reason it isn't mounting to the image, and I can't find much helpful info for fixing this error. It's usually caused by accidentally mapping a directory to a file or entering an incorrect host path (docker will just implicitly create a folder), but neither seems to be the case here. Anyone got any ideas?

xoseperez commented 5 months ago

Hi @Aweptimum , that stack mounts a local file to configure the mosquitto service. AFAIK this is not supported by Portainer CE, correct me if I'm wrong. I'd suggest to use rakpios-cli or use docker container directly on the stack folder to bring it up.

Aweptimum commented 5 months ago

Sorry for the long silence (life got busy)

I haven't used portainer before, so your guess is better than mine. Both the cli tool and docker compose worked just fine. I was able to access the chirpstack web interface and ensure everything worked. Probably can close, but it would be nice if Portainer CE's lack of local mounting was confirmed and then added to the Portainer Services Documentation

xoseperez commented 5 months ago

You are right. Will add a notice to the documentation about it. Closing the issue.

Aweptimum commented 5 months ago

Cool, thanks :)

xoseperez commented 5 months ago

Actually, I have already pushed a change to the stack that solves the issue. Since named volumes work just fine with Portainer I bring up an initial service to copy the configurations to one such named volume shared with the rest of services, hence they can access the configuration data.

Check https://github.com/RAKWireless/portainer-templates/commit/34f56871510118967400162bed926fdefbecfd34