Error codes
This page introduces the error codes and error messages that might be returned by the SDK when you call the Chat APIs.
Possible reasons for the errors are given to assist you in debugging. If you receive an error code not included here, Agora recommends you contact support@agora.io so that the technical support team can help resolve the issue.
The error codes and error messages might be returned in the following ways:
- The return value when a method call fails.
- The error code reported through the
onError
callback.
Error code | Error message | Possible reason |
---|---|---|
0 | EM_NO_ERROR | The operation succeeds. |
1 | GENERAL_ERROR | Default error related to the SDK or requests to the server. For example, the SDK is not properly initialized, or a request fails with no specific reason. |
2 | NETWORK_ERROR | The SDK is disconnected from the server due to network interruption. |
3 | DATABASE_ERROR | The database operation fails. |
4 | EXCEED_SERVICE_LIMIT | The usage exceeds the service limit. For example, the total number of registered users or contacts exceeds the limit of the current pricing plan. |
8 | APP_ACTIVE_NUMBER_REACH_LIMITATION | The app has reached its maximum number of daily active users (DAU) or monthly active users (MAU). |
100 | INVALID_APP_KEY | The App Key is invalid. For how to get the App Key, see Get the information of the Agora Chat project. |
101 | INVALID_USER_NAME | The user ID is invalid. For example, when a user requests to add a contact, the user ID is set to an empty string. |
102 | INVALID_PASSWORD | The login password is empty or invalid. |
104 | INVALID_TOKEN | The user token is empty or invalid. |
105 | USER_NAME_TOO_LONG | The length of the user ID exceeds the limit of 64 bytes. |
108 | TOKEN_EXPIRED | The token has expired. |
109 | TOKEN_WILL_EXPIRE | The token has passed half of its validity period. |
110 | INVALID_PARAM | Invalid parameter. |
200 | USER_ALREADY_LOGIN | The user has already logged in. |
201 | USER_NOT_LOGIN | The user hasn't logged in. For example, the login session is either invalid or has expired when a user requests to send a message or perform operations to a chat group. |
202 | USER_AUTHENTICATION_FAILED | The user authentication fails because the token is invalid or has expired. |
203 | USER_ALREADY_EXIST | The user already exists: The user ID specified during user account registration already exists. |
204 | USER_NOT_FOUND | The user does not exist. For example, the user ID specified for login or retrieval of the conversation list of a user does not exist. |
205 | USER_ILLEGAL_ARGUMENT | Incorrect user parameter. For example, the user ID specified during user account registration or user attribute updating is invalid or empty. |
206 | USER_LOGIN_ANOTHER_DEVICE | The user has logged in on another device. If the multi-device service is not enabled, the user is forced to log out of the current device upon successful login on another device with the same account. |
207 | USER_REMOVED | The user account is deleted on the Agora Console. |
209 | PUSH_UPDATECONFIGS_FAILED | Fails to update the push configurations. For example, a failure of changing the nickname displayed for message push or updating do-not-disturb settings. |
210 | USER_PERMISSION_DENIED | The user has no permission to perform this operation. For example, a user that is banned attempts to send a message. |
213 | USER_BIND_ANOTHER_DEVICE | The user has logged in to another device. This error occurs when a user has logged in on one device and try to log in on another one with the same account, if the app is configured to persist the login state on the current device while preventing the login on another device in a single-device login scenario. This error code is deprecated. |
214 | USER_LOGIN_TOO_MANY_DEVICES | The user has reached the maximum number of devices on which he or she can log in with the same user account. This error occurs on a device with auto login enabled in a multi-device login scenario if the app turns on the switch of login on another device never kicking the user off on a current login device when the maximum number of login devices is exceeded. For example, a user can log in on at most four devices. At first, the user stays logged in on four devices, A (with auto login enabled), B, C, D. Then, the user gets logged out on device A due to network disruption and logs in on device E manually. After the network is available, auto login is performed on device A and fails due to the limit of login devices, triggering this error. |
215 | USER_MUTED | The user is muted and not allowed to send messages in a chat group or chat room. |
216 | USER_KICKED_BY_CHANGE_PASSWORD | The user has changed the login password. Once the login password is changed, the current login session ends and the user must log in again with the new password. |
217 | USER_KICKED_BY_OTHER_DEVICE | The user gets kicked off from a device in a multi-device login scenario on the Agora Console or by calling an API on another device. |
218 | USER_ALREADY_LOGIN_ANOTHER | Another user has logged in. This error occurs if a user attempts to log in on the same device with another account before logging out on the device with the current account. |
219 | USER_MUTED_BY_ADMIN | The user is muted globally and cannot send a message. |
220 | USER_DEVICE_CHANGED | The device on which a user attempts to log in is not the last one in a single-device login scenario. By default, if a user logs in on a another device, he or she will get kicked off from the current device in a single-device login scenario. This error occurs if the app turns on the switch of keeping the logged-in state on the current device if a user attempts to log in on another device. |
221 | USER_NOT_ON_ROSTER | The user cannot send a message to another user that is not on the contact list. This error occurs if the switch of allowing message sending only between contacts is turned on. |
300 | SERVER_NOT_REACHABLE | The server is not reachable. For example, the SDK is disconnected from the server due to unstable network conditions or other reasons when a user sends or recalls a message. |
301 | SERVER_TIMEOUT | The request timeout. This error occurs when the server does not respond to an API request within the specified period, generally 30 or 60 seconds. |
302 | SERVER_BUSY | The server is currently busy. Try again later. |
303 | SERVER_UNKNOWN_ERROR | A common error for requests to the server. As this error occurs in multiple cases, the user needs to further identify and troubleshoot issues according to logs. |
304 | SERVER_GET_DNSLIST_FAILED | The SDK fails in getting the configuration of the server that the app currently runs on. |
305 | SERVER_SERVICE_RESTRICTED | The app is banned. This error occurs if a user tries to call a method when the app is banned. |
400 | FILE_NOT_FOUND | The file is not found. For example, a log file is not found or downloading an attachment fails. |
401 | FILE_INVALID | The file is invalid. For example, uploading a message attachment or a shared file in the group fails. |
402 | FILE_UPLOAD_FAILED | Fails to upload a file. For example, uploading a message attachment fails. |
403 | FILE_DOWNLOAD_FAILED | Fails to download a file. For example, downloading a message attachment fails. |
404 | FILE_DELETE_FAILED | Fails to delete the existing log file. When a user retrieves a new log file, the existing log file, if any, will be deleted before a new one is generated. |
405 | FILE_TOO_LARGE | The file is too large. For example, the message attachment or shared group file that a user attempts to upload exceeds the file size limit for upload. |
406 | FILE_CONTENT_IMPROPER | The file content is inappropriate. For example, a message attachment or shared group file fails to be uploaded because the file contains inappropriate contents. |
407 | FILE_IS_EXPIRED | The file has expired: For example, this error occurs when users download expired message attachments or group shared files. Message attachments and group shared files are stored for 7 days by default. To increase the storage time limit, contact support@agora.io. |
500 | MESSAGE_INVALID | The message is invalid. For example, during message sending, the message object or message ID is empty, or the user ID of the message sender is inconsistent with the user ID of the current login session. |
501 | MESSAGE_INCLUDE_ILLEGAL_CONTENT | The message contains inappropriate content. This error occurs when a message is found by the filtering system to contain inappropriate content. |
502 | MESSAGE_SEND_TRAFFIC_LIMIT | Messages are too large or sent too frequently. It is recommended that the user reduce the message sending frequency or the message size. |
504 | MESSAGE_RECALL_TIME_LIMIT | The message recall timeout. This error occurs when a message fails to be recalled because the timeout period expires. |
505 | SERVICE_NOT_ENABLED | The feature that the user is attempting to use is not enabled. This feature needs to be enabled on the Agora Console or by contacting support@agora.io before it is ready to use. |
506 | MESSAGE_EXPIRED | The period for sending the read receipt for a group message has expired. The default validity period is 3 days. |
507 | MESSAGE_ILLEGAL_WHITELIST | The user is not on the allow list of a group or chat room. This error occurs when a user that is not on the allow list attempts to send a message in a chat group or chat room if all members of the group or chat room are muted. |
508 | MESSAGE_EXTERNAL_LOGIC_BLOCKED | During the pre-sending callback, the message that the user is attempting to send is blocked by a message filtering rule defined in the app server. |
510 | MESSAGE_SIZE_LIMIT | The body of the message to send exceeds the upper limit. |
511 | MESSAGE_EDIT_FAILED | Fails to modify a message. |
600 | GROUP_INVALID_ID | Invalid group ID. For a group-related API, the chat group ID is an empty string or invalid. |
601 | GROUP_ALREADY_JOINED | The user is already in this chat group. For example, the error occurs when a user attempts to join a chat group that he or she is already in. |
602 | GROUP_NOT_JOINED | The user hasn't joined this chat group. This error occurs when a user attempts to send a message or perform operations in a chat group that he or she is not in. |
603 | GROUP_PERMISSION_DENIED | The user does not have the permission to perform the operation to a chat group. For example, a chat group member does not have permission to add or remove a chat group admin. |
604 | GROUP_MEMBERS_FULL | The number of members in the chat group has reached the upper limit specified during group creation. |
605 | GROUP_SHARED_FILE_INVALIDID | The ID of the shared file in the chat group is invalid. |
606 | GROUP_NOT_EXIST | The chat group to which the user is requesting to perform operations does not exist. |
607 | GROUP_DISABLED | The chat group is disabled. |
608 | GROUP_NAME_VIOLATION | The chat group name is invalid. |
609 | GROUP_MEMBER_ATTRIBUTES_REACH_LIMIT | The number of custom attributes has reached the upper limit for a chat group member. |
610 | GROUP_MEMBER_ATTRIBUTES_UPDATE_FAILED | Fails to set custom attributes for a chat group member. |
611 | GROUP_MEMBER_ATTRIBUTES_KEY_REACH_LIMIT | The key of a custom attribute for a chat group member exceeds the limit of 16 bytes. |
612 | GROUP_MEMBER_ATTRIBUTES_VALUE_REACH_LIMIT | The value of a custom attribute for a chat group member exceeds the limit of 512 bytes. |
700 | CHATROOM_INVALID_ID | Invalid chat room ID. This error occurs when the chat room ID is an empty string for the chat room-related method that is used. |
701 | CHATROOM_ALREADY_JOINED | The user is already in the chat room. This error occurs when a user attempts to join a chat room that he or she is already in. |
702 | CHATROOM_NOT_JOINED | The user hasn't joined this chat room. This error occurs when a user attempts to send a message or perform operations in a chat room that he or she is not in. |
703 | CHATROOM_PERMISSION_DENIED | The user does not have the permission to perform the operation to a chat room. For example, a chat room member does not have permission to add or remove a chat room admin. |
704 | CHATROOM_MEMBERS_FULL | The number of members in the chat room has reached the upper limit specified during chat room creation. |
705 | CHATROOM_NOT_EXIST | The chat room to which the user is requesting to perform operations does not exist. |
900 | USERINFO_USERCOUNT_EXCEED | The number of users whose user attributes are to be retrieved exceeds 100. |
901 | USERINFO_DATALENGTH_EXCEED | The user attributes are too long. The total length of all user attributes cannot exceed 2 KB for a user or 10 GB for an app. |
1000 | CONTACT_ADD_FAILED | Fails to add a contact. |
1001 | CONTACT_REACH_LIMIT | The inviter has reached the maximum number of contacts that can be added. |
1002 | CONTACT_REACH_LIMIT_PEER | The invitee has reached the maximum number of contacts that can be added. |
1100 | PRESENCE_PARAM_LENGTH_EXCEED | The length of a parameter in the presence-related API call exceeds the upper limit. |
1101 | PRESENCE_CANNOT_SUBSCRIBE_YOURSELF | The user cannot subscribe to her or his own presence status. |
1110 | TRANSLATE_PARAM_INVALID | Translation parameter error. |
1111 | TRANSLATE_SERVICE_NOT_ENABLE | The translation service has not been enabled. The translation service needs to be enabled on the Agora Console before it is ready to use. |
1112 | TRANSLATE_USAGE_LIMIT | The translation usage has reached the upper limit. |
1113 | TRANSLATE_MESSAGE_FAIL | Fails to translate the message. |
1200 | MODERATION_FAILED | The message moderation result provided by the third-party content moderation service is Rejected . |
1299 | THIRD_SERVER_FAILED | The content moderation result of another moderation service than the third-party service is Rejected . |
1300 | REACTION_REACH_LIMIT | The number of Reactions for the message has reached the maximum allowed. |
1301 | REACTION_HAS_BEEN_OPERATED | The user has added this Reaction and cannot add it repeatedly. |
1302 | REACTION_OPERATION_IS_ILLEGAL | The user does not have permission to operate on this Reaction. For example, a user that does not add this Reaction attempts to delete it or a user that is neither the message sender nor recipient tries to add a Reaction in a one-to-one chat. |
1400 | THREAD_NOT_EXIST | The thread does not exist. |
1401 | THREAD_ALREADY_EXIST | The thread to be created already exists. |
1402 | THREAD_CREATE_MESSAGE_ILLEGAL | The parent message for thread creation is invalid. For example, the message is recalled or unavailable. |
1500 | PUSH_NOT_SUPPORT | The third-party push service is not supported. This error occurs if the configured third-party push service is not supported by the current device. |
1501 | PUSH_BIND_FAILED | Fails to bind the device with the push token provided by a third-party push service. This error occurs when the token of a third-party push service fails to be uploaded to the server. |
1502 | PUSH_UNBIND_FAILED | Fails to unbind the device from the push token provided by a third-party push service. |