This page introduces the error codes and error messages that might be returned by the SDK when you call the Agora 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.
During the run time of the Agora Chat SDK, the error codes and error messages might be returned in the following ways
onError
callback, which you can register in the addEventListener
method.Error code | Error message | Possible reason |
---|---|---|
0 | REQUEST_SUCCESS |
None. |
-1 | REQUEST_TIMEOUT |
The request times out. |
-2 | REQUEST_UNKNOWN |
An unidentified error occurs. |
-3 | REQUEST_PARAMETER_ERROR |
The request parameters are invalid. |
-4 | REQUEST_ABORT |
The request is aborted. |
1 | WEBIM_CONNCTION_OPEN_ERROR |
The request to retrieve a token fails. |
2 | WEBIM_CONNCTION_AUTH_ERROR |
The SDK fails to verify the App Key. Try logging in again with a valid App Key. |
12 | WEBIM_CONNCTION_GETROSTER_ERROR |
Fails to generate the token. |
16 | WEBIM_CONNCTION_DISCONNECTED |
The WebSocket is disconnected due to network reasons. Try calling the method again. |
17 | WEBIM_CONNCTION_AJAX_ERROR |
An unidentified error occurs. |
27 | WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR |
The App Key is invalid. Log in again using a valid App Key. For how to get the App Key, see Get the information of theAgora Chat project. |
28 | WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR |
The token entered to log in is empty or incorrect. Log in again using the correct token. |
31 | WEBIM_CONNCTION_CALLBACK_INNER_ERROR |
An Internal error occurs when receiving the message callback. |
32 | WEBIM_CONNCTION_CLIENT_OFFLINE |
If a user is not logged in or drops offline, when the user sends a message, the SDK returns this error. Log in and try sending the message. |
39 | WEBIM_CONNECTION_CLOSED |
If a user is not logged in, or logged out, when the user sends a message, the SDK returns this error, Log in again and try sending the message. |
40 | WEBIM_CONNECTION_ERROR |
The user authentication fails. |
50 | MAX_LIMIT |
The number of reactions or the usage of translations has reached the limit. |
51 | MESSAGE_NOT_FOUND |
The message to be reported does not exist. |
52 | NO_PERMISSION |
The user has no permission to perform this operation. |
53 | OPERATION_UNSUPPORTED |
The current operation is not supported. |
101 | WEBIM_UPLOADFILE_ERROR |
The file upload fails because the message attachment or group file exceeds the file size limit. Adjust the file size, and try uploading again. |
102 | WEBIM_UPLOADFILE_NO_LOGIN |
The user is not logged in when uploading the file, causing the file upload to fail. Log in and try uploading the file again. |
200 | WEBIM_DOWNLOADFILE_ERROR |
When the message attachment cannot be downloaded, the SDK returns this error code. Try downloading the file again. |
204 | USER_NOT_FOUND |
The user to be added to a chat group during chat group creation does not exist. |
206 | WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE |
If the user does not enable multi-device login, the user is forced to log out when logging in at another device, and the SDK returns this error code. |
207 | WEBIM_CONNCTION_USER_REMOVED |
The logged in user is removed in the app background. |
216 | WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD |
If the logged in user changes the present password, the SDK kicks the user out and returns this error code. |
217 | WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE |
When the multi-device login function is enabled, if the user forces the user ID logged in at the current device to log out by calling APIs or managing the backend at another device, the SDK returns this error code. |
221 | USER_NOT_FRIEND |
When a peer user sets not to receive messages from a user that is not a contact, if you send a message to this peer user, the SDK reports this error code. You can enable this feature on Agora Console. |
503 | SERVER_UNKNOWN_ERROR |
The SDK fails to send the message due to an unknown error. |
504 | MESSAGE_RECALL_TIME_LIMIT |
When a timeout occurs during message recall, the SDK returns this error code. |
505 | SERVICE_NOT_ENABLED |
When you try using a service that is not enabled, the SDK returns this error code. Activate the service first and then call the method again. |
506 | SERVICE_NOT_ALLOW_MESSAGING |
If all members are banned in the group chatroom and the user ID is not included in the whitelist, when this user tries sending a message, the SDK returns this error code. |
507 | SERVICE_NOT_ALLOW_MESSAGING_MUTE |
If the user is muted in the group or the chatroom, when the user sends a message, the SDK returns this error code. |
508 | MESSAGE_MODERATION_BLOCKED |
The message is blocked by the moderation service. |
601 | GROUP_ALREADY_JOINED |
The user to be added to a chat group already exists in the chat group. |
602 | GROUP_NOT_JOINED |
When you try sending messages or controlling a group that you have not joined, the SDK returns this error code. |
603 | PERMISSION_DENIED |
The user has no permission to operate. Check whether the user is banned. If the user is banned, unban the user and log in again. |
604 | WEBIM_LOAD_MSG_ERROR |
An internal error occurs when receiving the callback and in the subsequent logic handling |
605 | GROUP_NOT_EXIST |
When you try controlling a group that does not exist, the SDK returns this error code. |
606 | GROUP_MEMBERS_FULL |
The number of chat group members has reached the limit. |
607 | GROUP_NOT_EXIST |
The number of maximum chat group members that you are attempting to specify when creating a chat group exceeds the limit of your current pricing plan. |
700 | REST_PARAMS_STATUS |
The token or app key is an empty string when calling RESTful APIs. |
702 | CHATROOM_NOT_JOINED |
The user to whom you are requesting to perform operations does not exist in the chat room. |
704 | CHATROOM_MEMBERS_FULL |
The number of chat room members has reached the limit. |
705 | CHATROOM_NOT_EXIST |
The chat room to which you are requesting to perform operations does not exist. |
999 | SDK_RUNTIME_ERROR |
A Websocket error occurs when sending a message. |
1100 | PRESENCE_PARAM_EXCEED |
The length of the parameters you are passing in when calling APIs of the presence service exceeds the limit. |
1101 | REACTION_ALREADY_ADDED |
The reaction to be added already exists in your reaction list. |
1102 | REACTION_CREATING |
The reaction that you are attempting to create is being created by another user at the same time. |
1103 | REACTION_OPERATION_IS_ILLEGAL |
You do not have permission to perform operations to a reaction. For example, you cannot delete a reaction if the reaction does not exist in your reaction list. |
1200 | TRANSLATION_NOT_VALID |
The parameters you are passing in when calling APIs of the translation service are invalid. |
1201 | TRANSLATION_TEXT_TOO_LONG |
The length of the source text to translate exceeds the limit. |
1204 | TRANSLATION_FAILED |
The request to retrieve the translation service fails. |
1300 | THREAD_NOT_EXIST |
The thread does not exist. |
1301 | THREAD_ALREADY_EXIST |
The thread to be created already exists. |