No 'Access-Control-Allow-Origin' header is present on the requested resource

Article ID:360033062012
1 minute readKnowledge base

Issue

You are seeing an error in the build console:

Access to XMLHttpRequest at "https://JENKINS_URL/SOME_REQUEST" from "https://JENKINS_URL/" has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Resolution

We can see from the error message that Jenkins is calling an HTTP endpoint from an HTTPS origin. The first question to ask yourself is whether this is expected. Is SSL implemented correctly? If not, please change the Jenkins URL in Manage Jenkins -→ Configure Systems to HTTP until SSL is ready to use.

Workaround

Use the CORS Filter Plugin to include the additional origins.