Skip to main content

INVALID_REGION

Encountering an error? Get help with AI tools

Error Cause

Current region parameter and specified environment region are inconsistent, js sdk defaults to ap-shanghai region when region parameter is not specified.

Common error scenarios:

  1. Environment created in ap-guangzhou region, cannot connect to ap-shanghai region
  2. Environment created in ap-beijing region, cannot connect to ap-shanghai region

Solution

Specify correct region

Beijing region

import cloudbase from "@cloudbase/js-sdk";

const app = cloudbase.init({
env: "your-env-id", // Replace with your environment id
region: "ap-beijing", // Defaults to Shanghai region if not provided
});

Guangzhou region

import cloudbase from "@cloudbase/js-sdk";

const app = cloudbase.init({
env: "your-env-id", // Replace with your environment id
region: "ap-guangzhou", // Defaults to Shanghai region if not provided
});