Project is not accessible in this region. Please make sure you are using the correct endpoint
- 0
- Functions
- Cloud
Context: I'm changing my region from German to Singapore.
Sample code on Go appwrite function:
package handler
import (
"os"
"github.com/appwrite/sdk-for-go/appwrite"
"github.com/appwrite/sdk-for-go/client"
"github.com/open-runtimes/types-for-go/v4/openruntimes"
)
var (
appwriteClient client.Client
)
func Main(Context openruntimes.Context) openruntimes.Response {
appwriteClient = appwrite.NewClient(
appwrite.WithEndpoint(os.Getenv("APPWRITE_FUNCTION_API_ENDPOINT")),
appwrite.WithProject(os.Getenv("APPWRITE_FUNCTION_PROJECT_ID")),
appwrite.WithKey(Context.Req.Headers["x-appwrite-key"]),
)
Context.Log(os.Getenv("APPWRITE_FUNCTION_API_ENDPOINT"))
tablesDB := appwrite.NewTablesDB(appwriteClient)
if Context.Req.Path == "/cek" {
if Context.Req.Method == "GET" {
response, err := tablesDB.ListRows("68f8e75900141e1e5ca6", "hargadomain")
if err != nil {
Context.Error("Gagal ngambil row: ", err)
return Context.Res.Send(err.Error(), Context.Res.WithStatusCode(500))
}
return Context.Res.Json(response)
} else {
return Context.Res.Send("Metode tidak diizinkan.", Context.Res.WithStatusCode(405))
}
}
return Context.Res.Send("Endpoint tidak ditemukan.", Context.Res.WithStatusCode(404))
}
Error: Project is not accessible in this region. Please make sure you are using the correct endpoint
Try logging the APPWRITE_FUNCTION_ENDPOINT env variable
I'm expecting is my new region, which is https://sgp.cloud.appwrite.io/v1
You're executing it locally?
True
Then that could be the reason I think 🤔
Try setting it manually meanwhile 😅
Manually solve, xixi
But I have another problem if you can help https://discord.com/channels/564160730845151244/1433407648031572018
Recommended threads
- Added Custom Domain - API requests with ...
I've added in a custom domain to Appwrite my domain itself is on cloudflare but has Appwrite name servers added and confirmed they work, I added the CAA in clou...
- Table contents missing (attributes+rows)
Here is an image of the cloud and the attributes that should exist Some of the table do have the data but others dont. I am able to access the rows via api c...
- Bug Report: type generation for enum of ...
### 👟 Reproduction steps in the enum element value, instead of English, use another language (Khmer), in my case Khmer text. ``` export enum ProvinceType { ...