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

Curl 8.5.0 bug in Alpine 3.19 #4440

Open
leosamuele221 opened this issue Mar 25, 2024 · 21 comments
Open

Curl 8.5.0 bug in Alpine 3.19 #4440

leosamuele221 opened this issue Mar 25, 2024 · 21 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working needs info Not enough information provided

Comments

@leosamuele221
Copy link

leosamuele221 commented Mar 25, 2024

Steps to reproduce

  1. Install nextcloud with latest label
  2. Install "Memories" app and Memories external container

Expected behavior

Normal work of memories transcoder

Actual behavior

Nextcloud container can't connect to memories transcoder container
Screenshot 2024-03-25 122745

Screenshot 2024-03-25 123047

Host OS

CentOS 9

Nextcloud AIO version

Nextcloud AIO v8.0.0

Current channel

Latest

Possible solution

Downgrade to Alpine 3.18
Upgrade to Alpine 3.20 (as soon as available)
Install curl 8.6.0 (see below)

Other valuable info

The problem is curl 8.5.0 that is affected by curl/curl#12558. This bug is actually solved in curl 8.6.0 so you just need to update curl.
Screenshot 2024-03-25 123023

Curl 8.6.0 isn't available from alpine package manager (in Alpine 3.19 the only version available is 8.5.0 https://pkgs.alpinelinux.org/packages?name=curl&branch=v3.19&repo=main)
The only way to install curl 8.6.0 is to build it from source

To install from source follow this steps:

  1. enter in nextcloud-aio-nextcloud container
    docker exec -it nextcloud-aio-nextcloud bash

  2. remove curl 8.5.0
    apk del curl

  3. download curl 8.6.0 (you can do it in any folder you want, personally I did it in "/home/test")
    wget https://github.com/curl/curl/releases/download/curl-8_6_0/curl-8.6.0.tar.gz

  4. unpack it
    tar -xf curl-8.6.0.tar.gz

  5. move to it
    cd curl-8.6.0

  6. install dependecies
    apk add openssl-dev g++ make autoconf libpsl-dev

  7. configure
    ./configure --with-openssl

  8. make and install
    make && make install

image

With curl 8.6.0 the problem is solved!

image

If you want more info on how to build curl here is the docs https://github.com/curl/curl/blob/master/docs/INSTALL.md#unix

@leosamuele221 leosamuele221 added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Mar 25, 2024
@Zoey2936
Copy link
Collaborator

https://gitlab.alpinelinux.org/alpine/aports/-/issues/15690 can you try running apk upgrade --no-cache -a inside the nextcloud container and then retry with the preinstalled curl?

@leosamuele221
Copy link
Author

Tried with no luck
image

(I did cd home to make sure I had reset the container)

@Zoey2936
Copy link
Collaborator

can you check if my prebuilt static curl binaries work? https://github.com/ZoeyVid/curl-quic/releases/latest

@leosamuele221
Copy link
Author

leosamuele221 commented Mar 25, 2024

For some reason it works from CLI
Screenshot 2024-03-25 142758

But not from nextcloud
image

I also tried to execute it as www-data and it worked (obviously I change curl exec to 777) from CLI but not from nextcloud
image

I did multiple reboots before trying

@Zoey2936
Copy link
Collaborator

yes, because nextcloud trys to use libcurl

@Zoey2936
Copy link
Collaborator

can you try apk add curl libcurl --repository http://dl-cdn.alpinelinux.org/alpine/edge/main inside the nextcloud container and retry?

@leosamuele221
Copy link
Author

Still nothing...
image

@leosamuele221
Copy link
Author

leosamuele221 commented Mar 25, 2024

The problem is in c-ares 1.24.0 c-ares/c-ares#683 fixed with c-ares/c-ares#685, and released in c-ares 1.26.0.

curl 8.6.0 from edge repository uses c-ares 1.24.0 so the problem still persist.
When you build curl from source even if it's 8.6.0 it doesn't use c-ares, nor your build of curl uses c-ares @Zoey2936 that's why it worked

@leosamuele221
Copy link
Author

I did apk add curl libcurl --repository http://dl-cdn.alpinelinux.org/alpine/edge/main and apk upgrade c-ares installing c-ares 1.27.0. But still doesn't work.
Now i'm confused

image

@leosamuele221
Copy link
Author

I made a script to automate build https://gist.github.com/leosamuele221/aed36a3b9135032b6a8ffe7274e58ce7

@Zoey2936
Copy link
Collaborator

can you report this here: https://gitlab.alpinelinux.org/alpine/aports/-/issues

@leosamuele221
Copy link
Author

Yes i can, I'll do it as soon as possible.
But until the problem isn't solved somebody should add a good build of curl in the nextcloud-aio-nextcloud container as a patch

One option is to run this script https://gist.github.com/leosamuele221/aed36a3b9135032b6a8ffe7274e58ce7 when creating nextcloud container (maybe in the Dockerfile) so it builds a working curl

Another better option is to build a working curl and download it from github when creating the container

@szaimen
Copy link
Collaborator

szaimen commented Mar 28, 2024

Hi, can you update to v8.1.0 beta and check if that improves things?

@szaimen szaimen added the needs info Not enough information provided label Mar 28, 2024
@leosamuele221
Copy link
Author

Hi, yes i updated it to 8.1.0
The problem is still there
Obv is a curl problem, not a concern of nextcloud.
image

@leosamuele221
Copy link
Author

image

Problem is still here, even after updating to Alpine 3.19

@szaimen
Copy link
Collaborator

szaimen commented May 13, 2024

can you report this here: https://gitlab.alpinelinux.org/alpine/aports/-/issues

Have you done so?

@szaimen
Copy link
Collaborator

szaimen commented May 15, 2024

Actually, I just tested and it works on my test instance:
image

@leosamuele221
Copy link
Author

do curl -V

@szaimen
Copy link
Collaborator

szaimen commented May 16, 2024

image

@phroggar
Copy link

I'm coming here periodically, because we have noticed a similar issue in our setup.

I just want to share a solution which was working for us:

Specify a hostname for the container you are unable to resolve internally: e.g. setting "--hostname=mycontainer.domain.local"

You might need to take all containers down and restart them, to have them pickup the change in the local network.

This is not brilliant and i wish things would be resolved on the CURL or C-ARES side of things - but i just upgraded to Alpine 3.20 (curl 8.7.1 (aarch64-alpine-linux-musl) libcurl/8.7.1 ... c-ares/1.28.1) and i still see the problematic behaviour (everything (ping, wget, etc.) is resolving fine, but curl is not able to resolve if the hostname is missing)

@szaimen
Copy link
Collaborator

szaimen commented May 24, 2024

All right, that is annoying. Can someone please log an issue upstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working needs info Not enough information provided
Projects
None yet
Development

No branches or pull requests

4 participants