compose.yml decoding failed "too many colons" with dynamic volumes #900

Open
opened 2026-07-31 16:55:59 +00:00 by fauno · 1 comment
Owner

while working on monitoring-ng i get parsing errors from abra that i understand should work? my guess is that the parser doesn't solve the env var first and just counts the amount of colons on the raw string.

this works:

    volumes:
      - "${CONTAINERD_SOCKET:-/run/containerd/containerd.sock}:/run/containerd/containerd.sock"

this doesn't because of the read only suffix:

    volumes:
      - "${CONTAINERD_SOCKET:-/run/containerd/containerd.sock}:/run/containerd/containerd.sock:ro"

and this produces and "invalid spec: :/run/containerd/containerd.sock:ro: empty section between colons" extra error, which makes me think the env var is replaced for an empty string at some point after the "too many colons" validation, though it was set on the .env file.

    volumes:
      - "${CONTAINERD_SOCKET}:/run/containerd/containerd.sock:ro"

the expected result is that i can provide a configurable location for a socket that's read only on the container :B

[while working on monitoring-ng](https://git.coopcloud.tech/coop-cloud/monitoring-ng/pulls/21#issuecomment-37509) i get parsing errors from abra that i understand should work? my guess is that the parser doesn't solve the env var first and just counts the amount of colons on the raw string. this works: ```yaml volumes: - "${CONTAINERD_SOCKET:-/run/containerd/containerd.sock}:/run/containerd/containerd.sock" ``` this doesn't because of the read only suffix: ```yaml volumes: - "${CONTAINERD_SOCKET:-/run/containerd/containerd.sock}:/run/containerd/containerd.sock:ro" ``` and this produces and "invalid spec: :/run/containerd/containerd.sock:ro: empty section between colons" extra error, which makes me think the env var is replaced for an empty string at some point after the "too many colons" validation, though it was set on the `.env` file. ```yaml volumes: - "${CONTAINERD_SOCKET}:/run/containerd/containerd.sock:ro" ``` the expected result is that i can provide a configurable location for a socket that's read only on the container :B
decentral1se added the bug label 2026-07-31 18:55:35 +00:00
Member

The old and the new parsers mark the syntax as invalid. Researching the docker docs, the parsing syntax would be passing by using the type bind:

- type: bind
  source: "${CONTAINERD_SOCKET:-/run/containerd/containerd.sock}"
  target: /run/containerd/containerd.sock:ro

This works with the old and new parser.
@fauno if the solution works for you feel free to close the issue :)

The old and the new parsers mark the syntax as invalid. Researching the docker [docs](https://docs.docker.com/reference/compose-file/services/#volumes), the parsing syntax would be passing by using the type bind: ``` - type: bind source: "${CONTAINERD_SOCKET:-/run/containerd/containerd.sock}" target: /run/containerd/containerd.sock:ro ``` This works with the old and new parser. @fauno if the solution works for you feel free to close the issue :)
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#900