Skip to main content

INVALID_ENV

Encountering an error? Get help with AI tools

Error Cause

The environment ID is invalid or the corresponding CloudBase environment cannot be found. This may be due to one of the following situations:

  1. Environment not specified
  2. Environment ID does not exist or has been deleted
  3. Environment has been isolated

Solutions

Explicitly Specify Environment

  • When initializing the SDK, explicitly specify the environment ID, replace your-env-id with your actual environment ID
    // Example code
    cloudbase.init({
    env: 'your-env-id' // Replace with your environment ID
    });
  • When using HTTP API, explicitly specify the environment ID, replace your-env-id in the URL with your actual environment ID
    https://your-env-id.api.tcloudbasegateway.com/v1/

Check if Environment ID is Correct

Log in to CloudBase Platform to verify that the Environment ID is correct

Confirm Environment is Not Overdue

If the environment has been isolated due to overdue payment, please renew it as soon as possible to prevent data loss caused by environment destruction

Mini Program Scenario

For mini program users, if none of the above situations apply, check whether the current CloudBase environment is bound to the mini program

If the environment was opened on the Tencent Cloud side and you want to use it in a mini program, you need to bind the mini program to the CloudBase environment first. For details, refer to Bind Mini Program to CloudBase Environment