2017-05-26 04:48:44 +08:00
/*
* error_definitions . h
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013 - 2018 Apple Inc . and the FoundationDB project authors
2018-02-22 02:25:11 +08:00
*
2017-05-26 04:48:44 +08:00
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
2018-02-22 02:25:11 +08:00
*
2017-05-26 04:48:44 +08:00
* http : //www.apache.org/licenses/LICENSE-2.0
2018-02-22 02:25:11 +08:00
*
2017-05-26 04:48:44 +08:00
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS ,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
*/
# ifdef ERROR
// SOMEDAY: Split this into flow, fdbclient, fdbserver error headers?
// Error codes defined here are primarily for programmatic use, not debugging: a separate
// error should be defined if and only if there is a sensible situation in which code could
// catch and react specifically to that error. So for example there is only one
// internal_error code even though there are a huge number of internal errors; extra
// information is logged in the trace file.
// 1xxx Normal failure (plausibly these should not even be "errors", but they are failures of
// the way operations are currently defined)
2020-07-18 05:10:17 +08:00
// clang-format off
2017-05-26 04:48:44 +08:00
ERROR ( success , 0 , " Success " )
ERROR ( end_of_stream , 1 , " End of stream " )
ERROR ( operation_failed , 1000 , " Operation failed " )
ERROR ( wrong_shard_server , 1001 , " Shard is not available from this server " )
2019-10-15 09:05:06 +08:00
ERROR ( operation_obsolete , 1002 , " Operation result no longer necessary " )
2020-02-06 06:59:55 +08:00
ERROR ( cold_cache_server , 1003 , " Cache server is not warm for this range " )
2017-05-26 04:48:44 +08:00
ERROR ( timed_out , 1004 , " Operation timed out " )
2017-09-29 03:35:03 +08:00
ERROR ( coordinated_state_conflict , 1005 , " Conflict occurred while changing coordination information " )
2017-05-26 04:48:44 +08:00
ERROR ( all_alternatives_failed , 1006 , " All alternatives failed " )
2017-10-18 23:49:17 +08:00
ERROR ( transaction_too_old , 1007 , " Transaction is too old to perform reads or be committed " )
2017-05-26 04:48:44 +08:00
ERROR ( no_more_servers , 1008 , " Not enough physical servers available " )
ERROR ( future_version , 1009 , " Request for future version " )
ERROR ( movekeys_conflict , 1010 , " Conflicting attempts to change data distribution " )
ERROR ( tlog_stopped , 1011 , " TLog stopped " )
2017-09-29 03:35:03 +08:00
ERROR ( server_request_queue_full , 1012 , " Server request queue is full " )
ERROR ( not_committed , 1020 , " Transaction not committed due to conflict with another transaction " )
2017-05-26 04:48:44 +08:00
ERROR ( commit_unknown_result , 1021 , " Transaction may or may not have committed " )
ERROR ( transaction_cancelled , 1025 , " Operation aborted because the transaction was cancelled " )
ERROR ( connection_failed , 1026 , " Network connection failed " )
2017-09-29 03:35:03 +08:00
ERROR ( coordinators_changed , 1027 , " Coordination servers have changed " )
ERROR ( new_coordinators_timed_out , 1028 , " New coordination servers did not respond in a timely way " )
ERROR ( watch_cancelled , 1029 , " Watch cancelled because storage server watch limit exceeded " )
ERROR ( request_maybe_delivered , 1030 , " Request may or may not have been delivered " )
2017-05-26 04:48:44 +08:00
ERROR ( transaction_timed_out , 1031 , " Operation aborted because the transaction timed out " )
ERROR ( too_many_watches , 1032 , " Too many watches currently set " )
2017-09-29 03:35:03 +08:00
ERROR ( locality_information_unavailable , 1033 , " Locality information not available " )
ERROR ( watches_disabled , 1034 , " Watches cannot be set if read your writes is disabled " )
ERROR ( default_error_or , 1035 , " Default error for an ErrorOr object " )
2017-05-26 04:48:44 +08:00
ERROR ( accessed_unreadable , 1036 , " Read or wrote an unreadable key " )
2017-09-29 03:35:03 +08:00
ERROR ( process_behind , 1037 , " Storage process does not have recent mutations " )
ERROR ( database_locked , 1038 , " Database is locked " )
2018-01-05 07:06:09 +08:00
ERROR ( cluster_version_changed , 1039 , " The protocol version of the cluster has changed " )
2017-09-29 03:35:03 +08:00
ERROR ( external_client_already_loaded , 1040 , " External client has already been loaded " )
2017-10-16 12:51:11 +08:00
ERROR ( lookup_failed , 1041 , " DNS lookup failed " )
2020-09-11 08:44:15 +08:00
ERROR ( proxy_memory_limit_exceeded , 1042 , " CommitProxy commit memory limit exceeded " )
2019-04-11 08:41:02 +08:00
ERROR ( shutdown_in_progress , 1043 , " Operation no longer supported due to shutdown " )
ERROR ( serialization_failed , 1044 , " Failed to deserialize an object " )
2019-05-21 02:54:46 +08:00
ERROR ( connection_unreferenced , 1048 , " No peer references for connection " )
2019-06-28 15:39:51 +08:00
ERROR ( connection_idle , 1049 , " Connection closed after idle timeout " )
2019-07-31 01:14:39 +08:00
ERROR ( disk_adapter_reset , 1050 , " The disk queue adpater reset " )
2020-05-27 06:27:06 +08:00
ERROR ( batch_transaction_throttled , 1051 , " Batch GRV request rate limit exceeded " )
2020-07-18 02:11:30 +08:00
ERROR ( dd_cancelled , 1052 , " Data distribution components cancelled " )
2020-08-15 00:40:16 +08:00
ERROR ( dd_not_found , 1053 , " Data distributor not found " )
2021-03-31 00:31:10 +08:00
ERROR ( wrong_connection_file , 1054 , " Connection file mismatch " )
2021-06-02 06:39:34 +08:00
ERROR ( version_already_compacted , 1055 , " The requested changes have been compacted away " )
ERROR ( local_config_changed , 1056 , " Local configuration file has changed. Restart and apply these changes " )
2017-05-26 04:48:44 +08:00
ERROR ( broken_promise , 1100 , " Broken promise " )
ERROR ( operation_cancelled , 1101 , " Asynchronous operation cancelled " )
2017-09-29 03:35:03 +08:00
ERROR ( future_released , 1102 , " Future has been released " )
ERROR ( connection_leaked , 1103 , " Connection object leaked " )
2017-05-26 04:48:44 +08:00
ERROR ( recruitment_failed , 1200 , " Recruitment of a server failed " ) // Be careful, catching this will delete the data of a storage server or tlog permanently
ERROR ( move_to_removed_server , 1201 , " Attempt to move keys to a storage server that was removed " )
ERROR ( worker_removed , 1202 , " Normal worker shut down " ) // Be careful, catching this will delete the data of a storage server or tlog permanently
ERROR ( master_recovery_failed , 1203 , " Master recovery failed " )
ERROR ( master_max_versions_in_flight , 1204 , " Master hit maximum number of versions in flight " )
ERROR ( master_tlog_failed , 1205 , " Master terminating because a TLog failed " ) // similar to tlog_stopped, but the tlog has actually died
ERROR ( worker_recovery_failed , 1206 , " Recovery of a worker process failed " )
ERROR ( please_reboot , 1207 , " Reboot of server process requested " )
ERROR ( please_reboot_delete , 1208 , " Reboot of server process requested, with deletion of state " )
2020-09-11 08:44:15 +08:00
ERROR ( commit_proxy_failed , 1209 , " Master terminating because a Commit CommitProxy failed " )
2017-05-26 04:48:44 +08:00
ERROR ( master_resolver_failed , 1210 , " Master terminating because a Resolver failed " )
2019-01-26 05:15:19 +08:00
ERROR ( server_overloaded , 1211 , " Server is under too much load and cannot respond " )
2019-05-21 05:22:31 +08:00
ERROR ( master_backup_worker_failed , 1212 , " Master terminating because a backup worker failed " )
2020-03-21 02:23:11 +08:00
ERROR ( tag_throttled , 1213 , " Transaction tag is being throttled " )
2020-09-11 08:44:15 +08:00
ERROR ( grv_proxy_failed , 1214 , " Master terminating because a GRV CommitProxy failed " )
2020-11-24 06:51:40 +08:00
ERROR ( dd_tracker_cancelled , 1215 , " The data distribution tracker has been cancelled " )
2017-05-26 04:48:44 +08:00
// 15xx Platform errors
2017-09-29 03:35:03 +08:00
ERROR ( platform_error , 1500 , " Platform error " )
2017-05-26 04:48:44 +08:00
ERROR ( large_alloc_failed , 1501 , " Large block allocation failed " )
2017-09-29 03:35:03 +08:00
ERROR ( performance_counter_error , 1502 , " QueryPerformanceCounter error " )
2017-05-26 04:48:44 +08:00
2017-09-29 03:35:03 +08:00
ERROR ( io_error , 1510 , " Disk i/o operation failed " )
2017-05-26 04:48:44 +08:00
ERROR ( file_not_found , 1511 , " File not found " )
ERROR ( bind_failed , 1512 , " Unable to bind to network " )
2017-09-29 04:03:17 +08:00
ERROR ( file_not_readable , 1513 , " File could not be read " )
ERROR ( file_not_writable , 1514 , " File could not be written " )
2017-05-26 04:48:44 +08:00
ERROR ( no_cluster_file_found , 1515 , " No cluster file found in current directory or default location " )
ERROR ( file_too_large , 1516 , " File too large to be read " )
2017-09-29 03:35:03 +08:00
ERROR ( non_sequential_op , 1517 , " Non sequential file operation not allowed " )
2017-10-21 03:56:00 +08:00
ERROR ( http_bad_response , 1518 , " HTTP response was badly formed " )
2017-09-29 03:35:03 +08:00
ERROR ( http_not_accepted , 1519 , " HTTP request not accepted " )
2017-10-21 03:56:00 +08:00
ERROR ( checksum_failed , 1520 , " A data checksum failed " )
ERROR ( io_timeout , 1521 , " A disk IO operation failed to complete in a timely manner " )
ERROR ( file_corrupt , 1522 , " A structurally corrupt data file was detected " )
2018-07-10 09:58:33 +08:00
ERROR ( http_request_failed , 1523 , " HTTP response code not received or indicated failure " )
2018-01-23 06:58:56 +08:00
ERROR ( http_auth_failed , 1524 , " HTTP request failed due to bad credentials " )
2019-01-08 09:56:38 +08:00
ERROR ( http_bad_request_id , 1525 , " HTTP response contained an unexpected X-Request-ID header " )
2017-05-26 04:48:44 +08:00
// 2xxx Attempt (presumably by a _client_) to do something illegal. If an error is known to
// be internally caused, it should be 41xx
2017-09-29 03:35:03 +08:00
ERROR ( client_invalid_operation , 2000 , " Invalid API call " )
2017-05-26 04:48:44 +08:00
ERROR ( commit_read_incomplete , 2002 , " Commit with incomplete read " )
2017-09-29 03:35:03 +08:00
ERROR ( test_specification_invalid , 2003 , " Invalid test specification " )
ERROR ( key_outside_legal_range , 2004 , " Key outside legal range " )
ERROR ( inverted_range , 2005 , " Range begin key larger than end key " )
ERROR ( invalid_option_value , 2006 , " Option set with an invalid value " )
2017-05-26 04:48:44 +08:00
ERROR ( invalid_option , 2007 , " Option not valid in this context " )
ERROR ( network_not_setup , 2008 , " Action not possible before the network is configured " )
ERROR ( network_already_setup , 2009 , " Network can be configured only once " )
ERROR ( read_version_already_set , 2010 , " Transaction already has a read version set " )
ERROR ( version_invalid , 2011 , " Version not valid " )
2017-09-29 03:35:03 +08:00
ERROR ( range_limits_invalid , 2012 , " Range limits not valid " )
ERROR ( invalid_database_name , 2013 , " Database name must be 'DB' " )
2018-05-03 01:44:38 +08:00
ERROR ( attribute_not_found , 2014 , " Attribute not found " )
2017-09-29 03:35:03 +08:00
ERROR ( future_not_set , 2015 , " Future not ready " )
ERROR ( future_not_error , 2016 , " Future not an error " )
ERROR ( used_during_commit , 2017 , " Operation issued while a commit was outstanding " )
ERROR ( invalid_mutation_type , 2018 , " Unrecognized atomic mutation type " )
ERROR ( attribute_too_large , 2019 , " Attribute too large for type int " )
2017-05-26 04:48:44 +08:00
ERROR ( transaction_invalid_version , 2020 , " Transaction does not have a valid commit version " )
2017-09-29 07:35:08 +08:00
ERROR ( no_commit_version , 2021 , " Transaction is read-only and therefore does not have a commit version " )
2017-05-26 04:48:44 +08:00
ERROR ( environment_variable_network_option_failed , 2022 , " Environment variable network option could not be set " )
2017-09-29 07:35:08 +08:00
ERROR ( transaction_read_only , 2023 , " Attempted to commit a transaction specified as read-only " )
2019-05-06 16:11:46 +08:00
ERROR ( invalid_cache_eviction_policy , 2024 , " Invalid cache eviction policy, only random and lru are supported " )
2020-05-23 04:31:06 +08:00
ERROR ( network_cannot_be_restarted , 2025 , " Network can only be started once " )
2020-09-25 08:11:26 +08:00
ERROR ( blocked_from_network_thread , 2026 , " Detected a deadlock in a callback called from the network thread " )
2021-05-29 18:58:18 +08:00
ERROR ( invalid_config_db_range_read , 2027 , " Invalid configuration database range read " )
2021-06-03 12:36:34 +08:00
ERROR ( invalid_config_db_key , 2028 , " Invalid configuration database key provided " )
2021-06-17 04:10:14 +08:00
ERROR ( invalid_config_path , 2029 , " Invalid configuration path " )
2017-05-26 04:48:44 +08:00
ERROR ( incompatible_protocol_version , 2100 , " Incompatible protocol version " )
2017-09-29 03:35:03 +08:00
ERROR ( transaction_too_large , 2101 , " Transaction exceeds byte limit " )
ERROR ( key_too_large , 2102 , " Key length exceeds limit " )
ERROR ( value_too_large , 2103 , " Value length exceeds limit " )
2017-05-26 04:48:44 +08:00
ERROR ( connection_string_invalid , 2104 , " Connection string invalid " )
ERROR ( address_in_use , 2105 , " Local address in use " )
ERROR ( invalid_local_address , 2106 , " Invalid local address " )
ERROR ( tls_error , 2107 , " TLS error " )
2017-09-29 04:03:17 +08:00
ERROR ( unsupported_operation , 2108 , " Operation is not supported " )
2020-04-10 07:55:56 +08:00
ERROR ( too_many_tags , 2109 , " Too many tags set on transaction " )
ERROR ( tag_too_long , 2110 , " Tag set on transaction is too long " )
2020-04-18 02:48:02 +08:00
ERROR ( too_many_tag_throttles , 2111 , " Too many tag throttles have been created " )
2020-05-10 06:34:20 +08:00
ERROR ( special_keys_cross_module_read , 2112 , " Special key space range read crosses modules. Refer to the `special_key_space_relaxed' transaction option for more details. " )
ERROR ( special_keys_no_module_found , 2113 , " Special key space range read does not intersect a module. Refer to the `special_key_space_relaxed' transaction option for more details. " )
2020-07-29 03:03:00 +08:00
ERROR ( special_keys_write_disabled , 2114 , " Special Key space is not allowed to write by default. Refer to the `special_key_space_enable_writes` transaction option for more details. " )
2020-07-09 06:49:34 +08:00
ERROR ( special_keys_no_write_module_found , 2115 , " Special key space key or keyrange in set or clear does not intersect a module " )
ERROR ( special_keys_cross_module_clear , 2116 , " Special key space clear crosses modules " )
2020-08-01 06:46:38 +08:00
ERROR ( special_keys_api_failure , 2117 , " Api call through special keys failed. For more information, call get on special key 0xff0xff/error_message to get a json string of the error message. " )
2017-05-26 04:48:44 +08:00
// 2200 - errors from bindings and official APIs
2017-09-29 03:35:03 +08:00
ERROR ( api_version_unset , 2200 , " API version is not set " )
2017-05-26 04:48:44 +08:00
ERROR ( api_version_already_set , 2201 , " API version may be set only once " )
ERROR ( api_version_invalid , 2202 , " API version not valid " )
2017-09-29 03:35:03 +08:00
ERROR ( api_version_not_supported , 2203 , " API version not supported " )
2017-05-26 04:48:44 +08:00
ERROR ( exact_mode_without_limits , 2210 , " EXACT streaming mode requires limits, but none were given " )
2017-09-29 03:35:03 +08:00
ERROR ( invalid_tuple_data_type , 2250 , " Unrecognized data type in packed tuple " )
2017-05-26 04:48:44 +08:00
ERROR ( invalid_tuple_index , 2251 , " Tuple does not have element at specified index " )
ERROR ( key_not_in_subspace , 2252 , " Cannot unpack key that is not in subspace " )
ERROR ( manual_prefixes_not_enabled , 2253 , " Cannot specify a prefix unless manual prefixes are enabled " )
ERROR ( prefix_in_partition , 2254 , " Cannot specify a prefix in a partition " )
2017-09-29 03:35:03 +08:00
ERROR ( cannot_open_root_directory , 2255 , " Root directory cannot be opened " )
ERROR ( directory_already_exists , 2256 , " Directory already exists " )
ERROR ( directory_does_not_exist , 2257 , " Directory does not exist " )
ERROR ( parent_directory_does_not_exist , 2258 , " Directory's parent does not exist " )
ERROR ( mismatched_layer , 2259 , " Directory has already been created with a different layer string " )
ERROR ( invalid_directory_layer_metadata , 2260 , " Invalid directory layer metadata " )
2017-05-26 04:48:44 +08:00
ERROR ( cannot_move_directory_between_partitions , 2261 , " Directory cannot be moved between partitions " )
ERROR ( cannot_use_partition_as_subspace , 2262 , " Directory partition cannot be used as subspace " )
ERROR ( incompatible_directory_version , 2263 , " Directory layer was created with an incompatible version " )
2017-09-29 03:35:03 +08:00
ERROR ( directory_prefix_not_empty , 2264 , " Database has keys stored at the prefix chosen by the automatic prefix allocator " )
ERROR ( directory_prefix_in_use , 2265 , " Directory layer already has a conflicting prefix " )
ERROR ( invalid_destination_directory , 2266 , " Target directory is invalid " )
ERROR ( cannot_modify_root_directory , 2267 , " Root directory cannot be modified " )
2017-05-27 03:33:33 +08:00
ERROR ( invalid_uuid_size , 2268 , " UUID is not sixteen bytes " ) ;
2017-05-26 04:48:44 +08:00
// 2300 - backup and restore errors
ERROR ( backup_error , 2300 , " Backup error " )
ERROR ( restore_error , 2301 , " Restore error " )
ERROR ( backup_duplicate , 2311 , " Backup duplicate request " )
ERROR ( backup_unneeded , 2312 , " Backup unneeded request " )
ERROR ( backup_bad_block_size , 2313 , " Backup file block size too small " )
2017-11-15 15:33:17 +08:00
ERROR ( backup_invalid_url , 2314 , " Backup Container URL invalid " )
2020-05-02 00:51:20 +08:00
ERROR ( backup_invalid_info , 2315 , " Backup Container info invalid " )
2018-01-17 20:09:43 +08:00
ERROR ( backup_cannot_expire , 2316 , " Cannot expire requested data from backup without violating minimum restorability " )
2018-02-08 13:50:43 +08:00
ERROR ( backup_auth_missing , 2317 , " Cannot find authentication details (such as a password or secret key) for the specified Backup Container URL " )
ERROR ( backup_auth_unreadable , 2318 , " Cannot read or parse one or more sources of authentication information for Backup Container URLs " )
2018-12-21 10:05:23 +08:00
ERROR ( backup_does_not_exist , 2319 , " Backup does not exist " )
2020-09-06 02:14:59 +08:00
ERROR ( backup_not_filterable_with_key_ranges , 2320 , " Backup before 6.3 cannot be filtered with key ranges " )
2020-09-06 09:55:09 +08:00
ERROR ( backup_not_overlapped_with_keys_filter , 2321 , " Backup key ranges doesn't overlap with key ranges filter " )
2017-05-26 04:48:44 +08:00
ERROR ( restore_invalid_version , 2361 , " Invalid restore version " )
2017-09-29 03:35:03 +08:00
ERROR ( restore_corrupted_data , 2362 , " Corrupted backup data " )
ERROR ( restore_missing_data , 2363 , " Missing backup data " )
2017-05-26 04:48:44 +08:00
ERROR ( restore_duplicate_tag , 2364 , " Restore duplicate request " )
ERROR ( restore_unknown_tag , 2365 , " Restore tag does not exist " )
2017-11-15 15:33:17 +08:00
ERROR ( restore_unknown_file_type , 2366 , " Unknown backup/restore file type " )
2017-09-29 03:35:03 +08:00
ERROR ( restore_unsupported_file_version , 2367 , " Unsupported backup file version " )
2017-05-26 04:48:44 +08:00
ERROR ( restore_bad_read , 2368 , " Unexpected number of bytes read " )
ERROR ( restore_corrupted_data_padding , 2369 , " Backup file has unexpected padding bytes " )
ERROR ( restore_destination_not_empty , 2370 , " Attempted to restore into a non-empty destination database " )
ERROR ( restore_duplicate_uid , 2371 , " Attempted to restore using a UID that had been used for an aborted restore " )
ERROR ( task_invalid_version , 2381 , " Invalid task version " )
2017-12-01 09:18:57 +08:00
ERROR ( task_interrupted , 2382 , " Task execution stopped due to timeout, abort, or completion by another worker " )
2017-05-26 04:48:44 +08:00
2017-08-31 03:48:28 +08:00
ERROR ( key_not_found , 2400 , " Expected key is missing " )
2018-09-08 22:15:28 +08:00
ERROR ( json_malformed , 2401 , " JSON string was malformed " )
ERROR ( json_eof_expected , 2402 , " JSON string did not terminate where expected " )
2017-08-31 03:48:28 +08:00
2019-08-24 02:56:06 +08:00
// 2500 - disk snapshot based backup errors
2019-08-30 23:45:41 +08:00
ERROR ( snap_disable_tlog_pop_failed , 2500 , " Disk Snapshot error " )
2019-08-24 02:56:06 +08:00
ERROR ( snap_storage_failed , 2501 , " Failed to snapshot storage nodes " )
ERROR ( snap_tlog_failed , 2502 , " Failed to snapshot TLog nodes " )
ERROR ( snap_coord_failed , 2503 , " Failed to snapshot coordinator nodes " )
2019-08-30 23:45:41 +08:00
ERROR ( snap_enable_tlog_pop_failed , 2504 , " Disk Snapshot error " )
2019-08-24 02:56:06 +08:00
ERROR ( snap_path_not_whitelisted , 2505 , " Snapshot create binary path not whitelisted " )
ERROR ( snap_not_fully_recovered_unsupported , 2506 , " Unsupported when the cluster is not fully recovered " )
ERROR ( snap_log_anti_quorum_unsupported , 2507 , " Unsupported when log anti quorum is configured " )
ERROR ( snap_with_recovery_unsupported , 2508 , " Cluster recovery during snapshot operation not supported " )
2021-02-06 06:14:38 +08:00
ERROR ( snap_invalid_uid_string , 2509 , " The given uid string is not a 32-length hex string " )
2019-08-24 02:56:06 +08:00
2017-05-26 04:48:44 +08:00
// 4xxx Internal errors (those that should be generated only by bugs) are decimal 4xxx
ERROR ( unknown_error , 4000 , " An unknown error occurred " ) // C++ exception not of type Error
ERROR ( internal_error , 4100 , " An internal error occurred " )
2020-07-18 05:10:17 +08:00
// clang-format on
2017-05-26 04:48:44 +08:00
# undef ERROR
# endif