tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Odd grpc error

Open nicks opened this issue 1 year ago • 3 comments

From John in tilt slack-

Hey, I'm having trouble with my setup and I'm not sure how to debug it. Basically I'm seeing the error

 Build Failed: failed to dial gRPC: unable to upgrade to h2c, received 404

when running a docker_build, however running tilt docker --built . works fine. I am using minikube in rootless podman so I suspect there is something about that setup which is causing issues. Here is the output of doctor:

 Tilt: v0.33.20, built 2024-09-03
 System: linux-amd64
 ---
 Docker
 - Host: unix:///run/user/1000/podman/podman.sock
 - Server Version: 5.2.2
 - API Version: 1.41
 - Builder: 2
 ---
 Kubernetes
 - Env: minikube
 - Context: minikube
 - Cluster Name: minikube
 - Namespace: default
 - Container Runtime: containerd
 - Version: v1.30.0
 - Cluster Local Registry: none
 - 

Usually i'd expect tilt to detect that podman doesn't support buildkits grpc protocol and fallback to the rest protocol.

Might be related to recent updates to docker client libs

Current workaround is to set DOCKER_BUILDKIT=0 in the env

nicks avatar Sep 06 '24 23:09 nicks

Bumped into the same issue today, thanks for mentioning the workaround 👍

My case is similar, but I am on macos, also using minikube.

tilt doctor's output:

Tilt: v0.33.21, built 
System: darwin-arm64
---
Docker
- Host: unix:///var/run/docker.sock
- Server Version: 5.3.1
- API Version: 1.41
- Builder: 2
- Compose Version: v2.32.1
---
Kubernetes
- Env: minikube
- Context: minikube
- Cluster Name: minikube
- Namespace: default
- Container Runtime: cri-o
- Version: v1.31.0
- Cluster Local Registry: none

johbo avatar Jan 10 '25 13:01 johbo

I think another workaround might be to run minikube with docker as its container runtime. That should be the default, although its docs suggest using --container-runtime=cri-o, and then one ends up unable to use buildkit. With docker as minikube's container runtime, Tilt will build directly using the docker daemon inside minikube - that's faster (no need for push/pull via registry), and also there's buildkit because it's docker.

(Although it's a bit strange that Tilt doesn't detect that it shouldn't use buildkit when talking to podman)

liskin avatar Apr 01 '25 22:04 liskin

Is it possible that this happens only if you have the docker emulation package installed with podman? Just a guess since I happen to have that installed

RustyRaptor avatar Oct 12 '25 11:10 RustyRaptor