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

func creates new container but doesn't run it, found a solution #2517

Open
paulzhn opened this issue Sep 24, 2024 · 0 comments
Open

func creates new container but doesn't run it, found a solution #2517

paulzhn opened this issue Sep 24, 2024 · 0 comments

Comments

@paulzhn
Copy link

paulzhn commented Sep 24, 2024

To be brief, sudo could solve this problem, and it's highly likely not a func problem. I am writing this to provide a solution.

I'm using func v0.42.1 and when I try to build a function, it always hangs. I can see that a new container has been created, but not starts with docker ps -a:

image

And if I use func build -v, the output is below:

Building function image
Pulling image ghcr.io/knative/builder-jammy-tiny:0.0.240
0.0.240: Pulling from knative/builder-jammy-tiny
Digest: sha256:821791b42f74d8672304c8d27f227d2f9582638b048954a531f66d36465043e0
Status: Image is up to date for ghcr.io/knative/builder-jammy-tiny:0.0.240
CheckReadAccess succeeded for the run image index.docker.io/paketobuildpacks/run-jammy-tiny:latest
Selected run image index.docker.io/paketobuildpacks/run-jammy-tiny:latest
Pulling image index.docker.io/paketobuildpacks/run-jammy-tiny:latest with platform linux/amd64
latest: Pulling from paketobuildpacks/run-jammy-tiny
Digest: sha256:fac4a3749284e198247f4ead26fd8ee2816c4db428ebb44fbfd19e6fef6309dc
Status: Image is up to date for paketobuildpacks/run-jammy-tiny:latest
Creating builder with the following buildpacks:
-> paketo-community/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-community/[email protected]
-> paketo-community/[email protected]
-> paketo-community/[email protected]
-> [email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
Using build cache volume pack-cache-hello_latest-19949441c76b.build
Running the creator on OS linux from image pack.local/builder/6f676f6c747a62787761:latest with:
Container Settings:
  Args: /cnb/lifecycle/creator -daemon -launch-cache /launch-cache -log-level debug -app /workspace -cache-dir /cache -run-image index.docker.io/paketobuildpacks/run-jammy-tiny:latest -gid 0 -uid 0 registry.cn-hangzhou.aliyuncs.com/hello:latest
  System Envs: CNB_PLATFORM_API=0.13
  Image: pack.local/builder/6f676f6c747a62787761:latest
  User: root
  Labels: map[author:pack]
Host Settings:
  Binds: pack-cache-hello_latest-19949441c76b.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-cache-hello_latest-19949441c76b.launch:/launch-cache pack-layers-biysoqvcvd:/layers pack-app-bajmwrqrmb:/workspace
  Network Mode: host

and then it hangs forever.

I downloaded the code, debugged it by line, and found it hung at docker/client/request.go:69

image

I think the problem might be, that if you don't have permission, you cannot send the request to the docker socket. But the container can be created, so I'm not sure if my guess is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant