Error codes

Updated

Introduces the error codes and error messages that might be returned by the SDK when you call the Agora Chat APIs.

This page lists the possible error codes and error messages returned by the SDK when you call Chat APIs.

Possible reasons for these errors are provided to help you debug more efficiently. If you encounter an error code that is not listed here, contact support@agora.io for assistance.

During runtime of the Agora Chat SDK, you may receive an error code and error message in one of the following ways:

  • As the return value when a method call fails.
  • As the error code reported through the onError callback.

For example, when a user registration request fails because the username already exists, the onError callback returns the following error code and error message:

SDKClient.Instance.Login(
    username,
    passwd,
    callback: new CallBack(
        onSuccess: () =>
        {
        },
        onError: (code, desc) =>
        {
            // code: 203
            // desc: USER_ALREADY_EXIST
        }
    )
);
Error codeError messageError descriptionFix
0EM_NO_ERRORThe operation succeeds.No action required.
1GENERAL_ERRORThe SDK is not properly initialized, or the server cannot identify this error.Analyze logs and called APIs.
2NETWORK_ERRORSDK disconnected from server due to network interruption.Retry operation after network restoration.
3DATABASE_ERRORDatabase operation fails.Analyze called API with logs. Error occurs when updating non-existent messages with Conversation#UpdateMessage or when database isn't open during operations.
4EXCEED_SERVICE_LIMITUsage exceeds service limit, such as registered users exceeding current pricing plan limits.Check API parameters. Control limit parameter values. For rate limiting, retry after delay.
8APP_ACTIVE_NUMBER_REACH_LIMITATIONApp reached maximum daily active users (DAU) or monthly active users (MAU).Upgrade Chat service in the console.
100INVALID_APP_KEYApp Key is invalid.Initialize with correct App Key.
101INVALID_USER_NAMEUser ID is invalid, such as empty string when adding a contact.Ensure user ID parameter is not null.
102INVALID_PASSWORDLogin password is empty or invalid.Verify password parameter is correct.
103INVALID_URLURL is incorrect.Verify API parameters are correct.
104INVALID_TOKENLogin token is empty or invalid.Verify token parameters are correct.
105USER_NAME_TOO_LONGUser ID exceeds 64 bytes limit.Check user ID length.
108TOKEN_EXPIREDToken has expired.When callback is received, regenerate token and call login to log in again.
109TOKEN_WILL_EXPIREToken passed half of its validity period.When callback is received, regenerate token and call SDKClient#RenewToken to update.
200USER_ALREADY_LOGINUser already logged in.Check if SDK has automatic login enabled or if login method was already called.
201USER_NOT_LOGINLogin session invalid or expired when attempting operations.Ensure Chat login completes before calling API.
202USER_AUTHENTICATION_FAILEDUser authentication fails due to invalid or expired token.If logged out, log in again. Otherwise, regenerate token and call SDKClient#RenewToken.
203USER_ALREADY_EXISTUser ID specified during registration already exists.Register with a different user ID or consider registration successful.
204USER_NOT_FOUNDUser does not exist.Verify user ID parameter is correct.
205USER_ILLEGAL_ARGUMENTIncorrect user parameter. User ID invalid or empty during registration or attribute updates.Verify API parameters are correct.
206USER_LOGIN_ANOTHER_DEVICEUser logged in on another device. Forces logout on current device if multi-device service isn't enabled.When IConnectionDelegate#OnLoggedOtherDevice is triggered, log in again.
207USER_REMOVEDUser account deleted in the backend.When IConnectionDelegate#OnRemovedFromServer is triggered, return to login page. Account no longer available.
208USER_REG_FAILEDUser account registration fails because registration is closed.Register account with business server instead of using SDK.
210USER_PERMISSION_DENIEDUser lacks permission for operation. User on block list attempts to send messageUser tries to modify another user's messageUser tries to modify custom group member attribute set by anotherUser attempts to destroy message thread without proper permissionsCheck if user has operational privileges.
213USER_BIND_ANOTHER_DEVICEUser logged in to another device in single-device login configuration.Configure for multiple device login or use SDKClient#KickDevice before logging in.
214USER_LOGIN_TOO_MANY_DEVICESUser reached maximum number of login devices.Increase allowed simultaneous devices or use SDKClient#KickDevice before logging in.
215USER_MUTEDUser is muted in group or chat room.Restrict message sending in UI for users who are banned.
216USER_KICKED_BY_CHANGE_PASSWORDUser changed login password, ending current session.When IConnectionDelegate#OnChangedIMPwd is received, call SDKClient#Logout and return to login page.
217USER_KICKED_BY_OTHER_DEVICEUser kicked off device via console or API call from another device.When IConnectionDelegate#OnKickedByOtherDevice is received, call SDKClient#Logout and return to login page.
218USER_ALREADY_LOGIN_ANOTHERAnother user already logged in on device.Call SDKClient#Logout to log out current account before logging in with different account.
219USER_MUTED_BY_ADMINUser cannot send message when all members are muted.Restrict message sending in UI when full ban is active.
220USER_DEVICE_CHANGEDLogin attempt on device that isn't the last used device in single-device configuration.When IConnectionDelegate#OnLoggedOtherDevice is received, call Client#Logout and return to login page.
221USER_NOT_FRIENDUser cannot send message to non-contact when contacts-only messaging is enabled.Call ContactManager#AddContact first. Send messages after friend request is accepted.
300SERVER_NOT_REACHABLEServer unreachable due to network issues.For login errors, try switching networks or contact support for TLS encryption in specific regions. For other operations, switch networks or retry after delay.
301SERVER_TIMEOUTRequest timeout when server doesn't respond within specified period.Retry API after switching networks or waiting.
302SERVER_BUSYServer currently busy.Check for repeated API calls. May occur when calling again before previous result is returned.
303SERVER_UNKNOWN_ERRORCommon server request error.Provide logs and called APIs for troubleshooting.
304SERVER_GET_DNSLIST_FAILEDSDK fails to retrieve DNS server information.If Options#EnableDNSConfig is No, check server settings. Otherwise, likely network issue during dnsConfig request.
305SERVER_SERVICE_RESTRICTEDApp server is restricted.Enable Chat feature in console or contact support.
400FILE_NOT_FOUNDFile not found.For log files, retry. For attachments, file no longer exists and cannot be downloaded.
401FILE_INVALIDFile invalid.Select different file and retry upload.
402FILE_UPLOAD_FAILEDFailed to upload file.Analyze with API calls and logs.
403FILE_DOWNLOAD_FAILEDFailed to download file.Check network or message expiration in logs.
404FILE_DELETE_FAILEDFailed to delete existing log file.Check permissions for app log files.
405FILE_TOO_LARGEFile exceeds size limit.Select file under 10 MB or contact support to increase limit.
406FILE_CONTENT_IMPROPERFile content inappropriate.Select appropriate file and retry.
407FILE_IS_EXPIREDFile expired. Attachments stored for 7 days by default.Contact support to increase storage time.
500MESSAGE_INVALIDMessage invalid. Message body or ID empty, or sender ID inconsistent with login session.Verify message construction, ID, sender, and body settings meet requirements.
501MESSAGE_INCLUDE_ILLEGAL_CONTENTMessage contains illegal content.View blocking logs in console.
504MESSAGE_RECALL_TIME_LIMITMessage recall timeout.Show UI error or contact support to extend the retractability time.
505SERVICE_NOT_ENABLEDFeature not enabled.Enable required features in console based on API and log analysis.
506MESSAGE_EXPIREDGroup receipt period expired. Default validity is 3 days.Show UI error or contact support to extend the validity time.
507MESSAGE_ILLEGAL_WHITELISTUser not on allow list when all members are muted.Show UI error or check if group-wide ban is enabled.
508MESSAGE_EXTERNAL_LOGIC_BLOCKEDMessage blocked by app server filtering rule.Show UI prompt or check the pre-sending callback logs.
510MESSAGE_SIZE_LIMITMessage body exceeds limit.Show UI prompt or reduce the message length (max 5 KB by default).
600GROUP_INVALID_IDGroup ID is invalid or empty.Verify group ID parameter isn't empty or disbanded.
601GROUP_ALREADY_JOINEDUser already in chat group.Handle as successful join.
602GROUP_NOT_JOINEDUser not in chat group.Verify group ID is for joined group that hasn't been disbanded.
603GROUP_PERMISSION_DENIEDUser lacks permission for group operation.Check API call permissions.
604GROUP_MEMBERS_FULLGroup member count reached limit.Show UI prompt or check if the maximum member count exceeds limit (default 200).
605GROUP_NOT_EXISTChat group doesn't exist.Verify sharedFileId parameter isn't null.
606GROUP_NOT_EXISTGroup doesn't exist. Operation attempted on non-existing group.Verify group ID is correct or not from disbanded group.
607GROUP_DISABLEDGroups are disabled.Show UI prompt to request unblock from administrator.
608GROUP_NAME_VIOLATIONGroup name is invalid.Check if group name contains sensitive information.
609GROUP_MEMBER_ATTRIBUTES_REACH_LIMITCustom attributes count reached limit.Total length for single group member cannot exceed 4 KB.
610GROUP_MEMBER_ATTRIBUTES_UPDATE_FAILEDFailed to set custom attributes.Analyze with API calls and logs.
611GROUP_MEMBER_ATTRIBUTES_KEY_REACH_LIMITCustom attribute key exceeds 16 bytes.Check if attribute key exceeds limit.
612GROUP_MEMBER_ATTRIBUTES_VALUE_REACH_LIMITCustom attribute value exceeds 512 bytes.Check if attribute value exceeds limit.
613GROUP_USER_IN_BLOCKLISTUser is in group blacklist.Show UI prompt or check console for blacklist status.
700CHATROOM_INVALID_IDChat room ID is invalid or empty.Check if chat room ID is empty.
701CHATROOM_ALREADY_JOINEDUser already in chat room.Handle as successful join.
702CHATROOM_NOT_JOINEDUser not in chat room.Verify chat room ID is correct, not disbanded, or previously joined.
703CHATROOM_PERMISSION_DENIEDUser lacks permission for chat room operation.Check API call permissions.
704CHATROOM_MEMBERS_FULLChat room member count reached limit.Check maximum member count setting.
705CHATROOM_NOT_EXISTChat room doesn't exist.Verify chat room ID is correct, not disbanded, or previously joined.
706CHATROOM_OWNER_NOT_ALLOW_LEAVEChat room owner not allowed to leave.Check Options#IsRoomOwnerLeaveAllowed setting when SDK is initialized.
707CHATROOM_USER_IN_BLOCKLISTUser is in chat room blacklist.Check console for chat room blacklist status.
900PUSH_NOT_SUPPORTThird-party push service not supported on current device.Get user attributes in batches of up to 100 users.
901PUSH_BIND_FAILEDFailed to upload third-party push service token to server.Check attribute length limits.
1000CONTACT_ADD_FAILEDFailed to add contact.Analyze with API calls and error description.
1001CONTACT_REACH_LIMITInviter reached maximum contacts limit.Show UI error or contact support to increase limit.
1002CONTACT_REACH_LIMIT_PEERInvitee reached maximum contacts limit.Show UI error or contact support to increase limit.
1100PRESENCE_PARAM_LENGTH_EXCEEDPresence parameter length exceeds limit.Online status details cannot exceed 64 bytes.
1101PRESENCE_CANNOT_SUBSCRIBE_YOURSELFUser cannot subscribe to own status.Check if subscribed user ID is own ID.
1110TRANSLATE_PARAM_INVALIDTranslation parameter error.Analyze with debug logs.
1111TRANSLATE_SERVICE_NOT_ENABLETranslation service not enabled.Enable translation service in console.
1112TRANSLATE_USAGE_LIMITTranslation usage reached limit.Contact support to renew translation usage.
1113TRANSLATE_MESSAGE_FAILFailed to translate message.Analyze with debug logs.
1200THIRD_MODERATION_FAILEDThird-party content moderation result is "Reject".Check content audit configuration and logs in console.
1299THIRD_DEFAULT_FAILEDNon-third-party moderation service result is "Reject".Check content audit configuration and logs in console.
1300REACTION_REACH_LIMITMessage Reactions reached maximum allowed.Show UI prompt or contact support to increase limit.
1301REACTION_HAS_BEEN_OPERATEDUser already added this Reaction.Handle as successful addition.
1302REACTION_OPERATION_IS_ILLEGALUser lacks permission for Reaction operation.Verify parameters with log analysis.
1400THREAD_NOT_EXISTThread doesn't exist.Verify subzone ID is correct.
1401THREAD_ALREADY_EXISTThread already exists under this message ID.Check if subzone already created under incoming message.