• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: libcurl-errors
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_DEBUGFUNCTION (3)
9  - CURLOPT_ERRORBUFFER (3)
10  - CURLOPT_VERBOSE (3)
11  - curl_easy_strerror (3)
12  - curl_multi_strerror (3)
13  - curl_share_strerror (3)
14  - curl_url_strerror (3)
15---
16
17# NAME
18
19libcurl-errors - error codes in libcurl
20
21# DESCRIPTION
22
23This man page includes most, if not all, available error codes in libcurl.
24Why they occur and possibly what you can do to fix the problem are also included.
25
26# CURLcode
27
28Almost all "easy" interface functions return a CURLcode error code. No matter
29what, using the curl_easy_setopt(3) option CURLOPT_ERRORBUFFER(3)
30is a good idea as it gives you a human readable error string that may offer
31more details about the cause of the error than just the error code.
32curl_easy_strerror(3) can be called to get an error string from a given
33CURLcode number.
34
35CURLcode is one of the following:
36
37## CURLE_OK (0)
38
39All fine. Proceed as usual.
40
41## CURLE_UNSUPPORTED_PROTOCOL (1)
42
43The URL you passed to libcurl used a protocol that this libcurl does not
44support. The support might be a compile-time option that you did not use, it
45can be a misspelled protocol string or just a protocol libcurl has no code
46for.
47
48## CURLE_FAILED_INIT (2)
49
50Early initialization code failed. This is likely to be an internal error or
51problem, or a resource problem where something fundamental could not get done
52at init time.
53
54## CURLE_URL_MALFORMAT (3)
55
56The URL was not properly formatted.
57
58## CURLE_NOT_BUILT_IN (4)
59
60A requested feature, protocol or option was not found built-in in this libcurl
61due to a build-time decision. This means that a feature or option was not
62enabled or explicitly disabled when libcurl was built and in order to get it
63to function you have to get a rebuilt libcurl.
64
65## CURLE_COULDNT_RESOLVE_PROXY (5)
66
67Could not resolve proxy. The given proxy host could not be resolved.
68
69## CURLE_COULDNT_RESOLVE_HOST (6)
70
71Could not resolve host. The given remote host was not resolved.
72
73## CURLE_COULDNT_CONNECT (7)
74
75Failed to connect() to host or proxy.
76
77## CURLE_WEIRD_SERVER_REPLY (8)
78
79The server sent data libcurl could not parse. This error code was known as
80*CURLE_FTP_WEIRD_SERVER_REPLY* before 7.51.0.
81
82## CURLE_REMOTE_ACCESS_DENIED (9)
83
84We were denied access to the resource given in the URL. For FTP, this occurs
85while trying to change to the remote directory.
86
87## CURLE_FTP_ACCEPT_FAILED (10)
88
89While waiting for the server to connect back when an active FTP session is
90used, an error code was sent over the control connection or similar.
91
92## CURLE_FTP_WEIRD_PASS_REPLY (11)
93
94After having sent the FTP password to the server, libcurl expects a proper
95reply. This error code indicates that an unexpected code was returned.
96
97## CURLE_FTP_ACCEPT_TIMEOUT (12)
98
99During an active FTP session while waiting for the server to connect, the
100CURLOPT_ACCEPTTIMEOUT_MS(3) (or the internal default) timeout expired.
101
102## CURLE_FTP_WEIRD_PASV_REPLY (13)
103
104libcurl failed to get a sensible result back from the server as a response to
105either a PASV or a EPSV command. The server is flawed.
106
107## CURLE_FTP_WEIRD_227_FORMAT (14)
108
109FTP servers return a 227-line as a response to a PASV command. If libcurl
110fails to parse that line, this return code is passed back.
111
112## CURLE_FTP_CANT_GET_HOST (15)
113
114An internal failure to lookup the host used for the new connection.
115
116## CURLE_HTTP2 (16)
117
118A problem was detected in the HTTP2 framing layer. This is somewhat generic
119and can be one out of several problems, see the error buffer for details.
120
121## CURLE_FTP_COULDNT_SET_TYPE (17)
122
123Received an error when trying to set the transfer mode to binary or ASCII.
124
125## CURLE_PARTIAL_FILE (18)
126
127A file transfer was shorter or larger than expected. This happens when the
128server first reports an expected transfer size, and then delivers data that
129does not match the previously given size.
130
131## CURLE_FTP_COULDNT_RETR_FILE (19)
132
133This was either a weird reply to a 'RETR' command or a zero byte transfer
134complete.
135
136## Obsolete error (20)
137
138Not used in modern versions.
139
140## CURLE_QUOTE_ERROR (21)
141
142When sending custom "QUOTE" commands to the remote server, one of the commands
143returned an error code that was 400 or higher (for FTP) or otherwise
144indicated unsuccessful completion of the command.
145
146## CURLE_HTTP_RETURNED_ERROR (22)
147
148This is returned if CURLOPT_FAILONERROR(3) is set TRUE and the HTTP
149server returns an error code that is >= 400.
150
151## CURLE_WRITE_ERROR (23)
152
153An error occurred when writing received data to a local file, or an error was
154returned to libcurl from a write callback.
155
156## Obsolete error (24)
157
158Not used in modern versions.
159
160## CURLE_UPLOAD_FAILED (25)
161
162Failed starting the upload. For FTP, the server typically denied the STOR
163command. The error buffer usually contains the server's explanation for this.
164
165## CURLE_READ_ERROR (26)
166
167There was a problem reading a local file or an error returned by the read
168callback.
169
170## CURLE_OUT_OF_MEMORY (27)
171
172A memory allocation request failed. This is serious badness and
173things are severely screwed up if this ever occurs.
174
175## CURLE_OPERATION_TIMEDOUT (28)
176
177Operation timeout. The specified time-out period was reached according to the
178conditions.
179
180## Obsolete error (29)
181
182Not used in modern versions.
183
184## CURLE_FTP_PORT_FAILED (30)
185
186The FTP PORT command returned error. This mostly happens when you have not
187specified a good enough address for libcurl to use. See
188CURLOPT_FTPPORT(3).
189
190## CURLE_FTP_COULDNT_USE_REST (31)
191
192The FTP REST command returned error. This should never happen if the server is
193sane.
194
195## Obsolete error (32)
196
197Not used in modern versions.
198
199## CURLE_RANGE_ERROR (33)
200
201The server does not support or accept range requests.
202
203## CURLE_HTTP_POST_ERROR (34)
204
205This is an odd error that mainly occurs due to internal confusion.
206
207## CURLE_SSL_CONNECT_ERROR (35)
208
209A problem occurred somewhere in the SSL/TLS handshake. You really want the
210error buffer and read the message there as it pinpoints the problem slightly
211more. Could be certificates (file formats, paths, permissions), passwords, and
212others.
213
214## CURLE_BAD_DOWNLOAD_RESUME (36)
215
216The download could not be resumed because the specified offset was out of the
217file boundary.
218
219## CURLE_FILE_COULDNT_READ_FILE (37)
220
221A file given with FILE:// could not be opened. Most likely because the file
222path does not identify an existing file. Did you check file permissions?
223
224## CURLE_LDAP_CANNOT_BIND (38)
225
226LDAP cannot bind. LDAP bind operation failed.
227
228## CURLE_LDAP_SEARCH_FAILED (39)
229
230LDAP search failed.
231
232## Obsolete error (40)
233
234Not used in modern versions.
235
236## CURLE_FUNCTION_NOT_FOUND (41)
237
238Function not found. A required zlib function was not found.
239
240## CURLE_ABORTED_BY_CALLBACK (42)
241
242Aborted by callback. A callback returned "abort" to libcurl.
243
244## CURLE_BAD_FUNCTION_ARGUMENT (43)
245
246A function was called with a bad parameter.
247
248## Obsolete error (44)
249
250Not used in modern versions.
251
252## CURLE_INTERFACE_FAILED (45)
253
254Interface error. A specified outgoing interface could not be used. Set which
255interface to use for outgoing connections' source IP address with
256CURLOPT_INTERFACE(3).
257
258## Obsolete error (46)
259
260Not used in modern versions.
261
262## CURLE_TOO_MANY_REDIRECTS (47)
263
264Too many redirects. When following redirects, libcurl hit the maximum amount.
265Set your limit with CURLOPT_MAXREDIRS(3).
266
267## CURLE_UNKNOWN_OPTION (48)
268
269An option passed to libcurl is not recognized/known. Refer to the appropriate
270documentation. This is most likely a problem in the program that uses
271libcurl. The error buffer might contain more specific information about which
272exact option it concerns.
273
274## CURLE_SETOPT_OPTION_SYNTAX (49)
275
276An option passed in to a setopt was wrongly formatted. See error message for
277details about what option.
278
279## Obsolete errors (50-51)
280
281Not used in modern versions.
282
283## CURLE_GOT_NOTHING (52)
284
285Nothing was returned from the server, and under the circumstances, getting
286nothing is considered an error.
287
288## CURLE_SSL_ENGINE_NOTFOUND (53)
289
290The specified crypto engine was not found.
291
292## CURLE_SSL_ENGINE_SETFAILED (54)
293
294Failed setting the selected SSL crypto engine as default.
295
296## CURLE_SEND_ERROR (55)
297
298Failed sending network data.
299
300## CURLE_RECV_ERROR (56)
301
302Failure with receiving network data.
303
304## Obsolete error (57)
305
306Not used in modern versions.
307
308## CURLE_SSL_CERTPROBLEM (58)
309
310problem with the local client certificate.
311
312## CURLE_SSL_CIPHER (59)
313
314Could not use specified cipher.
315
316## CURLE_PEER_FAILED_VERIFICATION (60)
317
318The remote server's SSL certificate or SSH fingerprint was deemed not OK.
319This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its
320previous value was 51.
321
322## CURLE_BAD_CONTENT_ENCODING (61)
323
324Unrecognized transfer encoding.
325
326## Obsolete error (62)
327
328Not used in modern versions.
329
330## CURLE_FILESIZE_EXCEEDED (63)
331
332Maximum file size exceeded.
333
334## CURLE_USE_SSL_FAILED (64)
335
336Requested FTP SSL level failed.
337
338## CURLE_SEND_FAIL_REWIND (65)
339
340When doing a send operation curl had to rewind the data to retransmit, but the
341rewinding operation failed.
342
343## CURLE_SSL_ENGINE_INITFAILED (66)
344
345Initiating the SSL Engine failed.
346
347## CURLE_LOGIN_DENIED (67)
348
349The remote server denied curl to login (Added in 7.13.1)
350
351## CURLE_TFTP_NOTFOUND (68)
352
353File not found on TFTP server.
354
355## CURLE_TFTP_PERM (69)
356
357Permission problem on TFTP server.
358
359## CURLE_REMOTE_DISK_FULL (70)
360
361Out of disk space on the server.
362
363## CURLE_TFTP_ILLEGAL (71)
364
365Illegal TFTP operation.
366
367## CURLE_TFTP_UNKNOWNID (72)
368
369Unknown TFTP transfer ID.
370
371## CURLE_REMOTE_FILE_EXISTS (73)
372
373File already exists and is not overwritten.
374
375## CURLE_TFTP_NOSUCHUSER (74)
376
377This error should never be returned by a properly functioning TFTP server.
378
379## Obsolete error (75-76)
380
381Not used in modern versions.
382
383## CURLE_SSL_CACERT_BADFILE (77)
384
385Problem with reading the SSL CA cert (path? access rights?)
386
387## CURLE_REMOTE_FILE_NOT_FOUND (78)
388
389The resource referenced in the URL does not exist.
390
391## CURLE_SSH (79)
392
393An unspecified error occurred during the SSH session.
394
395## CURLE_SSL_SHUTDOWN_FAILED (80)
396
397Failed to shut down the SSL connection.
398
399## CURLE_AGAIN (81)
400
401Socket is not ready for send/recv. Wait until it is ready and try again. This
402return code is only returned from curl_easy_recv(3) and curl_easy_send(3)
403(Added in 7.18.2)
404
405## CURLE_SSL_CRL_BADFILE (82)
406
407Failed to load CRL file (Added in 7.19.0)
408
409## CURLE_SSL_ISSUER_ERROR (83)
410
411Issuer check failed (Added in 7.19.0)
412
413## CURLE_FTP_PRET_FAILED (84)
414
415The FTP server does not understand the PRET command at all or does not support
416the given argument. Be careful when using CURLOPT_CUSTOMREQUEST(3), a
417custom LIST command is sent with the PRET command before PASV as well. (Added
418in 7.20.0)
419
420## CURLE_RTSP_CSEQ_ERROR (85)
421
422Mismatch of RTSP CSeq numbers.
423
424## CURLE_RTSP_SESSION_ERROR (86)
425
426Mismatch of RTSP Session Identifiers.
427
428## CURLE_FTP_BAD_FILE_LIST (87)
429
430Unable to parse FTP file list (during FTP wildcard downloading).
431
432## CURLE_CHUNK_FAILED (88)
433
434Chunk callback reported error.
435
436## CURLE_NO_CONNECTION_AVAILABLE (89)
437
438(For internal use only, is never returned by libcurl) No connection available,
439the session is queued. (added in 7.30.0)
440
441## CURLE_SSL_PINNEDPUBKEYNOTMATCH (90)
442
443Failed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY(3).
444
445## CURLE_SSL_INVALIDCERTSTATUS (91)
446
447Status returned failure when asked with CURLOPT_SSL_VERIFYSTATUS(3).
448
449## CURLE_HTTP2_STREAM (92)
450
451Stream error in the HTTP/2 framing layer.
452
453## CURLE_RECURSIVE_API_CALL (93)
454
455An API function was called from inside a callback.
456
457## CURLE_AUTH_ERROR (94)
458
459An authentication function returned an error.
460
461## CURLE_HTTP3 (95)
462
463A problem was detected in the HTTP/3 layer. This is somewhat generic and can
464be one out of several problems, see the error buffer for details.
465
466## CURLE_QUIC_CONNECT_ERROR (96)
467
468QUIC connection error. This error may be caused by an SSL library error. QUIC
469is the protocol used for HTTP/3 transfers.
470
471## CURLE_PROXY (97)
472
473Proxy handshake error. CURLINFO_PROXY_ERROR(3) provides extra details on
474the specific problem.
475
476## CURLE_SSL_CLIENTCERT (98)
477
478SSL Client Certificate required.
479
480## CURLE_UNRECOVERABLE_POLL (99)
481
482An internal call to poll() or select() returned error that is not recoverable.
483
484## CURLE_TOO_LARGE (100)
485
486A value or data field grew larger than allowed.
487
488# CURLMcode
489
490This is the generic return code used by functions in the libcurl multi
491interface. Also consider curl_multi_strerror(3).
492
493## CURLM_CALL_MULTI_PERFORM (-1)
494
495This is not really an error. It means you should call
496curl_multi_perform(3) again without doing select() or similar in
497between. Before version 7.20.0 (released on February 9 2010) this could be returned by
498curl_multi_perform(3), but in later versions this return code is never
499used.
500
501## CURLM_OK (0)
502
503Things are fine.
504
505## CURLM_BAD_HANDLE (1)
506
507The passed-in handle is not a valid *CURLM* handle.
508
509## CURLM_BAD_EASY_HANDLE (2)
510
511An easy handle was not good/valid. It could mean that it is not an easy handle
512at all, or possibly that the handle already is in use by this or another multi
513handle.
514
515## CURLM_OUT_OF_MEMORY (3)
516
517You are doomed.
518
519## CURLM_INTERNAL_ERROR (4)
520
521This can only be returned if libcurl bugs. Please report it to us!
522
523## CURLM_BAD_SOCKET (5)
524
525The passed-in socket is not a valid one that libcurl already knows about.
526(Added in 7.15.4)
527
528## CURLM_UNKNOWN_OPTION (6)
529
530curl_multi_setopt() with unsupported option
531(Added in 7.15.4)
532
533## CURLM_ADDED_ALREADY (7)
534
535An easy handle already added to a multi handle was attempted to get added a
536second time. (Added in 7.32.1)
537
538## CURLM_RECURSIVE_API_CALL (8)
539
540An API function was called from inside a callback.
541
542## CURLM_WAKEUP_FAILURE (9)
543
544Wake up is unavailable or failed.
545
546## CURLM_BAD_FUNCTION_ARGUMENT (10)
547
548A function was called with a bad parameter.
549
550## CURLM_ABORTED_BY_CALLBACK (11)
551
552A multi handle callback returned error.
553
554## CURLM_UNRECOVERABLE_POLL (12)
555
556An internal call to poll() or select() returned error that is not recoverable.
557
558# CURLSHcode
559
560The "share" interface returns a **CURLSHcode** to indicate when an error has
561occurred. Also consider curl_share_strerror(3).
562
563## CURLSHE_OK (0)
564
565All fine. Proceed as usual.
566
567## CURLSHE_BAD_OPTION (1)
568
569An invalid option was passed to the function.
570
571## CURLSHE_IN_USE (2)
572
573The share object is currently in use.
574
575## CURLSHE_INVALID (3)
576
577An invalid share object was passed to the function.
578
579## CURLSHE_NOMEM (4)
580
581Not enough memory was available.
582(Added in 7.12.0)
583
584## CURLSHE_NOT_BUILT_IN (5)
585
586The requested sharing could not be done because the library you use do not have
587that particular feature enabled. (Added in 7.23.0)
588
589# CURLUcode
590
591The URL interface returns a *CURLUcode* to indicate when an error has
592occurred. Also consider curl_url_strerror(3).
593
594## CURLUE_OK (0)
595
596All fine. Proceed as usual.
597
598## CURLUE_BAD_HANDLE (1)
599
600An invalid URL handle was passed as argument.
601
602## CURLUE_BAD_PARTPOINTER (2)
603
604An invalid 'part' argument was passed as argument.
605
606## CURLUE_MALFORMED_INPUT (3)
607
608A malformed input was passed to a URL API function.
609
610## CURLUE_BAD_PORT_NUMBER (4)
611
612The port number was not a decimal number between 0 and 65535.
613
614## CURLUE_UNSUPPORTED_SCHEME (5)
615
616This libcurl build does not support the given URL scheme.
617
618## CURLUE_URLDECODE (6)
619
620URL decode error, most likely because of rubbish in the input.
621
622## CURLUE_OUT_OF_MEMORY (7)
623
624A memory function failed.
625
626## CURLUE_USER_NOT_ALLOWED (8)
627
628Credentials was passed in the URL when prohibited.
629
630## CURLUE_UNKNOWN_PART (9)
631
632An unknown part ID was passed to a URL API function.
633
634## CURLUE_NO_SCHEME (10)
635
636There is no scheme part in the URL.
637
638## CURLUE_NO_USER (11)
639
640There is no user part in the URL.
641
642## CURLUE_NO_PASSWORD (12)
643
644There is no password part in the URL.
645
646## CURLUE_NO_OPTIONS (13)
647
648There is no options part in the URL.
649
650## CURLUE_NO_HOST (14)
651
652There is no host part in the URL.
653
654## CURLUE_NO_PORT (15)
655
656There is no port part in the URL.
657
658## CURLUE_NO_QUERY (16)
659
660There is no query part in the URL.
661
662## CURLUE_NO_FRAGMENT (17)
663
664There is no fragment part in the URL.
665
666## CURLUE_NO_ZONEID (18)
667
668There is no zone id set in the URL.
669
670## CURLUE_BAD_FILE_URL (19)
671
672The file:// URL is invalid.
673
674## CURLUE_BAD_FRAGMENT (20)
675
676The fragment part of the URL contained bad or invalid characters.
677
678## CURLUE_BAD_HOSTNAME (21)
679
680The hostname contained bad or invalid characters.
681
682## CURLUE_BAD_IPV6 (22)
683
684The IPv6 address hostname contained bad or invalid characters.
685
686## CURLUE_BAD_LOGIN (23)
687
688The login part of the URL contained bad or invalid characters.
689
690## CURLUE_BAD_PASSWORD (24)
691
692The password part of the URL contained bad or invalid characters.
693
694## CURLUE_BAD_PATH (25)
695
696The path part of the URL contained bad or invalid characters.
697
698## CURLUE_BAD_QUERY (26)
699
700The query part of the URL contained bad or invalid characters.
701
702## CURLUE_BAD_SCHEME (27)
703
704The scheme part of the URL contained bad or invalid characters.
705
706## CURLUE_BAD_SLASHES (28)
707
708The URL contained an invalid number of slashes.
709
710## CURLUE_BAD_USER (29)
711
712The user part of the URL contained bad or invalid characters.
713
714## CURLUE_LACKS_IDN (30)
715
716libcurl lacks IDN support.
717
718## CURLUE_TOO_LARGE (31)
719
720A value or data field is larger than allowed.
721
722# CURLHcode
723
724The header interface returns a *CURLHcode* to indicate when an error has
725occurred.
726
727## CURLHE_OK (0)
728
729All fine. Proceed as usual.
730
731## CURLHE_BADINDEX (1)
732
733There is no header with the requested index.
734
735## CURLHE_MISSING (2)
736
737No such header exists.
738
739## CURLHE_NOHEADERS (3)
740
741No headers at all have been recorded.
742
743## CURLHE_NOREQUEST (4)
744
745There was no such request number.
746
747## CURLHE_OUT_OF_MEMORY (5)
748
749Out of resources
750
751## CURLHE_BAD_ARGUMENT (6)
752
753One or more of the given arguments are bad.
754
755## CURLHE_NOT_BUILT_IN (7)
756
757HTTP support or the header API has been disabled in the build.
758