This MAN page includes most, if not all, available error codes in libcurl. Why they occur and possibly what actions can be performed to fix the problem are also included.
There are three types of
Almost all "easy" interface functions return a
CURLcode error code. No matter what, using the
CURLOPT_ERRORBUFFER is a good practice as it will provide you with a human-readable error string that may offer more information about the cause of the error than just the error code.
can be called to get an error string from a given
CURLcode is one of the following (
CURLcode number in parentheses):
All fine. Proceed as usual.
The URL you passed to libcurl used a protocol that this libcurl does not support. Cafe libcurl currently only support HTTP (and HTTPS).
Early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time.
The URL was not properly formatted.
A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This indicates that a feature or option is not available in Cafe.
Couldn't resolve proxy. The given proxy host could not be resolved.
Couldn't resolve host. The given remote host was not resolved.
Failed to connect to host or proxy.
We were denied access to the resource given in the URL.
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that does not match the previously given size.
This is returned if
CURLOPT_FAILONERROR is set
TRUE and the HTTP server returns an error code that is >=
An error occurred when an error was returned to libcurl from a write callback.
Failed starting the upload. The error buffer usually contains the server's description for this.
An error returned by the read callback.
A memory allocation request failed. If occurs, indicates a serious error that events are severely affected.
Operation timeout. The specified time-out period was reached according to the conditions.
The server does not support or accept range requests.
This is an odd error that mainly occurs due to internal confusion.
A problem occurred somewhere in the SSL/TLS handshake. You want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates and others.
The download could not be resumed because the specified offset was out of the file boundary.
Aborted by callback. A callback returned "abort" to libcurl.
Internal error. A function was called with a bad parameter.
Too many redirects. When following redirects, libcurl reached the maximum amount. Set your limit with
An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns.
The remote server's SSL certificate or SSH md5 fingerprint was deemed not acceptable.
Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.
Failed sending network data.
Failure with receiving network data.
Issue with the local client certificate.
Peer certificate cannot be authenticated with known CA certificates.
Unrecognized transfer encoding.
Maximum file size exceeded.
When performing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed.
The remote server denied curl to log in.
Character conversion failed.
Caller must register conversion callbacks.
The resource referenced in the URL does not exist.
Failed to shut down the SSL connection.
Chunk callback reported error.
These error codes will never be returned. They were used in an old libcurl version and are currently unused.
This is the generic return code used by functions in the libcurl multi interface. Also consider
This is not an error. It indicates that you should call
curl_multi_perform again without doing select or similar in between.
Things are as expected.
The passed-in handle is not a valid
An easy handle was not good/valid. It could indicate that it is not an easy handle, or possibly, that the handle is already in use by this or another multi-handle.
Out of memory.
This can only be returned if libcurl bugs. Please report it to us!
The passed-in socket is not a valid one that libcurl already knows about.
curl_multi_setopt with unsupported option.
The "share" interface will return a CURLSHcode to indicate when an error has occurred. Also consider
All as expected. Proceed as usual.
An invalid option was passed to the function.
The share object is currently in use.
An invalid share object was passed to the function.
Not enough memory was available.