libcurl-errors.3 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2010, 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 http://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. .\" * $Id$
  22. .\" **************************************************************************
  23. .\"
  24. .TH libcurl-errors 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl errors"
  25. .SH NAME
  26. libcurl-errors \- error codes in libcurl
  27. .SH DESCRIPTION
  28. This man page includes most, if not all, available error codes in libcurl.
  29. Why they occur and possibly what you can do to fix the problem are also included.
  30. .SH "CURLcode"
  31. Almost all "easy" interface functions return a CURLcode error code. No matter
  32. what, using the \fIcurl_easy_setopt(3)\fP option \fICURLOPT_ERRORBUFFER\fP is
  33. a good idea as it will give you a human readable error string that may offer
  34. more details about the cause of the error than just the error code.
  35. \fIcurl_easy_strerror(3)\fP can be called to get an error string from a
  36. given CURLcode number.
  37. CURLcode is one of the following:
  38. .IP "CURLE_OK (0)"
  39. All fine. Proceed as usual.
  40. .IP "CURLE_UNSUPPORTED_PROTOCOL (1)"
  41. The URL you passed to libcurl used a protocol that this libcurl does not
  42. support. The support might be a compile-time option that you didn't use, it
  43. can be a misspelled protocol string or just a protocol libcurl has no code
  44. for.
  45. .IP "CURLE_FAILED_INIT (2)"
  46. Very early initialization code failed. This is likely to be an internal error
  47. or problem.
  48. .IP "CURLE_URL_MALFORMAT (3)"
  49. The URL was not properly formatted.
  50. .IP "CURLE_COULDNT_RESOLVE_PROXY (5)"
  51. Couldn't resolve proxy. The given proxy host could not be resolved.
  52. .IP "CURLE_COULDNT_RESOLVE_HOST (6)"
  53. Couldn't resolve host. The given remote host was not resolved.
  54. .IP "CURLE_COULDNT_CONNECT (7)"
  55. Failed to connect() to host or proxy.
  56. .IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)"
  57. After connecting to a FTP server, libcurl expects to get a certain reply
  58. back. This error code implies that it got a strange or bad reply. The given
  59. remote server is probably not an OK FTP server.
  60. .IP "CURLE_REMOTE_ACCESS_DENIED (9)"
  61. We were denied access to the resource given in the URL. For FTP, this occurs
  62. while trying to change to the remote directory.
  63. .IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
  64. After having sent the FTP password to the server, libcurl expects a proper
  65. reply. This error code indicates that an unexpected code was returned.
  66. .IP "CURLE_FTP_WEIRD_PASV_REPLY (13)"
  67. libcurl failed to get a sensible result back from the server as a response to
  68. either a PASV or a EPSV command. The server is flawed.
  69. .IP "CURLE_FTP_WEIRD_227_FORMAT (14)"
  70. FTP servers return a 227-line as a response to a PASV command. If libcurl
  71. fails to parse that line, this return code is passed back.
  72. .IP "CURLE_FTP_PRET_FAILED (84)"
  73. The FTP server does not understand the PRET command at all or does not support
  74. the given argument. Be careful when using \fICURLOPT_CUSTOMREQUEST\fP, a
  75. custom LIST command will be sent with PRET CMD before PASV as well. (Added in
  76. 7.20.0)
  77. .IP "CURLE_FTP_CANT_GET_HOST (15)"
  78. An internal failure to lookup the host used for the new connection.
  79. .IP "CURLE_FTP_COULDNT_SET_TYPE (17)"
  80. Received an error when trying to set the transfer mode to binary or ASCII.
  81. .IP "CURLE_PARTIAL_FILE (18)"
  82. A file transfer was shorter or larger than expected. This happens when the
  83. server first reports an expected transfer size, and then delivers data that
  84. doesn't match the previously given size.
  85. .IP "CURLE_FTP_COULDNT_RETR_FILE (19)"
  86. This was either a weird reply to a 'RETR' command or a zero byte transfer
  87. complete.
  88. .IP "CURLE_QUOTE_ERROR (21)"
  89. When sending custom "QUOTE" commands to the remote server, one of the commands
  90. returned an error code that was 400 or higher (for FTP) or otherwise
  91. indicated unsuccessful completion of the command.
  92. .IP "CURLE_HTTP_RETURNED_ERROR (22)"
  93. This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server
  94. returns an error code that is >= 400.
  95. .IP "CURLE_WRITE_ERROR (23)"
  96. An error occurred when writing received data to a local file, or an error was
  97. returned to libcurl from a write callback.
  98. .IP "CURLE_UPLOAD_FAILED (25)"
  99. Failed starting the upload. For FTP, the server typically denied the STOR
  100. command. The error buffer usually contains the server's explanation for this.
  101. .IP "CURLE_READ_ERROR (26)"
  102. There was a problem reading a local file or an error returned by the read
  103. callback.
  104. .IP "CURLE_OUT_OF_MEMORY (27)"
  105. A memory allocation request failed. This is serious badness and
  106. things are severely screwed up if this ever occurs.
  107. .IP "CURLE_OPERATION_TIMEDOUT (28)"
  108. Operation timeout. The specified time-out period was reached according to the
  109. conditions.
  110. .IP "CURLE_FTP_PORT_FAILED (30)"
  111. The FTP PORT command returned error. This mostly happens when you haven't
  112. specified a good enough address for libcurl to use. See \fICURLOPT_FTPPORT\fP.
  113. .IP "CURLE_FTP_COULDNT_USE_REST (31)"
  114. The FTP REST command returned error. This should never happen if the server is
  115. sane.
  116. .IP "CURLE_RANGE_ERROR (33)"
  117. The server does not support or accept range requests.
  118. .IP "CURLE_HTTP_POST_ERROR (34)"
  119. This is an odd error that mainly occurs due to internal confusion.
  120. .IP "CURLE_SSL_CONNECT_ERROR (35)"
  121. A problem occurred somewhere in the SSL/TLS handshake. You really want the
  122. error buffer and read the message there as it pinpoints the problem slightly
  123. more. Could be certificates (file formats, paths, permissions), passwords, and
  124. others.
  125. .IP "CURLE_BAD_DOWNLOAD_RESUME (36)"
  126. The download could not be resumed because the specified offset was out of the
  127. file boundary.
  128. .IP "CURLE_FILE_COULDNT_READ_FILE (37)"
  129. A file given with FILE:// couldn't be opened. Most likely because the file
  130. path doesn't identify an existing file. Did you check file permissions?
  131. .IP "CURLE_LDAP_CANNOT_BIND (38)"
  132. LDAP cannot bind. LDAP bind operation failed.
  133. .IP "CURLE_LDAP_SEARCH_FAILED (39)"
  134. LDAP search failed.
  135. .IP "CURLE_FUNCTION_NOT_FOUND (41)"
  136. Function not found. A required zlib function was not found.
  137. .IP "CURLE_ABORTED_BY_CALLBACK (42)"
  138. Aborted by callback. A callback returned "abort" to libcurl.
  139. .IP "CURLE_BAD_FUNCTION_ARGUMENT (43)"
  140. Internal error. A function was called with a bad parameter.
  141. .IP "CURLE_INTERFACE_FAILED (45)"
  142. Interface error. A specified outgoing interface could not be used. Set which
  143. interface to use for outgoing connections' source IP address with
  144. CURLOPT_INTERFACE.
  145. .IP "CURLE_TOO_MANY_REDIRECTS (47)"
  146. Too many redirects. When following redirects, libcurl hit the maximum amount.
  147. Set your limit with CURLOPT_MAXREDIRS.
  148. .IP "CURLE_UNKNOWN_TELNET_OPTION (48)"
  149. An option set with CURLOPT_TELNETOPTIONS was not recognized/known. Refer to
  150. the appropriate documentation.
  151. .IP "CURLE_TELNET_OPTION_SYNTAX (49)"
  152. A telnet option string was Illegally formatted.
  153. .IP "CURLE_PEER_FAILED_VERIFICATION (51)"
  154. The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK.
  155. .IP "CURLE_GOT_NOTHING (52)"
  156. Nothing was returned from the server, and under the circumstances, getting
  157. nothing is considered an error.
  158. .IP "CURLE_SSL_ENGINE_NOTFOUND (53)"
  159. The specified crypto engine wasn't found.
  160. .IP "CURLE_SSL_ENGINE_SETFAILED (54)"
  161. Failed setting the selected SSL crypto engine as default!
  162. .IP "CURLE_SEND_ERROR (55)"
  163. Failed sending network data.
  164. .IP "CURLE_RECV_ERROR (56)"
  165. Failure with receiving network data.
  166. .IP "CURLE_SSL_CERTPROBLEM (58)"
  167. problem with the local client certificate.
  168. .IP "CURLE_SSL_CIPHER (59)"
  169. Couldn't use specified cipher.
  170. .IP "CURLE_SSL_CACERT (60)"
  171. Peer certificate cannot be authenticated with known CA certificates.
  172. .IP "CURLE_BAD_CONTENT_ENCODING (61)"
  173. Unrecognized transfer encoding.
  174. .IP "CURLE_LDAP_INVALID_URL (62)"
  175. Invalid LDAP URL.
  176. .IP "CURLE_FILESIZE_EXCEEDED (63)"
  177. Maximum file size exceeded.
  178. .IP "CURLE_USE_SSL_FAILED (64)"
  179. Requested FTP SSL level failed.
  180. .IP "CURLE_SEND_FAIL_REWIND (65)"
  181. When doing a send operation curl had to rewind the data to retransmit, but the
  182. rewinding operation failed.
  183. .IP "CURLE_SSL_ENGINE_INITFAILED (66)"
  184. Initiating the SSL Engine failed.
  185. .IP "CURLE_LOGIN_DENIED (67)"
  186. The remote server denied curl to login (Added in 7.13.1)
  187. .IP "CURLE_TFTP_NOTFOUND (68)"
  188. File not found on TFTP server.
  189. .IP "CURLE_TFTP_PERM (69)"
  190. Permission problem on TFTP server.
  191. .IP "CURLE_REMOTE_DISK_FULL (70)"
  192. Out of disk space on the server.
  193. .IP "CURLE_TFTP_ILLEGAL (71)"
  194. Illegal TFTP operation.
  195. .IP "CURLE_TFTP_UNKNOWNID (72)"
  196. Unknown TFTP transfer ID.
  197. .IP "CURLE_REMOTE_FILE_EXISTS (73)"
  198. File already exists and will not be overwritten.
  199. .IP "CURLE_TFTP_NOSUCHUSER (74)"
  200. This error should never be returned by a properly functioning TFTP server.
  201. .IP "CURLE_CONV_FAILED (75)"
  202. Character conversion failed.
  203. .IP "CURLE_CONV_REQD (76)"
  204. Caller must register conversion callbacks.
  205. .IP "CURLE_SSL_CACERT_BADFILE (77)"
  206. Problem with reading the SSL CA cert (path? access rights?)
  207. .IP "CURLE_REMOTE_FILE_NOT_FOUND (78)"
  208. The resource referenced in the URL does not exist.
  209. .IP "CURLE_SSH (79)"
  210. An unspecified error occurred during the SSH session.
  211. .IP "CURLE_SSL_SHUTDOWN_FAILED (80)"
  212. Failed to shut down the SSL connection.
  213. .IP "CURLE_AGAIN (81)"
  214. Socket is not ready for send/recv wait till it's ready and try again. This
  215. return code is only returned from \fIcurl_easy_recv(3)\fP and
  216. \fIcurl_easy_send(3)\fP (Added in 7.18.2)
  217. .IP "CURLE_SSL_CRL_BADFILE (82)"
  218. Failed to load CRL file (Added in 7.19.0)
  219. .IP "CURLE_SSL_ISSUER_ERROR (83)"
  220. Issuer check failed (Added in 7.19.0)
  221. .IP "CURLE_OBSOLETE*"
  222. These error codes will never be returned. They were used in an old libcurl
  223. version and are currently unused.
  224. .SH "CURLMcode"
  225. This is the generic return code used by functions in the libcurl multi
  226. interface. Also consider \fIcurl_multi_strerror(3)\fP.
  227. .IP "CURLM_CALL_MULTI_PERFORM (-1)"
  228. This is not really an error. It means you should call
  229. \fIcurl_multi_perform(3)\fP again without doing select() or similar in between.
  230. .IP "CURLM_OK (0)"
  231. Things are fine.
  232. .IP "CURLM_BAD_HANDLE (1)"
  233. The passed-in handle is not a valid CURLM handle.
  234. .IP "CURLM_BAD_EASY_HANDLE (2)"
  235. An easy handle was not good/valid. It could mean that it isn't an easy handle
  236. at all, or possibly that the handle already is in used by this or another
  237. multi handle.
  238. .IP "CURLM_OUT_OF_MEMORY (3)"
  239. You are doomed.
  240. .IP "CURLM_INTERNAL_ERROR (4)"
  241. This can only be returned if libcurl bugs. Please report it to us!
  242. .IP "CURLM_BAD_SOCKET (5)"
  243. The passed-in socket is not a valid one that libcurl already knows about.
  244. (Added in 7.15.4)
  245. .IP "CURLM_UNKNOWN_OPTION (6)"
  246. curl_multi_setopt() with unsupported option
  247. (Added in 7.15.4)
  248. .SH "CURLSHcode"
  249. The "share" interface will return a CURLSHcode to indicate when an error has
  250. occurred. Also consider \fIcurl_share_strerror(3)\fP.
  251. .IP "CURLSHE_OK (0)"
  252. All fine. Proceed as usual.
  253. .IP "CURLSHE_BAD_OPTION (1)"
  254. An invalid option was passed to the function.
  255. .IP "CURLSHE_IN_USE (2)"
  256. The share object is currently in use.
  257. .IP "CURLSHE_INVALID (3)"
  258. An invalid share object was passed to the function.
  259. .IP "CURLSHE_NOMEM (4)"
  260. Not enough memory was available.
  261. (Added in 7.12.0)