[Bug] Building RegEx fails if container name contains variable #597

Open
opened 2025-10-31 15:16:06 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @Dalewn on GitHub (Sep 23, 2025).

Hi,

creating a stack with variable in the container_name section of the compose file will throw an error as the regex cannot be built.
This error is only visible when looking at the logs. The UI itself will just show the stack state as 'DOWN'.

Error Message (only in the logs):
2025-09-23T14:15:00.697740Z WARN core::helpers::query: failed to construct container name matching regex for service mariadb-official: failed to construct valid regex from ^${NAME?error}-?[0-9]*$: regex parse error: ^${NAME?error}-?[0-9]*$ ^ error: repetition quantifier expects a valid decimal

Where the compose file looks sth like:

services:
  mariadb-official:
    image: docker.io/library/mariadb:11.6.2
    container_name: ${NAME?error}
    volumes:
      - ${APPDATA?error}/mariadb-official/data:/var/lib/mysql
      - ${APPDATA?error}/mariadb-official/config:/etc/mysql/conf.d

and the .env file that goes alongside contains:

# MariaDB
NAME='mariadb'

To note: The stack itself was pre-existing and has not been started/deployed by Komodo as of now. I've seen another issue where this had fixed the problem. Still I would expect an error or info message in the UI.

Originally created by @Dalewn on GitHub (Sep 23, 2025). Hi, creating a stack with variable in the container_name section of the compose file will throw an error as the regex cannot be built. This error is only visible when looking at the logs. The UI itself will just show the stack state as 'DOWN'. Error Message (only in the logs): `2025-09-23T14:15:00.697740Z WARN core::helpers::query: failed to construct container name matching regex for service mariadb-official: failed to construct valid regex from ^${NAME?error}-?[0-9]*$: regex parse error: ^${NAME?error}-?[0-9]*$ ^ error: repetition quantifier expects a valid decimal` Where the compose file looks sth like: ``` services: mariadb-official: image: docker.io/library/mariadb:11.6.2 container_name: ${NAME?error} volumes: - ${APPDATA?error}/mariadb-official/data:/var/lib/mysql - ${APPDATA?error}/mariadb-official/config:/etc/mysql/conf.d ``` and the .env file that goes alongside contains: ``` # MariaDB NAME='mariadb' ``` To note: The stack itself was pre-existing and has not been started/deployed by Komodo as of now. I've seen another issue where this had fixed the problem. Still I would expect an error or info message in the UI.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#597
No description provided.