Skip to content
Back

CORS Problem

  • 0
  • Web
  • Cloud
Andrei Giura
8 Oct, 2025, 12:23

Hello,

I have the following situation. I had a website defined and deployed, deploying from github. I have accidentally deleted my github repository. I have recreated my github repository, but i could not re-link it to the existing site. I have created a new site and linked the new repository with the same name as previous. I have deployed the website. I have added the new website origin as platfom, and deleted the old ones.

------All good so far.

Now the problem is that i get cors errors when the website tries to access the database (logins, documents, etc...):

/login:1 Access to fetch at 'https://cloud.appwrite.io/v1/databases/main_database/collections/table_sessions/documents?queries%5B0%5D=%7B%22method%22%3A%22equal%22%2C%22attribute%22%3A%22status%22%2C%22values%22%3A%5B%22active%22%5D%7D&queries%5B1%5D=%7B%22method%22%3A%22lessThan%22%2C%22attribute%22%3A%22expiresAt%22%2C%22values%22%3A%5B%222025-10-08T12%3A21%3A06.048Z%22%5D%7D' from origin 'https://qr-restaurant.appwrite.network' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost' that is not equal to the supplied origin. Have the server send the header with a valid value.

TL;DR
Developers accidentally deleted their GitHub repository connected to the website, recreated it with the same name, but faced CORS errors when trying to access the database. The issue is with the 'Access-Control-Allow-Origin' header not matching the origin. Solution: Server needs to send the header with a valid value matching the website's URL.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more