TCB Error Codes
When using TCB, you may encounter various errors. This section will introduce common error codes and how to troubleshoot them.
General Errors
| Error Code | Meaning |
|---|---|
| SYS_ERR | Internal System Exception |
| SERVER_TIMEOUT | Service Response Timeout |
| INVALID_APPID | Invalid AppId (WeChat appId or Tencent Cloud appId) |
| - | - |
| INVALID_ACTION | Invalid API name |
| EXCEED_REQUEST_SIZE_LIMIT | Request packet size limit exceeded |
| EXCEED_RATELIMIT | Request frequency exceeds the package resource limit. |
| INVALID_REQUEST_SOURCE | Invalid request source. Please check the WEB security domain configuration. |
| INVALID_COMMON_PARAM | Request common parameters error |
| INVALID_PARAM | Invalid request parameters |
| SIGN_PARAM_INVALID | Invalid authentication parameters |
| LOGIN_MANNER_UNREGISTED | The login method used has been disabled. |
| APP_SIGN_EXPIRED | Mobile application signature expired |
| INVALID_APP_SIGN | Invalid mobile application signature, signature format error. |
| INVALID_APP_ACCESS | Invalid mobile application access, mobile application version not found |
| CHECK_LOGIN_FAILED | Login status verification failed, access token expired (legacy) |
| ACCESS_TOKEN_EXPIRED | access token has expired |
| REFRESH_TOKEN_EXPIRED | refresh token has expired or does not exist |
| INVALID_REFRESH_TOKEN | Invalid refresh token |
| REFRESH_TOKEN_EXHAUSTED | Concurrent logins exceeded the limit |
| INVALID_ENV | Invalid environment or environment not found |
| INVALID_ENV_STATUS | Invalid environment status, unavailable |
| INVALID_ENV_SOURCE | Invalid binding source for Mini Program to TCB environment |
| RESOURCE_NOT_INITIAL | Cloud resources not initialized, cloud resources unavailable |
| EXCEED_REQUEST_LIMIT | Request count exceeded the limit, package resources depleted |
| EXCEED_CONCURRENT_REQUEST_LIMIT | Concurrent request limit exceeded |
| INVALID_OPERATION | Invalid operation. The current state (e.g., resources, account) does not permit this operation |
| PERMISSION_DENIED | Operation permission denied |
| INVALID_THIRDAPP_STATUS | Bound third-party mini program status abnormal |
Login Authentication
| Error Code | Meaning |
|---|---|
| AUTH_INVALID_CUSTOM_LOGIN_TICKET | Invalid custom login ticket (format error, expired, verification failed, etc.) |
| AUTH_WX_OAUTH_FAILED | WeChat OAuth failed |
| AUTH_CUSTOM_USER_ID_HAS_BEEN_BOUND | CustomUserId has been bound to an account |
| AUTH_OPEN_ID_HAS_BEEN_BOUND | openId has been bound to an account |
| AUTH_UNION_ID_HAS_BEEN_BOUND | unionId has been bound to an account |
| AUTH_EMAIL_HAS_BEEN_BOUND | email has been bound to an account |
| INVALID_EMAIL_TOKEN | email activation token expired or does not exist |
| AUTH_LOGIN_FAILED | Login failed |
Database
| Error Code | Meaning |
|---|---|
| DATABASE_REQUEST_FAILED | Database request failed, a general database error |
| DATABASE_INVALID_OPERRATOR | Unsupported operation, invalid database operator |
| DATABASE_PERMISSION_DENIED | Database operation permission denied |
| DATABASE_COLLECTION_EXCEED_LIMIT | Database collection limit exceeded |
| DATABASE_COLLECTION_NOT_EXIST | Collection does not exist |
| DATABASE_COLLECTION_ALREADY_EXIST | Collection already exists |
| DATABASE_TIMEOUT | Database request timeout |
| DATABASE_TRANSACTION_FAIL | Database transaction request failed |
| DATABASE_TRANSACTION_CONFLICT | Database transaction conflict |
| DATABASE_DUPLICATE_WRITE | Write to database failed due to duplicate key (e.g., inserting data with the same _id) |
Cloud Function
| Error Code | Meaning |
|---|---|
| FUNCTIONS_EXECUTE_FAIL | Cloud function execution failed (general error) |
| FUNCTIONS_TIME_LIMIT_EXCEEDED | Cloud Function execution timeout |
| FUNCTIONS_MEMORY_LIMIT_EXCEEDED | Cloud Function memory limit exceeded |
| FUNCTION_NOT_FOUND | Cloud function not found |
Cloud Storage
| Error Code | Meaning |
|---|---|
| STORAGE_REQUEST_FAIL | Cloud Storage request failed (general error) |
| EXCEED_UPLOAD_MAXFILESIZE | Cloud Storage upload file size exceeded the limit |
| STORAGE_SIGN_PARAM_INVALID | Cloud Storage file metadata parsing failed |
| STORAGE_EXCEED_AUTHORITY | The current user lacks permission to operate cloud storage resources. Please check Cloud Storage permission configuration |
| STORAGE_FILE_NONEXIST | Cloud Storage file not found |
| STORAGE_FILE_PATH_CONFLICT | Cloud Storage file path conflict |
Note
`DATABASE_REQUEST_FAILED, STORAGE_REQUEST_FAIL, and FUNCTIONS_EXECUTE_FAIL are general database request error, cloud storage request error, and cloud function request error respectively, with no specific semantics. In the future, we will refine error codes with distinct characteristic semantics. Please avoid making special logical judgments based on these error codes.