Skip to content

Fix mongo url in compose files - #59

Merged
umputun merged 2 commits into
umputun:masterfrom
paskal:fix/compose-mongo-url-typo
Aug 20, 2026
Merged

Fix mongo url in compose files#59
umputun merged 2 commits into
umputun:masterfrom
paskal:fix/compose-mongo-url-typo

Conversation

@paskal

@paskal paskal commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Two independent reasons the shipped compose files cannot start the server, and both are unambiguous.

The collection parameter is misspelled. compose-server.yml:18 and compose-demo.yml:18 spell it collecion. app/cmd/server.go:111 calls mongo.Connect(..., mongoURL, "db", "collection"), which extracts and strips exactly the parameters it is given; the misspelled one stays in the query string, and the driver is handed mongodb://mongo:27017?collecion=logs:

$ dkll server --mongo="mongodb://127.0.0.1:27017?db=dkll&collecion=logs"
[ERROR] server failed, can't make mongo client: can't connect to mongo
mongodb://127.0.0.1:27017?db=dkll&collecion=logs: can't connect to mongo:
error parsing uri: must have a / before the query ?

README.md:70 already documents the parameter as collection. The typo came in with 9759606, which moved MONGO from a bare host to a full url.

The demo points at a host that does not exist. compose-demo.yml:18 addressed mongo, while the service and its hostname are mongo-dkll (lines 60-62), so the name never resolved on the compose network.

One blocker is left after this PR: the mongo service enables root authentication while the server connects anonymously, which I have written up with a reproduction and options in #63, since which way to fix it is your call.

The MONGO url in compose-server.yml and compose-demo.yml spelled the
collection parameter as "collecion". go-pkgz/mongo strips only the
parameters it is asked for, "db" and "collection", so the misspelled one
stayed in the query string and the driver rejected the url with "error
parsing uri: must have a / before the query ?". The server exited before
reaching the syslog listener, so both compose files failed to start as
shipped.
@paskal
paskal force-pushed the fix/compose-mongo-url-typo branch from 57602fb to c4d0512 Compare August 20, 2026 08:00
The MONGO url in compose-demo.yml addressed host "mongo" while the service and its hostname are "mongo-dkll", so the name did not resolve on the compose network.
@paskal paskal changed the title Fix collection parameter typo in compose files Fix mongo url in compose files Aug 20, 2026
@umputun
umputun merged commit 96f41f1 into umputun:master Aug 20, 2026
2 checks passed
@paskal
paskal deleted the fix/compose-mongo-url-typo branch August 20, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants