Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Error during download, exit code: 23 #78

Open
gabeklavans opened this issue Apr 12, 2024 · 6 comments
Open

Error during download, exit code: 23 #78

gabeklavans opened this issue Apr 12, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@gabeklavans
Copy link

Every time the plugin tries to use curl to download something, it throws an error from curl

I'm using Linux, OpenSUSE Tumbleweed, so I have a pretty up to date curl and no weird installations.

Even manually trying to download anything from devdocs.io, such as with curl https://devdocs.io/docs.json -o registery.json, just returns an empty output.

➜  devdocs curl https://devdocs.io/docs.json -o registery.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

Replacing curl with wget in my command line, and the download happens as intended. This isn't a solution, though, since all the downloads in this plugin use curl, so manually placing everything everytime would be kind of annoying.

Adding the -sSL flag to my curl command also allows the download to succeed.

Version:

curl --version
curl 8.7.1 (x86_64-suse-linux-gnu) libcurl/8.7.1 OpenSSL/3.1.4 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh/0.10.6/openssl/zlib nghttp2/1.61.0 OpenLDAP/2.6.6
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
@luckasRanarison luckasRanarison added the bug Something isn't working label Apr 14, 2024
@luckasRanarison
Copy link
Owner

luckasRanarison commented Apr 16, 2024

I could reproduce that issue on my phone using termux but it seems that it's caused by missing write access for creating the dump file (by default in tmp directory) used by curl when using the -D argument. And it looks like it cannot be omitted when using plenary, but I'm stuck on trying to use a custom path for it...

EDIT: I think that should be plenary issue (nvim-lua/plenary.nvim#536)

@gabeklavans
Copy link
Author

In my case, I'm seeing the "plenary_curl_xxxxxxxx.headers" files being created in my dir set by XDG_RUNTIME_DIR (it was /run/user/1000 for me, which already existed and had proper permissions) and I'm still getting this exit code 23 from plenary. I wonder what else could be causing it.

@gabeklavans
Copy link
Author

It definitely has to do with the URL. If I replace it with something simple like https://postman-echo.com/get, I get no error. I'm guessing it has to do with the fact that https://devdocs.io/docs.json is a redirect, but I'm not sure how it was ever working, then.

@luckasRanarison
Copy link
Owner

luckasRanarison commented Apr 18, 2024

I'm guessing it has to do with the fact that https://devdocs.io/docs.json is a redirect

But plenary include -L argument by default and redirect works, the error code 23 is for write error.

@jonboh
Copy link

jonboh commented May 3, 2024

@gabeklavans check if you get the error with:

curl -sSL --compressed -X GET https://devdocs.io/docs.json

In my case the --compressed flag generates the error using

curl --version
curl 8.7.1 (x86_64-pc-linux-gnu) libcurl/8.7.1 OpenSSL/3.0.13 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.61.0
Release-Date: 2024-03-27

However with

curl --version
curl 8.4.0 (x86_64-pc-linux-gnu) libcurl/8.4.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libssh2/1.11.0 nghttp2/1.57.0
Release-Date: 2023-10-11

I don't get the error

Disabling the compression in the plenary calls fixes the issue for me

@jonboh
Copy link

jonboh commented May 3, 2024

It seems to be related to this issue: curl/curl#13209
and it seems to already have a fix: curl/curl#13219

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants