Repository navigation
fix(config): explain how to fix a Docker bind-mounted config.toml folder - #1753
Conversation
When config.toml does not exist on the host, `docker compose up` creates an empty folder in its place and mounts it. load_config() then tries to remove that folder, but it is the mount point itself, so Linux answers EBUSY and the container restarts forever with "move or rename it, then restart", which cannot be done from inside the container (harry0703#1751). An EBUSY from rmdir now raises IsADirectoryError that says the folder came from Docker and how to fix it on the host: stop the containers, delete the empty config.toml folder, copy config.example.toml to config.toml, and start again.
b6ca596 to
8a13c79
Compare
|
CI here is waiting for workflow approval, so I ran the same CI workflow on my fork: ruff is clean and the unit tests pass on Python 3.11 and 3.13 (3119 passed, 114 skipped), plus the Windows smoke tests. https://github.com/ChandraChaan/MoneyPrinterTurbo/actions/runs/41391205500 |
|
Merged, thank you! I reproduced the bind-mount error with Docker Compose and checked the host-side recovery steps. Explaining where the folder comes from and how to replace it with a config file should make this much easier to resolve. Existing valid config files also loaded without changing their contents. |
|
Why it does not work for me after this steps:
|
solved: |
Fixes #1751.
When
config.tomldoes not exist on the host,docker compose -f docker-compose.release.yml upcreates an emptyconfig.tomlfolder in its place and mounts it into both containers.load_config()then tries toos.rmdir()that folder, but it is the mount point itself, so Linux answersOSError: [Errno 16] Device or resource busy. The API container exits with:and
restart: alwaysrepeats this forever. "Move or rename it" cannot be done from inside the container, and the message does not say the folder was created by Docker on the host.An
EBUSYfromrmdirnow raisesIsADirectoryErrorthat says the folder exists becauseconfig.tomlwas missing on the host when Docker mounted it, and to stop the containers, delete the emptyconfig.tomlfolder next to the compose file, copyconfig.example.tomltoconfig.toml, and start again (the step the README's Docker section already asks for). OtherOSErrors keep the current message and the existingNotADirectoryErrorrace handling is unchanged.Added
test_busy_docker_bind_mount_stub_explains_the_host_fixnext to the existing Docker stub tests intest/services/test_config_initialization.py; it simulates theEBUSYfromrmdirand checks the folder is left in place.I did not run the containers end to end; the
EBUSYcomes from the traceback in the issue.