List of common cURL Error Codes

Below is the list of most common error codes and its meaning in cURL.

cURL Error CodecURLcodeDescription
0CURLE_OKAll fine. Proceed as usual.
1CURLE_UNSUPPORTED_PROTOCOLThe URL you passed to libcurl used a protocol that this libcurl does not support.
2CURLE_FAILED_INITEarly initialization code failed.
3CURLE_URL_MALFORMATThe URL was not properly formatted.
4CURLE_NOT_BUILT_INA requested feature, protocol, or option was not found built-in in this libcurl due to a build-time decision.
5CURLE_COULDNT_RESOLVE_PROXYCould not resolve the proxy host.
6CURLE_COULDNT_RESOLVE_HOSTCould not resolve the host.
7CURLE_COULDNT_CONNECTFailed to connect to host or proxy.
8CURLE_WEIRD_SERVER_REPLYThe server sent data libcurl could not parse.
9CURLE_REMOTE_ACCESS_DENIEDWe were denied access to the resource given in the URL.
10CURLE_FTP_ACCEPT_FAILEDWhile 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.
11CURLE_FTP_WEIRD_PASS_REPLYAfter having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned.
12CURLE_FTP_ACCEPT_TIMEOUTDuring an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMEOUT_MS (or the internal default) timeout expired.
13CURLE_FTP_WEIRD_PASV_REPLYlibcurl 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.
14CURLE_FTP_WEIRD_227_FORMATFTP 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.
15CURLE_FTP_CANT_GET_HOSTAn internal failure to lookup the host used for the new connection.
16CURLE_HTTP2A problem was detected in the HTTP2 framing layer.
17CURLE_FTP_COULDNT_SET_TYPEReceived an error when trying to set the transfer mode to binary or ASCII.
18CURLE_PARTIAL_FILEA file transfer was shorter or larger than expected.
19CURLE_FTP_COULDNT_RETR_FILEThis was either a weird reply to a 'RETR' command or a zero byte transfer complete.
21CURLE_QUOTE_ERRORWhen 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.
22CURLE_HTTP_RETURNED_ERRORThis is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.
23CURLE_WRITE_ERRORAn error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.
25CURLE_UPLOAD_FAILEDFailed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this.
26CURLE_READ_ERRORThere was a problem reading a local file or an error returned by the read callback.
27CURLE_OUT_OF_MEMORYA memory allocation request failed.
28CURLE_OPERATION_TIMEDOUTOperation timeout. The specified time-out period was reached according to the conditions.
30CURLE_FTP_PORT_FAILEDThe FTP PORT command returned an error.
31CURLE_FTP_COULDNT_USE_RESTThe FTP REST command returned an error.
33CURLE_RANGE_ERRORThe server does not support or accept range requests.
34CURLE_HTTP_POST_ERRORAn odd error that mainly occurs due to internal confusion.
35CURLE_SSL_CONNECT_ERRORA problem occurred somewhere in the SSL/TLS handshake.
36CURLE_BAD_DOWNLOAD_RESUMEThe download could not be resumed because the specified offset was out of the file boundary.
37CURLE_FILE_COULDNT_READ_FILEA file given with FILE:// could not be opened.
38CURLE_LDAP_CANNOT_BINDLDAP cannot bind. LDAP bind operation failed.
41CURLE_FUNCTION_NOT_FOUNDFunction not found. A required zlib function was not found.
42CURLE_ABORTED_BY_CALLBACKAborted by callback. A callback returned "abort" to libcurl.
43CURLE_BAD_FUNCTION_ARGUMENTA function was called with a bad parameter.
45CURLE_INTERFACE_FAILEDInterface error. A specified outgoing interface could not be used.
47CURLE_TOO_MANY_REDIRECTSToo many redirects. When following redirects, libcurl hit the maximum amount.
48CURLE_UNKNOWN_OPTIONAn option passed to libcurl is not recognized/known.
49CURLE_SETOPT_OPTION_SYNTAXAn option passed in to a setopt was wrongly formatted.
50-51Obsolete errorsNot used in modern versions.
52CURLE_GOT_NOTHINGNothing was returned from the server, and getting nothing is considered an error.
53CURLE_SSL_ENGINE_NOTFOUNDThe specified crypto engine was not found.
54CURLE_SSL_ENGINE_SETFAILEDFailed setting the selected SSL crypto engine as default.
55CURLE_SEND_ERRORFailed sending network data.
56CURLE_RECV_ERRORFailure with receiving network data.
57Obsolete errorNot used in modern versions.
58CURLE_SSL_CERTPROBLEMProblem with the local client certificate.
59CURLE_SSL_CIPHERCould not use the specified cipher.
60CURLE_PEER_FAILED_VERIFICATIONThe remote server's SSL certificate or SSH fingerprint was deemed not OK.
61CURLE_BAD_CONTENT_ENCODINGUnrecognized transfer encoding.
62Obsolete errorNot used in modern versions.
63CURLE_FILESIZE_EXCEEDEDMaximum file size exceeded.
64CURLE_USE_SSL_FAILEDRequested FTP SSL level failed.
65CURLE_SEND_FAIL_REWINDWhen doing a send operation, curl had to rewind the data to retransmit, but the rewinding operation failed.
66CURLE_SSL_ENGINE_INITFAILEDInitiating the SSL Engine failed.
67CURLE_LOGIN_DENIEDThe remote server denied curl to login (Added in 7.13.1).
68CURLE_TFTP_NOTFOUNDFile not found on TFTP server.
69CURLE_TFTP_PERMPermission problem on TFTP server.
70CURLE_REMOTE_DISK_FULLOut of disk space on the server.
71CURLE_TFTP_ILLEGALIllegal TFTP operation.
73CURLE_REMOTE_FILE_EXISTSFile already exists and will not be overwritten.
74CURLE_TFTP_NOSUCHUSERThis error should never be returned by a properly functioning TFTP server.
75-76Obsolete errorsNot used in modern versions.
77CURLE_SSL_CACERT_BADFILEProblem with reading the SSL CA cert (path? access rights?)
78CURLE_REMOTE_FILE_NOT_FOUNDThe resource referenced in the URL does not exist.
79CURLE_SSHAn unspecified error occurred during the SSH session.
80CURLE_SSL_SHUTDOWN_FAILEDFailed to shut down the SSL connection.
81CURLE_AGAINSocket is not ready for send/recv; wait till it's ready and try again. (Added in 7.18.2)
82CURLE_SSL_CRL_BADFILEFailed to load CRL file (Added in 7.19.0)
83CURLE_SSL_ISSUER_ERRORIssuer check failed (Added in 7.19.0)
84CURLE_FTP_PRET_FAILEDThe 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)
85CURLE_RTSP_CSEQ_ERRORMismatch of RTSP CSeq numbers.
86CURLE_RTSP_SESSION_ERRORMismatch of RTSP Session Identifiers.
87CURLE_FTP_BAD_FILE_LISTUnable to parse FTP file list (during FTP wildcard downloading).
88CURLE_CHUNK_FAILEDChunk callback reported an error.
89CURLE_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)
90CURLE_SSL_PINNEDPUBKEYNOTMATCHFailed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY.
92CURLE_HTTP2_STREAMStream error in the HTTP/2 framing layer.
93CURLE_RECURSIVE_API_CALLAn API function was called from inside a callback.
94CURLE_AUTH_ERRORAn authentication function returned an error.
95CURLE_HTTP3A 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.
96CURLE_QUIC_CONNECT_ERRORQUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers.
97CURLE_PROXYProxy handshake error. CURLINFO_PROXY_ERROR provides extra details on the specific problem.
98CURLE_SSL_CLIENTCERTSSL Client Certificate required.
99CURLE_UNRECOVERABLE_POLLAn internal call to poll() or select() returned an error that is not recoverable.


Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap