2
0

libcurl-errors.3 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2018, 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_FTP_WEIRD_SERVER_REPLY (8)"
  62. The server sent data libcurl couldn't parse. This error code is used for more
  63. than just FTP and is aliased as \fICURLE_WEIRD_SERVER_REPLY\fP since 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. Internal error. 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_OBSOLETE*"
  257. These error codes will never be returned. They were used in an old libcurl
  258. version and are currently unused.
  259. .SH "CURLMcode"
  260. This is the generic return code used by functions in the libcurl multi
  261. interface. Also consider \fIcurl_multi_strerror(3)\fP.
  262. .IP "CURLM_CALL_MULTI_PERFORM (-1)"
  263. This is not really an error. It means you should call
  264. \fIcurl_multi_perform(3)\fP again without doing select() or similar in
  265. between. Before version 7.20.0 this could be returned by
  266. \fIcurl_multi_perform(3)\fP, but in later versions this return code is never
  267. used.
  268. .IP "CURLM_OK (0)"
  269. Things are fine.
  270. .IP "CURLM_BAD_HANDLE (1)"
  271. The passed-in handle is not a valid CURLM handle.
  272. .IP "CURLM_BAD_EASY_HANDLE (2)"
  273. An easy handle was not good/valid. It could mean that it isn't an easy handle
  274. at all, or possibly that the handle already is in used by this or another
  275. multi handle.
  276. .IP "CURLM_OUT_OF_MEMORY (3)"
  277. You are doomed.
  278. .IP "CURLM_INTERNAL_ERROR (4)"
  279. This can only be returned if libcurl bugs. Please report it to us!
  280. .IP "CURLM_BAD_SOCKET (5)"
  281. The passed-in socket is not a valid one that libcurl already knows about.
  282. (Added in 7.15.4)
  283. .IP "CURLM_UNKNOWN_OPTION (6)"
  284. curl_multi_setopt() with unsupported option
  285. (Added in 7.15.4)
  286. .IP "CURLM_ADDED_ALREADY (7)"
  287. An easy handle already added to a multi handle was attempted to get added a
  288. second time. (Added in 7.32.1)
  289. .IP "CURLM_RECURSIVE_API_CALL (8)"
  290. An API function was called from inside a callback.
  291. .SH "CURLSHcode"
  292. The "share" interface will return a CURLSHcode to indicate when an error has
  293. occurred. Also consider \fIcurl_share_strerror(3)\fP.
  294. .IP "CURLSHE_OK (0)"
  295. All fine. Proceed as usual.
  296. .IP "CURLSHE_BAD_OPTION (1)"
  297. An invalid option was passed to the function.
  298. .IP "CURLSHE_IN_USE (2)"
  299. The share object is currently in use.
  300. .IP "CURLSHE_INVALID (3)"
  301. An invalid share object was passed to the function.
  302. .IP "CURLSHE_NOMEM (4)"
  303. Not enough memory was available.
  304. (Added in 7.12.0)
  305. .IP "CURLSHE_NOT_BUILT_IN (5)"
  306. The requested sharing could not be done because the library you use don't have
  307. that particular feature enabled. (Added in 7.23.0)
  308. .SH "CURLUcode"
  309. .IP "CURLUE_BAD_HANDLE (1)"
  310. An argument that should be a CURLU pointer was passed in as a NULL.
  311. .IP "CURLUE_BAD_PARTPOINTER (2)"
  312. A NULL pointer was passed to the 'part' argument of \fIcurl_url_get(3)\fP.
  313. .IP "CURLUE_MALFORMED_INPUT (3)"
  314. A malformed input was passed to a URL API function.
  315. .IP "CURLUE_BAD_PORT_NUMBER (4)"
  316. The port number was not a decimal number between 0 and 65535.
  317. .IP "CURLUE_UNSUPPORTED_SCHEME (5)"
  318. This libcurl build doesn't support the given URL scheme.
  319. .IP "CURLUE_URLDECODE (6)"
  320. URL decode error, most likely because of rubbish in the input.
  321. .IP "CURLUE_OUT_OF_MEMORY (7)"
  322. A memory function failed.
  323. .IP "CURLUE_USER_NOT_ALLOWED (8)"
  324. Credentials was passed in the URL when prohibited.
  325. .IP "CURLUE_UNKNOWN_PART (9)"
  326. An unknown part ID was passed to a URL API function.
  327. .IP "CURLUE_NO_SCHEME (10)"
  328. There is no scheme part in the URL.
  329. .IP "CURLUE_NO_USER (11)"
  330. There is no user part in the URL.
  331. .IP "CURLUE_NO_PASSWORD (12)"
  332. There is no password part in the URL.
  333. .IP "CURLUE_NO_OPTIONS (13)"
  334. There is no options part in the URL.
  335. .IP "CURLUE_NO_HOST (14)"
  336. There is no host part in the URL.
  337. .IP "CURLUE_NO_PORT (15)"
  338. There is no port part in the URL.
  339. .IP "CURLUE_NO_QUERY (16)"
  340. There is no query part in the URL.
  341. .IP "CURLUE_NO_FRAGMENT (17)"
  342. There is no fragment part in the URL.
  343. .SH "SEE ALSO"
  344. .BR curl_easy_strerror "(3), " curl_multi_strerror "(3), "
  345. .BR curl_share_strerror "(3), " CURLOPT_ERRORBUFFER "(3), "
  346. .BR CURLOPT_VERBOSE "(3), " CURLOPT_DEBUGFUNCTION "(3) "