Help with labels for duplicate containers in the same stack

Hi all.

Hoping someone can give me a bit of a hand here. I'm running traefik in docker and I've two instances of sftpgo that I'd like to run. One for local storage, and one for exposed storage. I've wracked through the setup that I have here, but can't figure out what I've got wrong. My instance of sftpgo is reachable, however my instance of stpgotwo is not reachable with an error 404. Traefik and traefik UI logs don't show any errors for these, and they are reachable when the ports are exposed on my machine.

I'm really not sure what to do so any help is much appreciated.

containers are communicating also, just as a heads up.

Here are my docker compose layouts.

sftpgo:
container_name: sftpgo
restart: always
user: ####:####
volumes:
- type: bind
source: ####
target: /srv/sftpgo
- type: bind
source: ####
target: /var/lib/sftpgo
environment:
- SFTPGO_WEBDAVD__BINDINGS__0__PORT=81
image: 'drakkan/sftpgo:latest'
networks:
- traefik
labels:
- traefik.enable=true
- traefik.docker.network=network_traefik
- traefik.http.routers.sftpgo.entrypoints=web
- traefik.http.routers.sftpgo.service=sftpgo
- traefik.http.services.sftpgo.loadbalancer.server.port=8080
- traefik.http.routers.sftpgo.rule=Host("sftpgo.####")
- traefik.http.routers.sftpgo-secure.entrypoints=websecure
- traefik.http.routers.sftpgo-secure.rule=Host("sftpgo.####")
- traefik.http.routers.sftpgo-secure.tls=true
- traefik.http.routers.sftpgo-secure.service=sftpgo-secure
- traefik.http.services.sftpgo-secure.loadbalancer.server.port=8080
- traefik.http.routers.sftpgo-secure.middlewares=middlewares-authentik@file
- traefik.http.routers.webdav_sftpgo.entrypoints=webexternal, web
- traefik.http.routers.webdav_sftpgo.rule=Host("webdav.####")
- traefik.http.services.webdav_sftpgo.loadbalancer.server.port=8080
- traefik.http.routers.webdav_sftpgo.service=webdav_sftpgo
- traefik.http.routers.webdav_sftpgo-secure.entrypoints=websecureexternal, websecure
- traefik.http.routers.webdav_sftpgo-secure.rule=Host(webdav.####)
- traefik.http.routers.webdav_sftpgo-secure.tls=true
- traefik.http.routers.webdav_sftpgo-secure.service=webdav_sftpgo-secure
- traefik.http.services.webdav_sftpgo-secure.loadbalancer.server.port=81

sftpgotwo:
container_name: sftpgotwo
restart: always
user: ####:####
ports:
- 2828:8080
volumes:
- type: bind
source: ####
target: /srv/sftpgo
- type: bind
source: ####
target: /var/lib/sftpgo
environment:
- SFTPGO_WEBDAVD__BINDINGS__0__PORT=81
image: 'drakkan/sftpgo:latest'
networks:
- traefik
labels:
- traefik.enable=true
- traefik.docker.network=network_traefik
- traefik.http.routers.sftpgotwo.entrypoints=web
- traefik.http.routers.sftpgotwo.service=sftpgotwo
- traefik.http.services.sftpgotwo.loadbalancer.server.port=8080
- traefik.http.routers.sftpgotwo.rule=Host("sftpgotwo.####")
- traefik.http.routers.sftpgotwo-secure.entrypoints=websecure
- traefik.http.routers.sftpgotwo-secure.rule=Host("sftpgotwo.####")
- traefik.http.routers.sftpgotwo-secure.tls=true
- traefik.http.routers.sftpgotwo-secure.service=sftpgotwo-secure
- traefik.http.services.sftpgotwo-secure.loadbalancer.server.port=8080
- traefik.http.routers.webdavtwo_sftpgo.entrypoints=web
- traefik.http.routers.webdavtwo_sftpgo.rule=Host("webdavtwo.####")
- traefik.http.services.webdavtwo_sftpgo.loadbalancer.server.port=8080
- traefik.http.routers.webdavtwo_sftpgo.service=webdavtwo_sftpgo
- traefik.http.routers.webdavtwo_sftpgo-secure.entrypoints=websecure
- traefik.http.routers.webdavtwo_sftpgo-secure.rule=Host("webdavtwo.####")
- traefik.http.routers.webdavtwo_sftpgo-secure.tls=true
- traefik.http.routers.webdavtwo_sftpgo-secure.service=webdavtwo_sftpgo-secure
- traefik.http.services.webdavtwo_sftpgo-secure.loadbalancer.server.port=81

I found my solution by complete chance.

The issue arose from within sftpgo, the root directory contains two folders, data and sftpgohome. I had inadverntently put sftpgohome into my users directory within the data folder. Changing this fixed my issue.

I did not see any error logs in sftpgo to indicate there was a problem with the layout though, so will report to their github.

actually; scratch that, still no real joy. There must be some kind of local issue that I'm just not seeing, I'll keep at it.

Yeah, its strange, I've got the redirects working for the UI for both instances, but only one of the webdav instances is working... if anyone has any suggestions that'd be great.

Okay, further update, it seems theres an issue with the entrypoints; for whatever reason webdavtwo doesnt like the web and websecure entrypoints, but webdav is totally fine with them... I have no idea why this is, but going to keep digging.

Okay.

I think I've got it.

Turns out I had a local dns registry in my pihole instance for the webdav.

For whatever reason traefik doesnt like redirecting to the containers webdav on port 81 unless its redirected back to the ip, this is unlike my other services running that do not need this funcationality on the local network. Making a bug report now.

Share your Traefik static and dynamic config.

Use 3 backticks before and after code/config, to make it more readable and preserve spacing, which is important in yaml.

1 Like

Hi bluepuma.

Thanks for passing this on. It was a dns issue in the end, turns out I had a regex set up for redirects in my own dns, had forgotten about it, and it wasnt matching my second webdav.

I am still to learn even basic markdown; I'll make it my next self learning project!

Thanks for following up!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.