matrix Config.toml is created as an empty directory - docker compose #134

Closed
opened 2026-10-04 23:01:43 +02:00 by adam · 8 comments
Owner

Using docker compose the Config.toml file for the matrix container is created and mapped as an empty directory. Causing the matrix-bridge container to continuously restart.

Error log:

matrix-bridge-1  | Error: Is a directory (os error 21)
matrix-bridge-1 exited with code 1 (restarting) 

Docker config snippet:

x-matrix-bridge-base: &matrix-bridge-base
  image: ghcr.io/l5yth/potato-mesh-matrix-bridge-${POTATOMESH_IMAGE_ARCH:-linux-amd64}:${POTATOMESH_IMAGE_TAG:-latest}
  volumes:
    - potatomesh_matrix_bridge_state:/app
    - ./matrix/Config.toml:/app/Config.toml:ro
  restart: unless-stopped
  deploy:
    resources:
      limits:
        memory: 128M
        cpus: '0.1'
      reservations:
        memory: 64M
        cpus: '0.05'

ls of matrix directory:

ls -la matrix/
total 12
drwxr-xr-x 3 root root 4096 Jan 18 13:12 .
drwxr-xr-x 3 root root 4096 Jan 18 13:29 ..
drwxr-xr-x 2 root root 4096 Jan 18 13:12 Config.toml

ls of Config.toml:

ls -la matrix/Config.toml/
total 8
drwxr-xr-x 2 root root 4096 Jan 18 13:12 .
drwxr-xr-x 3 root root 4096 Jan 18 13:12 ..
Using docker compose the Config.toml file for the matrix container is created and mapped as an empty directory. Causing the matrix-bridge container to continuously restart. Error log: ``` matrix-bridge-1 | Error: Is a directory (os error 21) matrix-bridge-1 exited with code 1 (restarting) ```` Docker config snippet: ``` x-matrix-bridge-base: &matrix-bridge-base image: ghcr.io/l5yth/potato-mesh-matrix-bridge-${POTATOMESH_IMAGE_ARCH:-linux-amd64}:${POTATOMESH_IMAGE_TAG:-latest} volumes: - potatomesh_matrix_bridge_state:/app - ./matrix/Config.toml:/app/Config.toml:ro restart: unless-stopped deploy: resources: limits: memory: 128M cpus: '0.1' reservations: memory: 64M cpus: '0.05' ``` ls of matrix directory: ``` ls -la matrix/ total 12 drwxr-xr-x 3 root root 4096 Jan 18 13:12 . drwxr-xr-x 3 root root 4096 Jan 18 13:29 .. drwxr-xr-x 2 root root 4096 Jan 18 13:12 Config.toml ``` ls of Config.toml: ``` ls -la matrix/Config.toml/ total 8 drwxr-xr-x 2 root root 4096 Jan 18 13:12 . drwxr-xr-x 3 root root 4096 Jan 18 13:12 .. ``` <!-- github-sync-id:3827219408 -->
adam closed this issue 2026-10-04 23:01:43 +02:00
Author
Owner

Can you tell me which version you are running? latest?

Can you tell me which version you are running? `latest`? <!-- github-comment-id:3767543223 -->
Author
Owner

That's just what docker does by default for binds. It can't tell if you want to mount a file unless the source already exists as a file.

And AFAIK there is no way to mount as a file unless it already exists.

That's just what docker does by default for binds. It can't tell if you want to mount a file unless the source already exists as a file. And AFAIK there is no way to mount as a file unless it already exists. <!-- github-comment-id:3768443484 -->
Author
Owner

Can you tell me which version you are running? latest?

Yep. latest 0.5.9

I assumed the .env + the docker container(s) would build the Config.toml I guess. Any help would be appreciated.

> Can you tell me which version you are running? `latest`? Yep. `latest` 0.5.9 I assumed the .env + the docker container(s) would build the Config.toml I guess. Any help would be appreciated. <!-- github-comment-id:3769452924 -->
Author
Owner

The easiest workaround ror a user is (after removing Config.toml directory) to create an empty file at that path.
From the project side I'd recommend not using file mounts, but mounting config directory in which config would be created later.

The easiest workaround ror a user is (after removing Config.toml directory) to create an empty file at that path. From the project side I'd recommend not using file mounts, but mounting config directory in which config would be created later. <!-- github-comment-id:3774360772 -->
Author
Owner

Alright, I'll give it a try. I did try an empty file and I believe I got a different error but I'll post back with updates.
I'm using the docker-compose file from this repo. https://github.com/l5yth/potato-mesh/blob/main/docker-compose.yml

Alright, I'll give it a try. I did try an empty file and I believe I got a different error but I'll post back with updates. I'm using the docker-compose file from this repo. https://github.com/l5yth/potato-mesh/blob/main/docker-compose.yml <!-- github-comment-id:3774451787 -->
Author
Owner

Ah, I forgot that Config.toml is mounted read-only.
So looks like you need to populate it before starting the containers.

Ah, I forgot that Config.toml is mounted read-only. So looks like you need to populate it before starting the containers. <!-- github-comment-id:3776548735 -->
Author
Owner

I thought that might be the issue. It looked like docker was creating the directory Config.toml when the container started, if the file didn't exist. So I grabbed the latest release and tried again since I was only using the docker-compose.yml file and a .env before. I copied only my .env file into the new copy and used the default Config.toml.

This is the error i received:

matrix-bridge-1  | 2026-01-21T15:10:30.058169Z ERROR potatomesh_matrix_bridge: Error handling message 505928: Matrix join failed for @potato_04c5759c:dod.ngo in !sXabOBXbVObAlZQEUs:c-base.org with status 401 Unauthorized ({"errcode":"M_UNKNOWN_TOKEN","error":"Invalid access token passed.","soft_logout":false})

Essentially, I created the original issue. The real issue is the need to configure the Config.toml. Let me know if you'd like me to open a new issue to cover this. Otherwise, an update to the matrix README with some configuration guidance might be all that's necessary here.

I thought that might be the issue. It looked like docker was creating the directory Config.toml when the container started, if the file didn't exist. So I grabbed the latest release and tried again since I was only using the docker-compose.yml file and a .env before. I copied only my .env file into the new copy and used the default Config.toml. This is the error i received: ``` matrix-bridge-1 | 2026-01-21T15:10:30.058169Z ERROR potatomesh_matrix_bridge: Error handling message 505928: Matrix join failed for @potato_04c5759c:dod.ngo in !sXabOBXbVObAlZQEUs:c-base.org with status 401 Unauthorized ({"errcode":"M_UNKNOWN_TOKEN","error":"Invalid access token passed.","soft_logout":false}) ``` Essentially, I created the original issue. The real issue is the need to configure the Config.toml. Let me know if you'd like me to open a new issue to cover this. Otherwise, an update to the matrix README with some configuration guidance might be all that's necessary here. <!-- github-comment-id:3778730694 -->
Author
Owner

müsste etwa so aussehen:

    volumes:
      - type: bind
        source: ./matrix/Config.toml
        target: /app/Config.toml:ro
        bind:
          create_host_path: false

dann startet er nicht, wenn das configfile nicht da ist.

müsste etwa so aussehen: ``` volumes: - type: bind source: ./matrix/Config.toml target: /app/Config.toml:ro bind: create_host_path: false ``` dann startet er nicht, wenn das configfile nicht da ist. <!-- github-comment-id:3901732653 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/potato-mesh#134