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