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 the runtime of the Chat SDK, if a method call succeeds, the SDK returns nil. If it fails, the SDK returns one of the following error codes and error messages:

Error codeError messagePossible reasonFix
0AgoraChatErrorNoErrorThe operation succeeds.No action required.
1AgoraChatErrorGeneralDefault error related to the SDK or API requests. Occurs when SDK isn't properly initialized or a request fails without specific reason.Analyze logs and called APIs.
2AgoraChatErrorNetworkUnavailableSDK disconnected from server due to network interruption.Retry operation after network restoration.
3AgoraChatErrorDatabaseOperationFailedDatabase operation fails.Analyze called API with logs. Error occurs when updating non-existent messages with EMConversation#updateMessage or when database isn't open during operations.
4AgoraChatErrorExceedServiceLimitUsage exceeds service limit, such as registered users or contacts exceeding current pricing plan limits.Check API parameters. Control limit parameter values. For rate limiting, retry after delay.
8AgoraChatAppActiveNumbersReachLimitationApp reached maximum daily active users (DAU) or monthly active users (MAU).Upgrade Chat service in the console.
100AgoraChatErrorInvalidAppkeyApp Key is invalid.Initialize with correct App Key.
101AgoraChatErrorInvalidUsernameUser ID is invalid, such as empty string when adding a contact.Ensure user ID parameter is not empty.
102AgoraChatErrorInvalidPasswordLogin password is empty or invalid.Verify password parameter is correct.
104AgoraChatErrorUsernameTooLongUser ID is too long.Log in with valid user ID. Verify token parameters are correct.
105AgoraChatErrorUsernameTooLongUser ID exceeds 64 bytes limit.Check user ID length.
108AgoraChatErrorTokenExpireToken has expired.When callback is received, regenerate token and call login to log in again.
109AgoraChatErrorTokeWillExpireToken passed half of its validity period.When callback is received, regenerate token and call AgoraChatClient#renewToken to update.
110AgoraChatErrorInvalidParamInvalid parameter.Verify API parameters are valid.
200AgoraChatErrorUserAlreadyLoginSameUser already logged in.Check if SDK has automatic login enabled or if login method was already called.
201AgoraChatErrorUserNotLoginUser not logged in. Session invalid or expired when attempting operations.Ensure Chat login completes before calling API.
202AgoraChatErrorUserAuthenticationFailedUser authentication fails due to invalid or expired token.If logged out, log in again. Otherwise, regenerate token and call AgoraChatClient#renewToken.
203AgoraChatErrorUserAlreadyExistUser ID specified during registration already exists.Register with a different user ID or consider registration successful.
204AgoraChatErrorUserNotFoundUser does not exist.Verify userId parameter is correct.
205AgoraChatErrorUserIllegalArgumentIncorrect user parameter. User ID invalid or empty during registration or attribute updates.Verify API parameters are correct.
206AgoraChatErrorUserLoginOnAnotherDeviceUser logged in on another device. Forces logout on current device if multi-device service isn't enabled.When AgoraChatClientDelegate#userAccountDidLoginFromOtherDevice is triggered, log in again.
207AgoraChatErrorUserRemovedUser account deleted in the console.When AgoraChatClientDelegate#userAccountDidRemoveFromServer is triggered, return to login page. Account no longer available.
209AgoraChatErrorUpdateApnsConfigsFailedFailed to update push configurations.Check error-reporting API, wait, then retry.
210AgoraChatErrorUserPermissionDeniedUser 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.
211AgoraChatErrorUserBindDeviceTokenFailedFailed to bind push token to device.Verify token for device push binding isn't empty.
213AgoraChatErrorUserBindAnotherDeviceUser logged in to another device in single-device login configuration.Configure for multiple device login or use AgoraChatClient#kickDevice before logging in.
214AgoraChatErrorUserLoginTooManyDevicesUser reached maximum number of login devices.Increase allowed simultaneous devices or use AgoraChatClient#kickDevice before logging in.
215AgoraChatErrorUserMutedUser is muted in group or chat room.Restrict message sending in UI for users who are banned.
216AgoraChatErrorUserKickedByChangePasswordUser changed login password, ending current session.When AgoraChatClientDelegate#userAccountDidForcedToLogout is received, call AgoraChatClient#logout and return to login page.
217AgoraChatErrorUserKickedByOtherDeviceUser kicked off device via console or API call from another device.When AgoraChatClientDelegate#userAccountDidForcedToLogout is received, call AgoraChatClient#logout and return to login page.
218AgoraChatErrorUserAlreadyLoginAnotherAnother user already logged in on device.Call AgoraChatClient#logout to log out current account before logging in with different account.
219AgoraChatErrorUserMutedByAdminUser cannot send message when all members are muted.Restrict message sending in UI when full ban is active.
220AgoraChatErrorUserDeviceChangedLogin attempt on device that isn't the last used device in single-device configuration.When AgoraChatClientDelegate#userAccountDidLoginFromOtherDevice is received, call AgoraChatClient#logout and return to login page.
221AgoraChatErrorUserNotOnRosterUser cannot send message to non-contact when contacts-only messaging is enabled.Call AgoraChatContactManager#addContact first. Send messages after friend request is accepted.
300AgoraChatErrorServerNotReachableServer 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.
301AgoraChatErrorServerTimeoutRequest timeout when server doesn't respond within specified period.Retry API after switching networks or waiting.
302AgoraChatErrorServerBusyServer currently busy.Check for repeated API calls. May occur when calling again before previous result is returned.
303AgoraChatErrorServerUnknownErrorCommon server request error.Provide logs and called APIs for troubleshooting.
304AgoraChatErrorServerGetDNSConfigFailedSDK fails to get server configuration.If AgoraChatOptions#enableDnsConfig is No, check server settings. Otherwise, likely network issue during dnsConfig request.
305AgoraChatErrorServerServingForbiddenApp is banned.Enable Chat feature in console or contact support.
400AgoraChatErrorFileNotFoundFile not found.For log files, retry. For attachments, file no longer exists and cannot be downloaded.
401AgoraChatErrorFileInvalidFile invalid.Select different file and retry upload.
402AgoraChatErrorFileUploadFailedFailed to upload file.Analyze with API calls and logs.
403AgoraChatErrorFileDownloadFailedFailed to download file.Check network or message expiration in logs.
404AgoraChatErrorFileDeleteFailedFailed to delete existing log file.Check permissions for app log files or chat logs.
405AgoraChatErrorFileTooLargeFile exceeds size limit.Select file under 10 MB or contact support to increase limit.
406AgoraChatErrorFileContentImproperFile content inappropriate.Select appropriate file and retry.
407AgoraChatErrorFileExpiredFile expired. Attachments stored for 7 days by default.Contact support to increase storage time.
500AgoraChatErrorMessageInvalidMessage invalid. Message object or ID empty, or sender ID inconsistent with login session.Verify message construction, ID, sender, and body settings meet requirements.
504AgoraChatErrorMessageRecallTimeLimitMessage recall timeout.Show UI error or contact support to extend the retractability time.
505AgoraChatErrorServiceNotEnableFeature not enabled.Enable required features in console based on API and log analysis.
506AgoraChatErrorMessageExpiredGroup message read receipt period expired. Default validity is 3 days.Show UI error or contact support to extend the validity time.
507AgoraChatErrorMessageIllegalWhiteListUser not on allow list when all members are muted.Show UI error or check if group-wide ban is enabled.
508AgoraChatErrorMessageExternalLogicBlockedMessage blocked by app server filtering rule during pre-sending callback.Show UI prompt or check the pre-sending callback logs.
510AgoraChatErrorMessageSizeLimitMessage body exceeds limit.Show UI prompt or reduce the message length (max 5 KB by default).
511AgoraChatErrorEditFailedFailed to modify message.Analyze with logs.
600AgoraChatErrorGroupInvalidIdInvalid group ID.Verify group ID parameter isn't null or disbanded.
601AgoraChatErrorGroupAlreadyJoinedUser already in chat group.Handle as successful join.
602AgoraChatErrorGroupNotJoinedUser not in chat group.Verify group ID is for joined group that hasn't been disbanded.
603AgoraChatErrorGroupPermissionDeniedUser lacks permission for group operation.Check API call permissions.
604AgoraChatErrorGroupMembersFullGroup member count reached limit.Show UI prompt or check if the maximum member count exceeds limit (default 200).
605AgoraChatErrorGroupSharedFileInvalidIdGroup shared file ID is empty.Verify sharedFileId parameter isn't null.
606AgoraChatErrorGroupNotExistChat group doesn't exist.Verify group ID is correct or not from disbanded group.
607AgoraChatErrorGroupDisabledChat group is disabled.Show UI prompt to request unblock from administrator.
608AgoraChatErrorGroupNameViolationChat group name is invalid.Check if group name contains sensitive information.
609AgoraChatErrorGroupMemberAttributesReachLimitCustom attributes size reached limit.Total length for single group member cannot exceed 4 KB.
610AgoraChatErrorGroupMemberAttributesUpdateFailedFailed to set custom attributes.Analyze with API calls and logs.
611AgoraChatErrorGroupMemberAttributesKeyReachLimitCustom attribute key exceeds 16 bytes.Check if attribute key exceeds limit.
612AgoraChatErrorGroupMemberAttributesValueReachLimitCustom attribute value exceeds 512 bytes.Check if attribute value exceeds limit.
700AgoraChatErrorChatroomInvalidIdInvalid chat room ID.Check if chat room ID is empty.
701AgoraChatErrorChatroomAlreadyJoinedUser already in chat room.Handle as successful join.
702AgoraChatErrorChatroomNotJoinedUser not in chat room.Verify chat room ID is correct, not disbanded, or previously joined.
703AgoraChatErrorChatroomPermissionDeniedUser lacks permission for chat room operation.Check API call permissions.
704AgoraChatErrorChatroomMembersFullChat room member count reached limit.Check maximum member count setting.
705AgoraChatErrorChatroomNotExistChat room doesn't exist.Verify chat room ID is correct, not disbanded, or previously joined.
706AgoraChatErrorChatroomOwnerNotAllowLeaveChat room owner not allowed to leave.Check AgoraChatOptions#allowChatroomOwnerLeave setting.
707EMErrorChatroomUserInBlockListUser is in chat room blacklist.Check console for chat room blacklist status.
900AgoraChatErrorUserCountExceedUser attribute retrieval count exceeds 100.Get attributes in batches of up to 100 users.
901AgoraChatErrorUserInfoDataLengthExceedUser attributes too long. Maximum 2 KB per user or 10 GB per app.Check attribute length limits.
1000AgoraChatErrorContactAddFailedFailed to add contact.Analyze with API calls and error description.
1001AgoraChatErrorContactReachLimitInviter reached maximum contacts limit.Show UI error or contact support to increase limit.
1002AgoraChatErrorContactReachLimitPeerInvitee reached maximum contacts limit.Show UI error or contact support to increase limit.
1100AgoraChatErrorPresenceParamExceedPresence parameter length exceeds limit.Online status details cannot exceed 64 bytes.
1101AgoraChatErrorPresenceCannotSubscribeSelfUser cannot subscribe to own presence status.Check if subscribed user ID is own ID.
1110AgoraChatErrorTranslateParamErrorTranslation parameter error.Analyze with debug logs.
1111AgoraChatErrorTranslateServiceNotEnabledTranslation service not enabled.Enable translation service in console.
1112AgoraChatErrorTranslateUsageLimitTranslation usage reached limit.Contact support to renew translation usage.
1113AgoraChatErrorTranslateServiceFailFailed to translate message.Analyze with debug logs.
1200AgoraChatErrorModerationFailedThird-party content moderation result is Rejected.Check content audit configuration and logs in console.
1299AgoraChatErrorThirdServiceFailedNon-third-party moderation service result is Rejected.Check content audit configuration and logs in console.
1300AgoraChatErrorReactionReachLimitMessage Reactions reached maximum allowed.Show UI prompt or contact support to increase limit.
1301AgoraChatErrorReactionHasBeenOperatedUser already added this Reaction.Handle as successful addition.
1302AgoraChatErrorReactionOperationIsIllegalUser lacks permission for Reaction operation.Verify parameters with log analysis.
1400AgoraChatErrorThreadNotExistThread doesn't exist.Verify subzone ID is correct.
1401AgoraChatErrorThreadAlreadyExistThread already exists.Check if subzone is already created under incoming message.