Below is the list of most common error codes and its meaning in cURL.
cURL Error Code | cURLcode | Description |
---|---|---|
0 | CURLE_OK | All fine. Proceed as usual. |
1 | CURLE_UNSUPPORTED_PROTOCOL | The URL you passed to libcurl used a protocol that this libcurl does not support. |
2 | CURLE_FAILED_INIT | Early initialization code failed. |
3 | CURLE_URL_MALFORMAT | The URL was not properly formatted. |
4 | CURLE_NOT_BUILT_IN | A requested feature, protocol, or option was not found built-in in this libcurl due to a build-time decision. |
5 | CURLE_COULDNT_RESOLVE_PROXY | Could not resolve the proxy host. |
6 | CURLE_COULDNT_RESOLVE_HOST | Could not resolve the host. |
7 | CURLE_COULDNT_CONNECT | Failed to connect to host or proxy. |
8 | CURLE_WEIRD_SERVER_REPLY | The server sent data libcurl could not parse. |
9 | CURLE_REMOTE_ACCESS_DENIED | We were denied access to the resource given in the URL. |
10 | CURLE_FTP_ACCEPT_FAILED | While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar. |
11 | CURLE_FTP_WEIRD_PASS_REPLY | After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned. |
12 | CURLE_FTP_ACCEPT_TIMEOUT | During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMEOUT_MS (or the internal default) timeout expired. |
13 | CURLE_FTP_WEIRD_PASV_REPLY | libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed. |
14 | CURLE_FTP_WEIRD_227_FORMAT | FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back. |
15 | CURLE_FTP_CANT_GET_HOST | An internal failure to lookup the host used for the new connection. |
16 | CURLE_HTTP2 | A problem was detected in the HTTP2 framing layer. |
17 | CURLE_FTP_COULDNT_SET_TYPE | Received an error when trying to set the transfer mode to binary or ASCII. |
18 | CURLE_PARTIAL_FILE | A file transfer was shorter or larger than expected. |
19 | CURLE_FTP_COULDNT_RETR_FILE | This was either a weird reply to a 'RETR' command or a zero byte transfer complete. |
21 | CURLE_QUOTE_ERROR | When sending custom "QUOTE" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command. |
22 | CURLE_HTTP_RETURNED_ERROR | This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400. |
23 | CURLE_WRITE_ERROR | An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback. |
25 | CURLE_UPLOAD_FAILED | Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this. |
26 | CURLE_READ_ERROR | There was a problem reading a local file or an error returned by the read callback. |
27 | CURLE_OUT_OF_MEMORY | A memory allocation request failed. |
28 | CURLE_OPERATION_TIMEDOUT | Operation timeout. The specified time-out period was reached according to the conditions. |
30 | CURLE_FTP_PORT_FAILED | The FTP PORT command returned an error. |
31 | CURLE_FTP_COULDNT_USE_REST | The FTP REST command returned an error. |
33 | CURLE_RANGE_ERROR | The server does not support or accept range requests. |
34 | CURLE_HTTP_POST_ERROR | An odd error that mainly occurs due to internal confusion. |
35 | CURLE_SSL_CONNECT_ERROR | A problem occurred somewhere in the SSL/TLS handshake. |
36 | CURLE_BAD_DOWNLOAD_RESUME | The download could not be resumed because the specified offset was out of the file boundary. |
37 | CURLE_FILE_COULDNT_READ_FILE | A file given with FILE:// could not be opened. |
38 | CURLE_LDAP_CANNOT_BIND | LDAP cannot bind. LDAP bind operation failed. |
39 | CURLE_LDAP_SEARCH_FAILED | LDAP search failed. |
41 | CURLE_FUNCTION_NOT_FOUND | Function not found. A required zlib function was not found. |
42 | CURLE_ABORTED_BY_CALLBACK | Aborted by callback. A callback returned "abort" to libcurl. |
43 | CURLE_BAD_FUNCTION_ARGUMENT | A function was called with a bad parameter. |
45 | CURLE_INTERFACE_FAILED | Interface error. A specified outgoing interface could not be used. |
47 | CURLE_TOO_MANY_REDIRECTS | Too many redirects. When following redirects, libcurl hit the maximum amount. |
48 | CURLE_UNKNOWN_OPTION | An option passed to libcurl is not recognized/known. |
49 | CURLE_SETOPT_OPTION_SYNTAX | An option passed in to a setopt was wrongly formatted. |
50-51 | Obsolete errors | Not used in modern versions. |
52 | CURLE_GOT_NOTHING | Nothing was returned from the server, and getting nothing is considered an error. |
53 | CURLE_SSL_ENGINE_NOTFOUND | The specified crypto engine was not found. |
54 | CURLE_SSL_ENGINE_SETFAILED | Failed setting the selected SSL crypto engine as default. |
55 | CURLE_SEND_ERROR | Failed sending network data. |
56 | CURLE_RECV_ERROR | Failure with receiving network data. |
57 | Obsolete error | Not used in modern versions. |
58 | CURLE_SSL_CERTPROBLEM | Problem with the local client certificate. |
59 | CURLE_SSL_CIPHER | Could not use the specified cipher. |
60 | CURLE_PEER_FAILED_VERIFICATION | The remote server's SSL certificate or SSH fingerprint was deemed not OK. |
61 | CURLE_BAD_CONTENT_ENCODING | Unrecognized transfer encoding. |
62 | Obsolete error | Not used in modern versions. |
63 | CURLE_FILESIZE_EXCEEDED | Maximum file size exceeded. |
64 | CURLE_USE_SSL_FAILED | Requested FTP SSL level failed. |
65 | CURLE_SEND_FAIL_REWIND | When doing a send operation, curl had to rewind the data to retransmit, but the rewinding operation failed. |
66 | CURLE_SSL_ENGINE_INITFAILED | Initiating the SSL Engine failed. |
67 | CURLE_LOGIN_DENIED | The remote server denied curl to login (Added in 7.13.1). |
68 | CURLE_TFTP_NOTFOUND | File not found on TFTP server. |
69 | CURLE_TFTP_PERM | Permission problem on TFTP server. |
70 | CURLE_REMOTE_DISK_FULL | Out of disk space on the server. |
71 | CURLE_TFTP_ILLEGAL | Illegal TFTP operation. |
72 | CURLE_TFTP_UNKNOWNID | Unknown TFTP transfer ID. |
73 | CURLE_REMOTE_FILE_EXISTS | File already exists and will not be overwritten. |
74 | CURLE_TFTP_NOSUCHUSER | This error should never be returned by a properly functioning TFTP server. |
75-76 | Obsolete errors | Not used in modern versions. |
77 | CURLE_SSL_CACERT_BADFILE | Problem with reading the SSL CA cert (path? access rights?) |
78 | CURLE_REMOTE_FILE_NOT_FOUND | The resource referenced in the URL does not exist. |
79 | CURLE_SSH | An unspecified error occurred during the SSH session. |
80 | CURLE_SSL_SHUTDOWN_FAILED | Failed to shut down the SSL connection. |
81 | CURLE_AGAIN | Socket is not ready for send/recv; wait till it's ready and try again. (Added in 7.18.2) |
82 | CURLE_SSL_CRL_BADFILE | Failed to load CRL file (Added in 7.19.0) |
83 | CURLE_SSL_ISSUER_ERROR | Issuer check failed (Added in 7.19.0) |
84 | CURLE_FTP_PRET_FAILED | The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using CURLOPT_CUSTOMREQUEST; a custom LIST command will be sent with the PRET command before PASV as well. (Added in 7.20.0) |
85 | CURLE_RTSP_CSEQ_ERROR | Mismatch of RTSP CSeq numbers. |
86 | CURLE_RTSP_SESSION_ERROR | Mismatch of RTSP Session Identifiers. |
87 | CURLE_FTP_BAD_FILE_LIST | Unable to parse FTP file list (during FTP wildcard downloading). |
88 | CURLE_CHUNK_FAILED | Chunk callback reported an error. |
89 | CURLE_NO_CONNECTION_AVAILABLE | (For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (Added in 7.30.0) |
90 | CURLE_SSL_PINNEDPUBKEYNOTMATCH | Failed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY. |
91 | CURLE_SSL_INVALIDCERTSTATUS | Status returned failure when asked with CURLOPT_SSL_VERIFYSTATUS. |
92 | CURLE_HTTP2_STREAM | Stream error in the HTTP/2 framing layer. |
93 | CURLE_RECURSIVE_API_CALL | An API function was called from inside a callback. |
94 | CURLE_AUTH_ERROR | An authentication function returned an error. |
95 | CURLE_HTTP3 | A problem was detected in the HTTP/3 layer. This is somewhat generic and can be one out of several problems; see the error buffer for details. |
96 | CURLE_QUIC_CONNECT_ERROR | QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers. |
97 | CURLE_PROXY | Proxy handshake error. CURLINFO_PROXY_ERROR provides extra details on the specific problem. |
98 | CURLE_SSL_CLIENTCERT | SSL Client Certificate required. |
99 | CURLE_UNRECOVERABLE_POLL | An internal call to poll() or select() returned an error that is not recoverable. |
Reference: https://curl.se/libcurl/c/libcurl-errors.html
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to cURL,
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- Capture cURL Request Output to a File
- Fix: Curl No Match Found Error
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- Send JSON Data as Payload using cURL HTTP POST Request
- cURL: Show Request and Response Headers
- Get cURL command from Chrome Inspect Network HTTP URL
- Save cURL Command Output to a external file
- cURL DELETE Request with Examples
- How to URL Encode Data for a cURL Request Parameters
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to convert a Postman request to cURL Command
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- How to follow redirects in cURL Command Request
- How to pass authorization header using cURL
- cURL -x Use of HTTP Proxy Server Examples
- Downloading Google Chrome using cURL Command
- How to get cURL Command to run in verbose mode?
- List of 28 Protocols supported by cURL with Examples
- Hide cURL Outputs and Errors on Terminal
- cURL -d Option with Examples
- How to show SSL Certificate details using cURL Command
- Perform Basic Authentication using cURL with Examples
More Posts:
- How to declare Arrays in Java with Examples - Java
- Detect if Cookies are enabled using JavaScript - JavaScript
- How to hard reset Mac Terminal Window - MacOS
- Bootstrap Nav Menu Dropdown on hover - Bootstrap
- Converting Array into ArrayList - Java - Java
- Excel Fix: SECURITY RISK Microsoft has blocked macros from running because the source of this file is untrusted. - JavaScript
- Can Microsoft SharePoint Lists be synced and accessed offline without internet? - SharePoint
- Check version of pip package installer for Python - Python