[Bug]: Adjacent servers in containers: in-container servers fail silently without a per-server .env, run unused under Docker, and the proxy target flips between Docker and Podman
Maintainers usually reply within 1 day
@jl-0 is already working on this.
Since Nov 19, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker, javascript, python
- Domain
- backend, infrastructure, networking
Research direction
Start by reading scripts/server.js, adjacent-servers-proxy.js, the isDocker() helper, and the relevant start-*.sh scripts; inspect how the proxy target and child process behavior are selected. Reproduce with the supplied Docker and Podman commands and compare /titiler/healthz responses. Done means adjacent servers start or fail visibly and the proxy uses an explicit, consistent target across runtimes.
Written by the indexing model from the issue text.
Description
Checked for duplicates
Yes - I've already checked
Describe the bug
With any WITH_*=true (tested with WITH_TITILER=true), the containerized MMGIS image behaves differently under Docker and Podman, and in both cases the in-container adjacent server fails silently.
scripts/server.js always calls adjacentServers(), which spawns start-<server>.sh inside the MMGIS container for each enabled server. adjacent-servers-proxy.js then sends the proxy route to localhost or to a compose service name (titiler, stac-fastapi, tipg, titiler-pgstac) depending on utils.isDocker(). isDocker() only checks for /.dockerenv or "docker" in /proc/self/cgroup.
- The in-container server exits immediately unless
adjacent-servers/<server>/.envexists.start-titiler.shrunspython -m dotenv run …, which fails withInvalid value for '-f' ".../adjacent-servers/titiler/.env" does not exist. The image doesn't contain that file, and a containerized setup (env file /environment:) has no reason to create it. The Adjacent Servers docs say the.envcopy steps are unneeded with Docker. - Nothing is logged when it exits. MMGIS logs
Starting titiler server on port 8883..., forwards only output lines containing "running", and has anerrorhandler but noexit/closehandler on the child. - Under Docker (
isDocker()true), the in-container server is never used. The proxy targetshttp://titiler:8883. If the in-container server does start (with a.env), it runs next to the compose service, using memory and a port while getting no traffic. Withdocker-compose.sample.yml+sample.env(flags default totrue, and the same.envis given to MMGIS), every enabled server is started twice, or would be, without point 1. - Under Podman,
isDocker()is false. Podman creates/run/.containerenv, not/.dockerenv, and its cgroup paths containlibpod, notdocker. The proxy targetslocalhost, so the in-container server is the one used and separate compose-style services are ignored. The TiTiler version served also changes: 0.24.2 in-image vs 1.2.1 in the compose file. IS_DOCKERis also sent to the browser and changes how relative COG paths are passed to TiTiler (/Missions/...vs../../Missions/...; still inconfigure/src/core/Maker.jsondevelopment). So the runtime also decides whether a separate TiTiler container can resolve local files.
Results with the 5.2.24 image (/titiler/healthz returns the TiTiler version, which shows which server answered):
| Runtime | titiler/.env |
Separate titiler service |
In-container server | /titiler/healthz via MMGIS |
|---|---|---|---|---|
| Docker | no | no | exits silently | 504 |
| Docker | no | yes | exits silently | 200 (1.2.1, service) |
| Docker | yes | no | running, unused | 504 |
| Docker | yes | yes | running, unused | 200 (1.2.1, service) |
| Podman | no | no | exits silently | 504 |
| Podman | yes | no | running | 200 (0.24.2, in-container) |
On a RHEL host running the image rootful under systemd with Podman 4.9.4 (cgroup v1), the container has only /run/.containerenv, and its /proc/self/cgroup entries are all /system.slice/<unit>.service/libpod-payload-<id>, so isDocker() is false in production too.
I checked the current development (9a04abc5): adjacent-servers.js, start-*.sh, isDocker() and the proxy target selection are unchanged from 5.2.24.
What did you expect?
Whether MMGIS starts the adjacent servers itself, or proxies to separately run ones, should be an explicit setting, not a guess from the container runtime. A server MMGIS does start should either work without a hand-made .env or fail loudly.
Suggestions:
- An explicit mode, globally or per server, e.g.
ADJACENT_SERVERS_MODE=embedded|external, orTITILER_URL=http://titiler:8883meaning external. Spawn only in embedded mode; proxy tolocalhostin embedded mode and to the configured URL otherwise. This would also replace theIS_DOCKERpath switch in point 5. - At minimum: don't call
adjacentServers()when the proxy won't targetlocalhost, and haveisDocker()also recognize Podman (/run/.containerenv), or rename it to what it actually decides. - Make
start-*.shnot require a.env: only pass it todotenvif it exists, or just runpython -m uvicorn, since the child already inherits MMGIS's environment. - Log the child's exit code and its last stderr lines on
exit.
Reproducible steps
# env for MMGIS: AUTH=off, WITH_TITILER=true, all other WITH_*=false, DB_* pointing at a postgis container on the same network
docker network create adj && docker run -d --name db --network adj -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=mmgis postgis/postgis:17-3.5-alpine
# Docker: isDocker() true, proxy -> titiler:8883 (doesn't exist), in-container server exited
docker run -d --name mmgis --network adj --env-file test.env ghcr.io/nasa-ammos/mmgis:5.2.24-release
docker exec mmgis curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8888/titiler/healthz # 504
docker exec mmgis sh -c 'cd adjacent-servers/titiler && sh start-titiler.sh 8883' # dotenv: .env does not exist
# Podman: same image and env; isDocker() false, proxy -> localhost:8883
podman exec mmgis ls /.dockerenv /run/.containerenv # only /run/.containerenv
# with an empty adjacent-servers/titiler/.env created in the container: /titiler/healthz -> 200, version 0.24.2
Environment
- Version: 5.2.24 (ghcr.io/nasa-ammos/mmgis:5.2.24-release); same code on development @ 9a04abc5
- Docker 29.2.1 (Colima, arm64)
- Podman 4.9.4 (rootful; tested locally, and confirmed on a RHEL host under systemd, cgroup v1)
- Separate TiTiler: ghcr.io/developmentseed/titiler:1.2.1
Related: #753. The internal-hostname leak through the proxy is a separate bug, but it is affected by the same isDocker() target choice.
- Dominant language
- JavaScript
- Stars
- 242
- Forks
- 86
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NASA-AMMOS/MMGIS
-
[Bug]: Draw template number fields reject valid decimals (e.g. 1.2 with step 0.1) due to floating-point step checkPossibly taken @Khan-Tzar claimed this 47 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NASA-AMMOS/MMGIS#1129 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NASA-AMMOS/MMGIS#963 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
NASA-AMMOS/MMGIS#1163 · 1 comment ·
Maintainers usually reply within 1 day
-
[New Feature]: Identifier — click a point to chart time-enabled layers over the time rangePossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 56/100
NASA-AMMOS/MMGIS#1159 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
NASA-AMMOS/MMGIS#1156 ·
Maintainers usually reply within 1 day
All issues in NASA-AMMOS/MMGIS
Similar issues
-
01 type: bug 41 lvl: easy
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
accessibility bug dark-mode dashboards
Difficulty 1/5 Under an hour Newbie friendliness 84/100
quarto-dev/quarto-cli#15447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount duePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day