Support

Admin Tools

#39400 Access-Control-Allow-Origin issue

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.3.4
PHP version
8.1.22
Admin Tools version
7.3.4 Pro

Latest post by nicholas on Tuesday, 29 August 2023 05:41 CDT

pscarnegie

I've got an issue with J4's smart search indexer returning a "No access-control-allow-origin" error - but only when I'm trying to reindex through the admin side. I don't get the error if I run a CLI script from SSH.

I've tried adding to the .htaccess file:

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"

and I tried adding this to the .htaccess file:

<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>

but regardless, I get the following when I run the smart search indexer:

"An Error Has Occurred
The following message was returned by the server:
undefined"

and Chrome's webdev tools show's me this error:

Access to XMLHttpRequest at 'https://pmsa1.site-ym.com/members/public_profile.asp' (redirected from 'https://dev.pmsa.org/administrator/index.php?option=com_finder&tmpl=component&format=json&task=indexer.batch&e49a52ac0a94da285b162b7fa17686e2=1') from origin 'https://dev.pmsa.org' 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.

Is this a AdminTools configuration issue or something else? Again, don't see that error on the site itself, only when it throws that error on re-indexing.

pscarnegie

As an addendum to the original post, I also tried setting the Cross-Origin Resource Sharing (CORS) setting in admintools from the default "let the browser decide" to "explicitly allowed" and still got the same error.

nicholas
Akeeba Staff
Manager

I believe that you are using Joomla's System - HTTP Headers plugin. If you do not understand 100% what this plugin does and how to manage those headers, disable that plugin.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!