Good afternoon everyone! I am having issues with ...
# gooddata-ui
s
Good afternoon everyone! I am having issues with CORS, similar to the one @Vincil Bishop has been running into in his question a couple of weeks ago, which sadly hasn't been answered yet. On the GoodData documentation pages I found the following page. Which goes through how to add allowedOrigins to the organizations, no matter what I put there it won't make the error go away. Our requirement is to authenticate with a API token. However whenever I try to do that, the GoodData backend seems to throw a CORS error with the reason
Reason: header 'authorization' is not allowed according to header 'Access-Control-Allow-Headers' from CORS preflight response
. I have had contact with Vincil and to us it seems like it could be a bug. But maybe we're mistaken, is there a simple way to fix this error? Things worthy of note: • We're both running Angular 12 • We're both using the local version of GoodData.CN both at version 1.7.2 Best regards, Stijn
j
@Dan Homola @Peter Plochan @Robert Moucha please, help here, there are multiple people affected...
p
Well, we’re really not sending this header in the preflight response. Let’s discuss it internally if there’s any workaround or if only new fixed version will help.
🙌 1
j
Btw. as an alternative, you can use tag dev_latest instead of 1.7.2, it provides the latest greatest version, where all fixes are applied.
v
It's my intention to switch to 1.8, but it requires model updates... and I don't have time to do those just yet
but great to know if this is fixed in 1.8... that I think would be an acceptable fix and solve everything
p
@Vincil Bishop this is misunderstanding. @Jan Soubusta meant the development version (the one released every week). But the fix is not delivered anywhere yet.
v
ah ok
sure no problem
for me... it's all non-prod for the moment... so while I would like to have it fixed... and it seems like it should work the way we think... it's in no way blocking my progress
but... would be super cool to have that fixed
and... I will move to 1.8 ASAP... I just have to address the model changes between 1.7 -> 1.8
j
Release 2.0 has just been released, feel free to use it
Because it is major release, there are breaking changes. Please, follow the release notes: https://support.gooddata.com/hc/en-us/articles/7742169522579-GoodData-CN-2-0-0-Release-Notes#upgrade-guides
s
@Jan Soubusta It seems like the new major version has not fixed the CORS error. I still get the same
Reason: header 'authorization' is not allowed according to header 'Access-Control-Allow-Headers' from CORS preflight response
Error.
j
@Peter Plochan I am confused. Is a fix covering the @Vincil Bishop problem a part of the latest release? If yes, is there anything @Vincil Bishop would have to do in our platform in addition (any kind of CORS config)?
p
@Jan Soubusta no, the fix is planned to be delivered in the version
2.1
.
s
Alright, is there any time-frame known for that release? Just like @Vincil Bishop it's not blocking us, yet. But we can not go into production without the fix, assuming the CE is representative of the non-CE version
Or is it irrelevant, because the authentication is different in a licensed version?
r
CE uses embedded nginx web server with preconfigured static CORS setup. Full-scale deployment runs on kubernetes and there are broader possibilities to configure such changes through ingress controller. The missing PATCH method and Authorization header in CE edition is a bug that will be fixed in the next version (sorry, I don't know the time frame). But if you want, I can guide you how to fix that locally in CE container. It's a minor config change in nginx config file template. So you can proceed with testing immediately and you don't need to wait for 2.1 version. Just let me know and I will describe the ssteps needed to workaround this problem tomorrow.
❤️ 2
s
@Robert Moucha Thank you for your response, if you could send me those steps that would be great.
r
1. Copy nginx template file out from the image:
Copy code
docker run -it --rm --name temporary -d --entrypoint bash gooddata/gooddata-cn-ce:2.0.0
docker cp temporary:/etc/nginx/conf.d/cloudnative.conf.tmpl .
docker stop temporary
Now you can find a file
cloudnative.conf.tmpl
in the current directory. Open it in some text editor and modify lines 33 and 34: * add
PATCH
method to
$CORS_METHODS
variable: set $CORS_METHODS '*PATCH,* GET, POST, PUT, DELETE, OPTIONS'; * add
Authorization
header to `$CORS_HEADERS`: set $CORS_HEADERS '*Authorization,* Accept, Accept-Language, Authentication-Token, Cache-Control, ... etc, keep the rest of the line unchanged Save the file and try starting a new GoodData.CN CE container with overridden nginx template:
Copy code
docker run -it --rm -p 3000:3000 -v $PWD/cloudnative.conf.tmpl:/etc/nginx/conf.d/cloudnative.conf.tmpl ...other docker opts... gooddata/gooddata-cn-ce:2.0.0
Until the fix is published with the new version, you'd need to pass
-v $PWD/cloudnative.conf.tmpl:/etc/nginx/conf.d/cloudnative.conf.tmpl
when starting a new container.
❤️ 1
I know the the steps are bit clumsy, sorry for that. But it needs to be done just once and then you may reuse the cloudnative.conf.tmpl file.