tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Failing to restart the container

Open besarthoxhaj opened this issue 3 years ago • 2 comments

I have a very simple app, composed of only two files:

.
├── Tiltfile
└── docker-compose.yml

1 directory, 2 files

After tilt up, I navigate to http://localhost:10350/r/agent/overview and manually trigger two updates. During the first update the container exists. Thus, subsequents updates don't execute properly the command in compose.

Am I doing something wrong or is this a bug?

Screenshot 2023-02-25 at 17 43 13 Screenshot 2023-02-25 at 17 40 52

tilt doctor Output

Tilt: v0.31.2, built 2023-02-10
System: darwin-amd64
---
Docker
- Host: unix:///var/run/docker.sock
- Server Version: 20.10.17
- API Version: 1.41
- Builder: 2
- Compose Version: v2.6.1
---
Kubernetes
- Env:
- Context:
- Cluster Name: Unknown
- Namespace: default
- Container Runtime: unknown
- Version: Error: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
- Cluster Local Registry: none
---
Thanks for seeing the Tilt Doctor!
Please send the info above when filing bug reports. 💗

The info below helps us understand how you're using Tilt so we can improve,
but is not required to ask for help.
---
Analytics Settings
--> (These results reflect your personal opt in/out status and may be overridden by an `analytics_settings` call in your Tiltfile)
- User Mode: opt-in
- Machine: 62c457b42b8358fde9219b4639140a8d
- Repo:

besarthoxhaj avatar Feb 25 '23 17:02 besarthoxhaj

thanks for the report! ya, i can repro this. i think there might be a race condition where the container dies before tilt sees the logs, since this container dies so quickly.

nicks avatar Feb 27 '23 14:02 nicks

I filed a bug upstream about this: https://github.com/docker/compose/issues/10351

i wonder if we should we should update tilt's log streamer to use the docker log api directly, rather than going through docker compose. The docker compose logs command has a lot of behavior that makes sense for humans, but has odd edge cases that make it hard for machines to use.

nicks avatar Mar 06 '23 19:03 nicks