Hi! I always get AppwriteExeption: Network request failed, to this code:
console.log(file.uri)
try {
const response = await storage.createFile(
appwriteConfig.pfpBucketID,
ID.unique(),
{
name: `${username}_pfp`,
type: "image",
size: file.fileSize,
uri: file.uri,
}
);
return response.$id;
} catch (error) {
console.error("Error:", error);
}
};
This worked before, now it doesnt. Is this related to the endpoint problem? #Internal error (500) on custom domain
Can you print the endpoint url right before createFile?
something like this should help - console.log(client.config.endpoint);
the endpoint is a custom url
is it printed correct? should be -
https://<CUSTOM_URL>/v1
also verify that your custom domain points to the new region based api endpoint on Cloud.
You can check the url in your Project > Settings.
yes, and i configured it correctly
hmm, using the default or the new region domain for cnamed domain should work. do you have any more logs, or info. that you can share? A Network request failed doesn't give much info. except that the host might not be reachable or something's wrong with the url.
i set the cname correctly, like the region, i can enter the console from the custom domain, but on every page it says 500 internal error
Its sort of expected, you should use the Cloud console. Custom domain side console access has its own security considerations. This is going to be soon fixed where console should be only used via cloud console. Custom domains are meant to be used for API/Functions, atleast that was the historical intention. With multi-region, its been something we've thinking to fix soon!
alright thanks, but i if i use the cloud endpoint, i have to change my functions endpoints too, so there is no point having custom domain (?)
You are fine to use the custom domains endpoints for functions and sdks. If you have more info. on the network request failed, feel free to add here and we should be able to help.
You can also DM if the credentials cannot be shared publicly.
alright, if i find out something, ill let you know
thanks
Recommended threads
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- Cloud function deploy stucks in processi...
Been trying for the last hours to deploy my function but for whatever reason, alwasy stuck on processing!