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
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Create a new paid tier
Current pricing seems reasonable enough about what is someone getting for 25$. But for some people most of these resouces are getting wasted. Like the bandwidt...
- [Bug] Appwrite Auth User Prefs
User prefs are decoded as blank although there are plenty of data and add preference button not working in this case