Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS 'Access-Control-Allow-Origin' header missing in responses #16479

Closed
diegofmole opened this issue Jan 25, 2023 · 3 comments · Fixed by #16713
Closed

CORS 'Access-Control-Allow-Origin' header missing in responses #16479

diegofmole opened this issue Jan 25, 2023 · 3 comments · Fixed by #16713
Assignees

Comments

@diegofmole
Copy link

This is related with the issue #11111.
We had just faced that issue in our kubernetes environment (we don't use helm charts there) and, as it was said in the previous issue, the root cause was related to minIO configs that were corrupted.

I want to share the way to fix it, as in the other issue some people suggest to recreate the volume so the configs were created again, but that was not possible in our env, and I guess is not always posible to delete the existing volume.

We tried to manually set the cors config again using the minIO CLI, and there is how the solution to the problem appeared!

user@user-mbp minio % mc admin config set dc-fs api "cors_allow_origin=*"
mc: <ERROR> Unable to set 'api cors_allow_origin=*' to server: found invalid keys (extend_list_cache_life=0s ) for 'api' sub-system, use 'mc admin config reset myminio api' to fix invalid keys.

user@user-mbp minio % mc admin config reset dc-fs api
Key is successfully reset.

user@user-mbp minio % mc admin config set dc-fs api "cors_allow_origin=*"
Successfully applied new settings.

How we narrow down the issue to a minIO config issue that only appears after the upgrade?
CORS wasn't working in one env that was updated some time ago, but it was working fine in another env that was still using a previous minIO version. We upgrade that env that was working fine, and we started facing the CORS issue there, meaning that after the upgrade, minIO brakes the CORS config in some way. But, using that new minIO version with a fresh installation, that was working fine. So the problem only raised after the upgrade.

Originally posted by @harshavardhana in #11111 (comment)

@harshavardhana
Copy link
Member

harshavardhana commented Jan 25, 2023

user@user-mbp minio % mc admin config set dc-fs api "cors_allow_origin=*"

which version of MinIO are you running @diegofmole - please provide more details in your issue report.

Please provide details on which version to which version the upgrade was performed.

@diegofmole
Copy link
Author

We were using:

  • RELEASE.2021-06-14T01-29-23Z tag

And we upgrade to:

  • RELEASE.2022-11-26T22-43-32Z tag

@harshavardhana
Copy link
Member

Its because of deprecated keys

mc: Unable to set 'api cors_allow_origin=*' to server: found invalid keys (extend_list_cache_life=0s ) for 'api' sub-system, use 'mc admin config reset myminio api' to fix invalid keys.

Let me check what challenges are here and if we can automatically handle it.

@harshavardhana harshavardhana self-assigned this Jan 25, 2023
harshavardhana added a commit to harshavardhana/minio that referenced this issue Feb 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants