libcurl-errors.3 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.haxx.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH libcurl-errors 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl errors"
  24. .SH NAME
  25. libcurl-errors \- error codes in libcurl
  26. .SH DESCRIPTION
  27. This man page includes most, if not all, available error codes in libcurl.
  28. Why they occur and possibly what you can do to fix the problem are also included.
  29. .SH "CURLcode"
  30. Almost all "easy" interface functions return a CURLcode error code. No matter
  31. what, using the \fIcurl_easy_setopt(3)\fP option \fICURLOPT_ERRORBUFFER(3)\fP
  32. is a good idea as it will give you a human readable error string that may
  33. offer more details about the cause of the error than just the error code.
  34. \fIcurl_easy_strerror(3)\fP can be called to get an error string from a given
  35. CURLcode number.
  36. CURLcode is one of the following:
  37. .IP "CURLE_OK (0)"
  38. All fine. Proceed as usual.
  39. .IP "CURLE_UNSUPPORTED_PROTOCOL (1)"
  40. The URL you passed to libcurl used a protocol that this libcurl does not
  41. support. The support might be a compile-time option that you didn't use, it
  42. can be a misspelled protocol string or just a protocol libcurl has no code
  43. for.
  44. .IP "CURLE_FAILED_INIT (2)"
  45. Very early initialization code failed. This is likely to be an internal error
  46. or problem, or a resource problem where something fundamental couldn't get
  47. done at init time.
  48. .IP "CURLE_URL_MALFORMAT (3)"
  49. The URL was not properly formatted.
  50. .IP "CURLE_NOT_BUILT_IN (4)"
  51. A requested feature, protocol or option was not found built-in in this libcurl
  52. due to a build-time decision. This means that a feature or option was not
  53. enabled or explicitly disabled when libcurl was built and in order to get it
  54. to function you have to get a rebuilt libcurl.
  55. .IP "CURLE_COULDNT_RESOLVE_PROXY (5)"
  56. Couldn't resolve proxy. The given proxy host could not be resolved.
  57. .IP "CURLE_COULDNT_RESOLVE_HOST (6)"
  58. Couldn't resolve host. The given remote host was not resolved.
  59. .IP "CURLE_COULDNT_CONNECT (7)"
  60. Failed to connect() to host or proxy.
  61. .IP "CURLE_WEIRD_SERVER_REPLY (8)"
  62. The server sent data libcurl couldn't parse. This error code was known as as
  63. \fICURLE_FTP_WEIRD_SERVER_REPLY\fP before 7.51.0.
  64. .IP "CURLE_REMOTE_ACCESS_DENIED (9)"
  65. We were denied access to the resource given in the URL. For FTP, this occurs
  66. while trying to change to the remote directory.
  67. .IP "CURLE_FTP_ACCEPT_FAILED (10)"
  68. While waiting for the server to connect back when an active FTP session is
  69. used, an error code was sent over the control connection or similar.
  70. .IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
  71. After having sent the FTP password to the server, libcurl expects a proper
  72. reply. This error code indicates that an unexpected code was returned.
  73. .IP "CURLE_FTP_ACCEPT_TIMEOUT (12)"
  74. During an active FTP session while waiting for the server to connect, the
  75. \fICURLOPT_ACCEPTTIMEOUT_MS(3)\fP (or the internal default) timeout expired.
  76. .IP "CURLE_FTP_WEIRD_PASV_REPLY (13)"
  77. libcurl failed to get a sensible result back from the server as a response to
  78. either a PASV or a EPSV command. The server is flawed.
  79. .IP "CURLE_FTP_WEIRD_227_FORMAT (14)"
  80. FTP servers return a 227-line as a response to a PASV command. If libcurl
  81. fails to parse that line, this return code is passed back.
  82. .IP "CURLE_FTP_CANT_GET_HOST (15)"
  83. An internal failure to lookup the host used for the new connection.
  84. .IP "CURLE_HTTP2 (16)"
  85. A problem was detected in the HTTP2 framing layer. This is somewhat generic
  86. and can be one out of several problems, see the error buffer for details.
  87. .IP "CURLE_FTP_COULDNT_SET_TYPE (17)"
  88. Received an error when trying to set the transfer mode to binary or ASCII.
  89. .IP "CURLE_PARTIAL_FILE (18)"
  90. A file transfer was shorter or larger than expected. This happens when the
  91. server first reports an expected transfer size, and then delivers data that
  92. doesn't match the previously given size.
  93. .IP "CURLE_FTP_COULDNT_RETR_FILE (19)"
  94. This was either a weird reply to a 'RETR' command or a zero byte transfer
  95. complete.
  96. .IP "CURLE_QUOTE_ERROR (21)"
  97. When sending custom "QUOTE" commands to the remote server, one of the commands
  98. returned an error code that was 400 or higher (for FTP) or otherwise
  99. indicated unsuccessful completion of the command.
  100. .IP "CURLE_HTTP_RETURNED_ERROR (22)"
  101. This is returned if \fICURLOPT_FAILONERROR(3)\fP is set TRUE and the HTTP
  102. server returns an error code that is >= 400.
  103. .IP "CURLE_WRITE_ERROR (23)"
  104. An error occurred when writing received data to a local file, or an error was
  105. returned to libcurl from a write callback.
  106. .IP "CURLE_UPLOAD_FAILED (25)"
  107. Failed starting the upload. For FTP, the server typically denied the STOR
  108. command. The error buffer usually contains the server's explanation for this.
  109. .IP "CURLE_READ_ERROR (26)"
  110. There was a problem reading a local file or an error returned by the read
  111. callback.
  112. .IP "CURLE_OUT_OF_MEMORY (27)"
  113. A memory allocation request failed. This is serious badness and
  114. things are severely screwed up if this ever occurs.
  115. .IP "CURLE_OPERATION_TIMEDOUT (28)"
  116. Operation timeout. The specified time-out period was reached according to the
  117. conditions.
  118. .IP "CURLE_FTP_PORT_FAILED (30)"
  119. The FTP PORT command returned error. This mostly happens when you haven't
  120. specified a good enough address for libcurl to use. See
  121. \fICURLOPT_FTPPORT(3)\fP.
  122. .IP "CURLE_FTP_COULDNT_USE_REST (31)"
  123. The FTP REST command returned error. This should never happen if the server is
  124. sane.
  125. .IP "CURLE_RANGE_ERROR (33)"
  126. The server does not support or accept range requests.
  127. .IP "CURLE_HTTP_POST_ERROR (34)"
  128. This is an odd error that mainly occurs due to internal confusion.
  129. .IP "CURLE_SSL_CONNECT_ERROR (35)"
  130. A problem occurred somewhere in the SSL/TLS handshake. You really want the
  131. error buffer and read the message there as it pinpoints the problem slightly
  132. more. Could be certificates (file formats, paths, permissions), passwords, and
  133. others.
  134. .IP "CURLE_BAD_DOWNLOAD_RESUME (36)"
  135. The download could not be resumed because the specified offset was out of the
  136. file boundary.
  137. .IP "CURLE_FILE_COULDNT_READ_FILE (37)"
  138. A file given with FILE:// couldn't be opened. Most likely because the file
  139. path doesn't identify an existing file. Did you check file permissions?
  140. .IP "CURLE_LDAP_CANNOT_BIND (38)"
  141. LDAP cannot bind. LDAP bind operation failed.
  142. .IP "CURLE_LDAP_SEARCH_FAILED (39)"
  143. LDAP search failed.
  144. .IP "CURLE_FUNCTION_NOT_FOUND (41)"
  145. Function not found. A required zlib function was not found.
  146. .IP "CURLE_ABORTED_BY_CALLBACK (42)"
  147. Aborted by callback. A callback returned "abort" to libcurl.
  148. .IP "CURLE_BAD_FUNCTION_ARGUMENT (43)"
  149. A function was called with a bad parameter.
  150. .IP "CURLE_INTERFACE_FAILED (45)"
  151. Interface error. A specified outgoing interface could not be used. Set which
  152. interface to use for outgoing connections' source IP address with
  153. \fICURLOPT_INTERFACE(3)\fP.
  154. .IP "CURLE_TOO_MANY_REDIRECTS (47)"
  155. Too many redirects. When following redirects, libcurl hit the maximum amount.
  156. Set your limit with \fICURLOPT_MAXREDIRS(3)\fP.
  157. .IP "CURLE_UNKNOWN_OPTION (48)"
  158. An option passed to libcurl is not recognized/known. Refer to the appropriate
  159. documentation. This is most likely a problem in the program that uses
  160. libcurl. The error buffer might contain more specific information about which
  161. exact option it concerns.
  162. .IP "CURLE_TELNET_OPTION_SYNTAX (49)"
  163. A telnet option string was Illegally formatted.
  164. .IP "CURLE_GOT_NOTHING (52)"
  165. Nothing was returned from the server, and under the circumstances, getting
  166. nothing is considered an error.
  167. .IP "CURLE_SSL_ENGINE_NOTFOUND (53)"
  168. The specified crypto engine wasn't found.
  169. .IP "CURLE_SSL_ENGINE_SETFAILED (54)"
  170. Failed setting the selected SSL crypto engine as default!
  171. .IP "CURLE_SEND_ERROR (55)"
  172. Failed sending network data.
  173. .IP "CURLE_RECV_ERROR (56)"
  174. Failure with receiving network data.
  175. .IP "CURLE_SSL_CERTPROBLEM (58)"
  176. problem with the local client certificate.
  177. .IP "CURLE_SSL_CIPHER (59)"
  178. Couldn't use specified cipher.
  179. .IP "CURLE_PEER_FAILED_VERIFICATION (60)"
  180. The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK.
  181. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its
  182. previous value was 51.
  183. .IP "CURLE_BAD_CONTENT_ENCODING (61)"
  184. Unrecognized transfer encoding.
  185. .IP "CURLE_LDAP_INVALID_URL (62)"
  186. Invalid LDAP URL.
  187. .IP "CURLE_FILESIZE_EXCEEDED (63)"
  188. Maximum file size exceeded.
  189. .IP "CURLE_USE_SSL_FAILED (64)"
  190. Requested FTP SSL level failed.
  191. .IP "CURLE_SEND_FAIL_REWIND (65)"
  192. When doing a send operation curl had to rewind the data to retransmit, but the
  193. rewinding operation failed.
  194. .IP "CURLE_SSL_ENGINE_INITFAILED (66)"
  195. Initiating the SSL Engine failed.
  196. .IP "CURLE_LOGIN_DENIED (67)"
  197. The remote server denied curl to login (Added in 7.13.1)
  198. .IP "CURLE_TFTP_NOTFOUND (68)"
  199. File not found on TFTP server.
  200. .IP "CURLE_TFTP_PERM (69)"
  201. Permission problem on TFTP server.
  202. .IP "CURLE_REMOTE_DISK_FULL (70)"
  203. Out of disk space on the server.
  204. .IP "CURLE_TFTP_ILLEGAL (71)"
  205. Illegal TFTP operation.
  206. .IP "CURLE_TFTP_UNKNOWNID (72)"
  207. Unknown TFTP transfer ID.
  208. .IP "CURLE_REMOTE_FILE_EXISTS (73)"
  209. File already exists and will not be overwritten.
  210. .IP "CURLE_TFTP_NOSUCHUSER (74)"
  211. This error should never be returned by a properly functioning TFTP server.
  212. .IP "CURLE_CONV_FAILED (75)"
  213. Character conversion failed.
  214. .IP "CURLE_CONV_REQD (76)"
  215. Caller must register conversion callbacks.
  216. .IP "CURLE_SSL_CACERT_BADFILE (77)"
  217. Problem with reading the SSL CA cert (path? access rights?)
  218. .IP "CURLE_REMOTE_FILE_NOT_FOUND (78)"
  219. The resource referenced in the URL does not exist.
  220. .IP "CURLE_SSH (79)"
  221. An unspecified error occurred during the SSH session.
  222. .IP "CURLE_SSL_SHUTDOWN_FAILED (80)"
  223. Failed to shut down the SSL connection.
  224. .IP "CURLE_AGAIN (81)"
  225. Socket is not ready for send/recv wait till it's ready and try again. This
  226. return code is only returned from \fIcurl_easy_recv(3)\fP and
  227. \fIcurl_easy_send(3)\fP (Added in 7.18.2)
  228. .IP "CURLE_SSL_CRL_BADFILE (82)"
  229. Failed to load CRL file (Added in 7.19.0)
  230. .IP "CURLE_SSL_ISSUER_ERROR (83)"
  231. Issuer check failed (Added in 7.19.0)
  232. .IP "CURLE_FTP_PRET_FAILED (84)"
  233. The FTP server does not understand the PRET command at all or does not support
  234. the given argument. Be careful when using \fICURLOPT_CUSTOMREQUEST(3)\fP, a
  235. custom LIST command will be sent with PRET CMD before PASV as well. (Added in
  236. 7.20.0)
  237. .IP "CURLE_RTSP_CSEQ_ERROR (85)"
  238. Mismatch of RTSP CSeq numbers.
  239. .IP "CURLE_RTSP_SESSION_ERROR (86)"
  240. Mismatch of RTSP Session Identifiers.
  241. .IP "CURLE_FTP_BAD_FILE_LIST (87)"
  242. Unable to parse FTP file list (during FTP wildcard downloading).
  243. .IP "CURLE_CHUNK_FAILED (88)"
  244. Chunk callback reported error.
  245. .IP "CURLE_NO_CONNECTION_AVAILABLE (89)"
  246. (For internal use only, will never be returned by libcurl) No connection
  247. available, the session will be queued. (added in 7.30.0)
  248. .IP "CURLE_SSL_PINNEDPUBKEYNOTMATCH (90)"
  249. Failed to match the pinned key specified with \fICURLOPT_PINNEDPUBLICKEY(3)\fP.
  250. .IP "CURLE_SSL_INVALIDCERTSTATUS (91)"
  251. Status returned failure when asked with \fICURLOPT_SSL_VERIFYSTATUS(3)\fP.
  252. .IP "CURLE_HTTP2_STREAM (92)"
  253. Stream error in the HTTP/2 framing layer.
  254. .IP "CURLE_RECURSIVE_API_CALL (93)"
  255. An API function was called from inside a callback.
  256. .IP "CURLE_AUTH_ERROR (94)"
  257. An authentication function returned an error.
  258. .IP "CURLE_HTTP3 (95)"
  259. A problem was detected in the HTTP/3 layer. This is somewhat generic and can
  260. be one out of several problems, see the error buffer for details.
  261. .IP "CURLE_QUIC_CONNECT_ERROR (96)"
  262. QUIC connection error. This error may be caused by an SSL library error. QUIC
  263. is the protocol used for HTTP/3 transfers.
  264. .IP "CURLE_OBSOLETE*"
  265. These error codes will never be returned. They were used in an old libcurl
  266. version and are currently unused.
  267. .SH "CURLMcode"
  268. This is the generic return code used by functions in the libcurl multi
  269. interface. Also consider \fIcurl_multi_strerror(3)\fP.
  270. .IP "CURLM_CALL_MULTI_PERFORM (-1)"
  271. This is not really an error. It means you should call
  272. \fIcurl_multi_perform(3)\fP again without doing select() or similar in
  273. between. Before version 7.20.0 this could be returned by
  274. \fIcurl_multi_perform(3)\fP, but in later versions this return code is never
  275. used.
  276. .IP "CURLM_CALL_MULTI_SOCKET (-1)"
  277. An alias for CURLM_CALL_MULTI_PERFORM. Never returned by modern libcurl
  278. versions.
  279. .IP "CURLM_OK (0)"
  280. Things are fine.
  281. .IP "CURLM_BAD_HANDLE (1)"
  282. The passed-in handle is not a valid CURLM handle.
  283. .IP "CURLM_BAD_EASY_HANDLE (2)"
  284. An easy handle was not good/valid. It could mean that it isn't an easy handle
  285. at all, or possibly that the handle already is in use by this or another multi
  286. handle.
  287. .IP "CURLM_OUT_OF_MEMORY (3)"
  288. You are doomed.
  289. .IP "CURLM_INTERNAL_ERROR (4)"
  290. This can only be returned if libcurl bugs. Please report it to us!
  291. .IP "CURLM_BAD_SOCKET (5)"
  292. The passed-in socket is not a valid one that libcurl already knows about.
  293. (Added in 7.15.4)
  294. .IP "CURLM_UNKNOWN_OPTION (6)"
  295. curl_multi_setopt() with unsupported option
  296. (Added in 7.15.4)
  297. .IP "CURLM_ADDED_ALREADY (7)"
  298. An easy handle already added to a multi handle was attempted to get added a
  299. second time. (Added in 7.32.1)
  300. .IP "CURLM_RECURSIVE_API_CALL (8)"
  301. An API function was called from inside a callback.
  302. .IP "CURLM_WAKEUP_FAILURE (9)"
  303. Wakeup is unavailable or failed.
  304. .IP "CURLM_BAD_FUNCTION_ARGUMENT (10)"
  305. A function was called with a bad parameter.
  306. .SH "CURLSHcode"
  307. The "share" interface will return a CURLSHcode to indicate when an error has
  308. occurred. Also consider \fIcurl_share_strerror(3)\fP.
  309. .IP "CURLSHE_OK (0)"
  310. All fine. Proceed as usual.
  311. .IP "CURLSHE_BAD_OPTION (1)"
  312. An invalid option was passed to the function.
  313. .IP "CURLSHE_IN_USE (2)"
  314. The share object is currently in use.
  315. .IP "CURLSHE_INVALID (3)"
  316. An invalid share object was passed to the function.
  317. .IP "CURLSHE_NOMEM (4)"
  318. Not enough memory was available.
  319. (Added in 7.12.0)
  320. .IP "CURLSHE_NOT_BUILT_IN (5)"
  321. The requested sharing could not be done because the library you use don't have
  322. that particular feature enabled. (Added in 7.23.0)
  323. .SH "CURLUcode"
  324. .IP "CURLUE_BAD_HANDLE (1)"
  325. An argument that should be a CURLU pointer was passed in as a NULL.
  326. .IP "CURLUE_BAD_PARTPOINTER (2)"
  327. A NULL pointer was passed to the 'part' argument of \fIcurl_url_get(3)\fP.
  328. .IP "CURLUE_MALFORMED_INPUT (3)"
  329. A malformed input was passed to a URL API function.
  330. .IP "CURLUE_BAD_PORT_NUMBER (4)"
  331. The port number was not a decimal number between 0 and 65535.
  332. .IP "CURLUE_UNSUPPORTED_SCHEME (5)"
  333. This libcurl build doesn't support the given URL scheme.
  334. .IP "CURLUE_URLDECODE (6)"
  335. URL decode error, most likely because of rubbish in the input.
  336. .IP "CURLUE_OUT_OF_MEMORY (7)"
  337. A memory function failed.
  338. .IP "CURLUE_USER_NOT_ALLOWED (8)"
  339. Credentials was passed in the URL when prohibited.
  340. .IP "CURLUE_UNKNOWN_PART (9)"
  341. An unknown part ID was passed to a URL API function.
  342. .IP "CURLUE_NO_SCHEME (10)"
  343. There is no scheme part in the URL.
  344. .IP "CURLUE_NO_USER (11)"
  345. There is no user part in the URL.
  346. .IP "CURLUE_NO_PASSWORD (12)"
  347. There is no password part in the URL.
  348. .IP "CURLUE_NO_OPTIONS (13)"
  349. There is no options part in the URL.
  350. .IP "CURLUE_NO_HOST (14)"
  351. There is no host part in the URL.
  352. .IP "CURLUE_NO_PORT (15)"
  353. There is no port part in the URL.
  354. .IP "CURLUE_NO_QUERY (16)"
  355. There is no query part in the URL.
  356. .IP "CURLUE_NO_FRAGMENT (17)"
  357. There is no fragment part in the URL.
  358. .SH "SEE ALSO"
  359. .BR curl_easy_strerror "(3), " curl_multi_strerror "(3), "
  360. .BR curl_share_strerror "(3), " CURLOPT_ERRORBUFFER "(3), "
  361. .BR CURLOPT_VERBOSE "(3), " CURLOPT_DEBUGFUNCTION "(3) "