druidfi / stonehenge

Multi-project local development environment & toolset on Docker
MIT License
61 stars 6 forks source link

Removed error redirects from docker commands to make debugging easier #72

Closed tuutti closed 1 year ago

tuutti commented 1 year ago

I recently updated from 3.x to 4.x and encountered a few issues and the error messages were suppressed, making debugging pretty frustrating.

At the moment it might fail to an error code with no additional infromation:

⚡ Start Stonehenge...

make: *** [make/stonehenge.mk:66: start] Error 125

After this change:

Error response from daemon: error while removing network: network stonehenge-network id b3a7f7386b8eccba9453623e8f99c3f550fbd9762d60a92baec4cd1bd5afc5fa has active endpoints
[
    {
        "Name": "stonehenge-network",
        "Id": "b3a7f7386b8eccba9453623e8f99c3f550fbd9762d60a92baec4cd1bd5afc5fa",
        "Created": "2021-11-10T11:02:49.509002723+02:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.64.0/20",
                    "Gateway": "192.168.64.1"
                }
            ]
        },
        ....
⚡ Start Stonehenge...

Error response from daemon: network b3a7f7386b8eccba9453623e8f99c3f550fbd9762d60a92baec4cd1bd5afc5fa not found
Error: failed to start containers: stonehenge
make: *** [make/stonehenge.mk:66: start] Error 1
Warning: No resource found to remove for project "stonehenge".
stonehenge-network
Error response from daemon: remove stonehenge-ssh: volume is in use - [e3078571b8f33d9649ebe7acc0f498eec5f7fff4369b33e3b185f519908425d6]
[
    {
        "CreatedAt": "2022-10-17T09:42:53+03:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/stonehenge-ssh/_data",
        "Name": "stonehenge-ssh",
        "Options": {},
        "Scope": "local"
    }
]

which are really obvious once you see the error message.

back-2-95 commented 1 year ago

Hmm, I changed from docker-compose setup to docker run which was not... let's say DX friendly. Maybe go back to using docker-compose.yml instead of doing these at all.

back-2-95 commented 1 year ago

Does this work for your debugging needs: https://github.com/druidfi/stonehenge/commit/247dccdd6ac21f22e1f3af0312dfb5196ab2d12a

tuutti commented 1 year ago

Probably. I just want to see an error message if something goes wrong. Thanks!