Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When the Docker Compose File gets into a bad state #601

Open
chull434 opened this issue Nov 27, 2022 · 1 comment
Open

[BUG] When the Docker Compose File gets into a bad state #601

chull434 opened this issue Nov 27, 2022 · 1 comment

Comments

@chull434
Copy link

Description

Have found a bug where its possible to get the docker compose file (/root/.iotedgehubdev/data/data/docker-compose.yml) into a bad state that you can't easily recover from with out taking the action of deleting the docker compose file

"createOptions": {
  "HostConfig": {
    "Binds": [
      "./certs:/https:ro"
    ],
    "PortBindings": {
      "443/tcp": [
        {
          "HostPort": "5001"
        }
      ]
    }
  }
}

sudo iotedgedev simulator start

ERROR: The Compose file '/root/.iotedgehubdev/data/data/docker-compose.yml' is invalid because:
volumes value './certs' does not match any of the regexes: '^[a-zA-Z0-9._-]+$'
ERROR: Error while executing command: docker-compose -f /root/.iotedgehubdev/data/data/docker-compose.yml down. Command '['docker-compose', '-f', '/root/.iotedgehubdev/data/data/docker-compose.yml', 'down']' returned non-zero exit status 1.
ERROR: Error while executing command: iotedgehubdev stop. Command '['iotedgehubdev', 'stop']' returned non-zero exit status 1.

cat /root/.iotedgehubdev/data/data/docker-compose.yml

volumes:
  ./certs:
    name: ./certs
  edgehubdev:
    name: edgehubdev
  edgemoduledev:
    name: edgemoduledev

Possible fixes might be just need to add some more validation to the manifest to protect docker compose file
or maybe just delete the docker compose file (/root/.iotedgehubdev/data/data/docker-compose.yml) if it becomes invalid

Expected behavior

Changes to the deployment manifest should mean the down stream docker compose file is regenerated
Other possible fixes might be just need to add some more validation to the manifest to protect docker compose file
Or even just delete the docker compose file (/root/.iotedgehubdev/data/data/docker-compose.yml) if it becomes invalid

Actual behavior

Changing the deployment manifest after the docker compose file has got into a bad state has no effect and you are stuck, unless you force delete the docker compose file in /root/.iotedgehubdev/data/data/docker-compose.yml

Steps to Reproduce

Change your deployment manifest into something thats going to mean an invalid docker compose file
such as a bind path of ./
run commands such as
sudo iotedgedev simulator start
get ERROR: Error while executing command: docker-compose

Environment

iotedgedev, version 3.3.7
Python 3.7.15
pip 22.3.1 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)
WSL2 Ubuntu 22.04

@chull434 chull434 added bug triage Issues that need to be looked at labels Nov 27, 2022
@konichi3
Copy link
Collaborator

Thanks for reporting on this and glad to see deletion of the compose file worked. We will put this in our backlog.

@konichi3 konichi3 added InBacklog and removed InBacklog triage Issues that need to be looked at labels Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants