CSRF Failed: Origin checking failed - [domain url] does not match any trusted origins #8782
Open
2 tasks done
Labels
bug
Something isn't working
Actions before raising this issue
Steps to Reproduce
Installed CVAT version 2.10.1 using Docker, cloned from GitHub, and followed the "Quick Installation Guide" meticulously.
Specified the CVAT_HOST environment variable with my custom domain name which has the DNS record of the external IP of my instance.
Logged into the application successfully.
Navigated to the admin page and accessed user properties successfully.
Attempted to save changes in the admin interface via the SAVE button.
Observed Behavior:
When I try to make any changes or click on "edit" icon on any of the existing tasks, I see the below error
"CSRF Failed: Origin checking failed - [domain url] does not match any trusted origins"
Expected Behavior
POST operations from the /admin page should not encounter a CSRF verification failure since access to the rest of the application works as expected.
Possible Solution
I reviewed a similar GitHub issue (#7382) and followed the suggested troubleshooting steps.
Made changes in settings.py:
Added my domain to CSRF_TRUSTED_ORIGINS.
Verified that the ALLOWED_HOSTS configuration is correct.
Followed the CVAT installation guide meticulously from https://docs.cvat.ai/docs/administration/basics/installation/
Context
Environment Variable:
Exported the CVAT_HOST environment variable and set it to my domain. All data was accessible, but the CSRF error persists during admin edits.
Public IP vs. Domain:
When accessing via the public IP of the instance, the issue is not reproducible.
However, the error consistently occurs when using my custom domain name.
Base URL in docker-compose.yml:
Updated the CVAT server section in the docker-compose.yml file, adding the base_url parameter. However, the issue persists.
Example: Allowed origins are already set to *.
Environment
The text was updated successfully, but these errors were encountered: