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