After adding a stack containing a backslash in a service's command ('-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping') and committing to my git server, Komodo can no longer sync
ERROR: failed to read resources from "/repo-cache/<domain>/<repo>/main/latest/resources.toml"
TRACE:
1: failed to parse resource file contents
2: TOML parse error at line 67, column 25
|
67 | - '-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping'
| ^
invalid escape sequence
expected `b`, `f`, `n`, `r`, `t`, `u`, `U`, `\`, `"`
Komodo isn't escaping the backslash before committing, then gets stuck trying to parse it back in since it's not escaped properly.
If I manually escape it on the git server then the issue goes away on Komodo's side.
Originally created by @Copper9564 on GitHub (Jan 5, 2025).
Original GitHub issue: https://github.com/moghtech/komodo/issues/247
Hello!
After adding a stack containing a backslash in a service's command (`'-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping'`) and committing to my git server, Komodo can no longer sync
```
ERROR: failed to read resources from "/repo-cache/<domain>/<repo>/main/latest/resources.toml"
TRACE:
1: failed to parse resource file contents
2: TOML parse error at line 67, column 25
|
67 | - '-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping'
| ^
invalid escape sequence
expected `b`, `f`, `n`, `r`, `t`, `u`, `U`, `\`, `"`
```
Komodo isn't escaping the backslash before committing, then gets stuck trying to parse it back in since it's not escaped properly.
If I manually escape it on the git server then the issue goes away on Komodo's side.
GiteaMirror
added the bug label 2026-06-15 06:26:13 -05:00
Can you clarify the difference in how you committed this change? Are you saying in the first case, you committed the change through the Komodo UI, while in the second, it was committed through manual editor (like VSCode) + command line commit?
<!-- gh-comment-id:2571825451 -->
@mbecker20 commented on GitHub (Jan 6, 2025):
Can you clarify the difference in how you committed this change? Are you saying in the first case, you committed the change through the Komodo UI, while in the second, it was committed through manual editor (like VSCode) + command line commit?
I'm primarily using the resource sync one-way only from Komodo --> Gitea, but I think most people are defining resources from Git --> Komodo. So here's a clearer example to help replicate:
Set up a resource sync with git (Gitea in my case). Set managed mode to enable commits from KomodoUI.
Add this UI defined stack which contains a backslash via KomodoUI:
Notice the commit action is successful, but now the resource sync status immediately says FAILED. Info tab shows the escape sequence error:
View the committed toml file (either directly on Gitea or with an editor like VSCode), and notice the backslash is unescaped which would prevent the toml from being parsed back into Komodo:
Now if you add the 2nd backslash (directly on Gitea or other editor), then KomodoUI is able to parse after it refreshes from git.
I'm not too familiar with TOML, but was also able to get it working by using the multi-line literal ''' instead of """, but then you lose the ability to actually escape things if needed. I'd guess the right way to address this is to scan for and escape backslashes when writing the TOML file(s) to be committed.
Hope that makes better sense. Thanks for your work on this project, and fantastic job thus far!
<!-- gh-comment-id:2573750752 -->
@Copper9564 commented on GitHub (Jan 6, 2025):
I'm primarily using the resource sync one-way only from Komodo --> Gitea, but I think most people are defining resources from Git --> Komodo. So here's a clearer example to help replicate:
1. Set up a resource sync with git (Gitea in my case). Set managed mode to enable commits from KomodoUI.
2. Add this UI defined stack which contains a backslash via KomodoUI:
``` yaml
services:
dockerproxy:
image: wollomatic/socket-proxy:1
command:
- '-loglevel=info'
- '-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping' # <-- backslash
- '-allowHEAD=/_ping'
- '-watchdoginterval=300'
- '-stoponwatchdog'
- '-shutdowngracetime=10'
restart: unless-stopped
read_only: true
mem_limit: 64M
cap_drop:
- ALL
security_opt:
- no-new-privileges
user: 65534:999
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
```
3. Commit changes to git

4. Notice the commit action is successful, but now the resource sync status immediately says FAILED. Info tab shows the escape sequence error:

5. View the committed toml file (either directly on Gitea or with an editor like VSCode), and notice the backslash is unescaped which would prevent the toml from being parsed back into Komodo:
``` toml
[[stack]]
name = "issue_247"
[stack.config]
server = "myserver"
file_contents = """
services:
dockerproxy:
image: wollomatic/socket-proxy:1
command:
- '-loglevel=info'
- '-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping' # <-- backslash
- '-allowHEAD=/_ping'
- '-watchdoginterval=300'
- '-stoponwatchdog'
- '-shutdowngracetime=10'
restart: unless-stopped
read_only: true
mem_limit: 64M
cap_drop:
- ALL
security_opt:
- no-new-privileges
user: 65534:999
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
"""
```
6. Now if you add the 2nd backslash (directly on Gitea or other editor), then KomodoUI is able to parse after it refreshes from git.

I'm not too familiar with TOML, but was also able to get it working by using the multi-line literal `'''` instead of `"""`, but then you lose the ability to actually escape things if needed. I'd guess the right way to address this is to scan for and escape backslashes when writing the TOML file(s) to be committed.
Hope that makes better sense. Thanks for your work on this project, and fantastic job thus far!
Thanks so much for the detailed description, yes I can reproduce this and it is a tricky bug.
<!-- gh-comment-id:2573937421 -->
@mbecker20 commented on GitHub (Jan 6, 2025):
Thanks so much for the detailed description, yes I can reproduce this and it is a tricky bug.
It also will not remove the escape backslashes syncing back to komodo. Which means we can't use resource sync for anything that requires toml special characters, such as the normal traefik host label (backticks)
Here is an example from my gitea stored toml, with only my domain stripped
Fortunately, I only executed the sync on this one, which is only for troubleshooting
<!-- gh-comment-id:2616973464 -->
@june012006 commented on GitHub (Jan 27, 2025):
It also will not remove the escape backslashes syncing back to komodo. Which means we can't use resource sync for anything that requires toml special characters, such as the normal traefik host label (backticks)
Here is an example from my gitea stored toml, with only my domain stripped
```
[stack.config]
server = "server-s00xe"
file_contents = """
services:
whoami:
image: traefik/whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.rule=Host(/`whoami.mydomain.com/`)"
- "traefik.http.middlewares.whoami-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.whoami.middlewares=whoami-https-redirect"
- "traefik.http.routers.whoami-secure.entrypoints=websecure"
- "traefik.http.routers.whoami-secure.rule=Host(/`whoami.mydomain.com/`)"
- "traefik.http.routers.whoami-secure.tls=true"
- "traefik.http.routers.whoami-secure.service=whoami"
- "traefik.http.services.whoami.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
networks:
- proxy
networks:
proxy:
external: true
"""
```
and the resulting compose file for the stack
```
services:
whoami:
image: traefik/whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.rule=Host(/`whoami.watermelononatoothpick.com/`)"
- "traefik.http.middlewares.whoami-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.whoami.middlewares=whoami-https-redirect"
- "traefik.http.routers.whoami-secure.entrypoints=websecure"
- "traefik.http.routers.whoami-secure.rule=Host(/`whoami.watermelononatoothpick.com/`)"
- "traefik.http.routers.whoami-secure.tls=true"
- "traefik.http.routers.whoami-secure.service=whoami"
- "traefik.http.services.whoami.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
networks:
- proxy
networks:
proxy:
external: true
```
Fortunately, I only executed the sync on this one, which is only for troubleshooting
Ah, sorry 😅 - yes everything works as expected now. Thanks for all your work!
<!-- gh-comment-id:3225261486 -->
@Copper9564 commented on GitHub (Aug 26, 2025):
Ah, sorry 😅 - yes everything works as expected now. Thanks for all your work!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @Copper9564 on GitHub (Jan 5, 2025).
Original GitHub issue: https://github.com/moghtech/komodo/issues/247
Hello!
After adding a stack containing a backslash in a service's command (
'-allowGET=/v1\..{2}/(containers/.*|events|info)|/_ping') and committing to my git server, Komodo can no longer syncKomodo isn't escaping the backslash before committing, then gets stuck trying to parse it back in since it's not escaped properly.
If I manually escape it on the git server then the issue goes away on Komodo's side.
@mbecker20 commented on GitHub (Jan 6, 2025):
Can you clarify the difference in how you committed this change? Are you saying in the first case, you committed the change through the Komodo UI, while in the second, it was committed through manual editor (like VSCode) + command line commit?
@Copper9564 commented on GitHub (Jan 6, 2025):
I'm primarily using the resource sync one-way only from Komodo --> Gitea, but I think most people are defining resources from Git --> Komodo. So here's a clearer example to help replicate:
Set up a resource sync with git (Gitea in my case). Set managed mode to enable commits from KomodoUI.
Add this UI defined stack which contains a backslash via KomodoUI:
Commit changes to git

Notice the commit action is successful, but now the resource sync status immediately says FAILED. Info tab shows the escape sequence error:

View the committed toml file (either directly on Gitea or with an editor like VSCode), and notice the backslash is unescaped which would prevent the toml from being parsed back into Komodo:
I'm not too familiar with TOML, but was also able to get it working by using the multi-line literal
'''instead of""", but then you lose the ability to actually escape things if needed. I'd guess the right way to address this is to scan for and escape backslashes when writing the TOML file(s) to be committed.Hope that makes better sense. Thanks for your work on this project, and fantastic job thus far!
@mbecker20 commented on GitHub (Jan 6, 2025):
Thanks so much for the detailed description, yes I can reproduce this and it is a tricky bug.
@june012006 commented on GitHub (Jan 27, 2025):
It also will not remove the escape backslashes syncing back to komodo. Which means we can't use resource sync for anything that requires toml special characters, such as the normal traefik host label (backticks)
Here is an example from my gitea stored toml, with only my domain stripped
and the resulting compose file for the stack
Fortunately, I only executed the sync on this one, which is only for troubleshooting
@mbecker20 commented on GitHub (Aug 26, 2025):
There were changes here, is this still and issue?
@Copper9564 commented on GitHub (Aug 26, 2025):
Ah, sorry 😅 - yes everything works as expected now. Thanks for all your work!