
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 cname
d 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
- Stuck at pinging the server to finish ad...
I'm not using the starter app and I'm not sure how to finish connecting my app to Appwrite.io. Is there a CURL command I can run to finish setup?
- 500 internal error
I get a 500 internal error when trying to access my database on appwrite cloud. Sometimes it would start working but this time it never corrects.
- Error getting session: AppwriteException...
I get this error `Error getting session: AppwriteException: User (role: guests) missing scope (account)` when running in prod. As soon as I try running my app o...
