Add-package hangs indefinitely

1. The problem I’m having:

Using the caddy add-package command hangs indefinitely. I’ve tried with multiple different packages and they all hang the same way. (One of my tests has been sitting there for >30m, with no additional feedback about what’s going on.)

2. Error messages and/or full log output:

$ docker run --rm caddy:2 caddy add-package github.com/caddy-dns/cloudflare
{"level":"info","ts":1678247248.6178856,"msg":"this executable will be replaced","path":"/usr/bin/caddy"}
{"level":"info","ts":1678247248.618044,"msg":"requesting build","os":"linux","arch":"amd64","packages":["github.com/caddy-dns/cloudflare"]}

There is no further output, no errors, no indication that anything at all is happening.

3. Caddy version:

$ docker run --rm caddy:2 caddy version
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=

4. How I installed and ran Caddy:

I’m using the docker image available at https://hub.docker.com/_/caddy.

a. System environment:

Docker, running under WSL2 on Windows 11:

$ uname -a
Linux Box 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Also reproduced on a DigitalOcean droplet running Ubuntu 22.04 LTS.

b. Command:

See above, but here it is again:

$ docker run --rm caddy:2 caddy add-package github.com/caddy-dns/cloudflare

c. Service/unit/compose file:

Not relevant. See above.

d. My complete Caddy config:

Not relevant. See above.

5. Links to relevant resources:

It’s trying to download the build from our build server, but go get has bugs causing builds to hang.

For now, please build from source using xcaddy. See the docs. We can’t make any guarantees about the build server.

That’s understandable, and pretty much what I figured was happening (after reading the other thread about the website not working either) but thought it was worth reporting anyhow.

The docs for add-package do specify that it’s experimental, which is fair enough, but it does seem like there could be some benefit to building in a timeout on caddy add-package so that this kind of thing doesn’t create hung processes.

I have encountered a similar situation where executing caddy add-package GitHub - caddyserver/transform-encoder: Log encoder module for custom log formats took an unusually long time and did not complete the task even after 1331 seconds.

In order to verify this issue, I visited Download Caddy and added a few packages for download. The build process also took a very long time, and it did not complete even after I closed the page.

We are hoping the Go team fixes the relevant bug as soon as possible.

I have the same problem, the add-package does not work and freezes for an infinite time

@Adam_Makowski

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.