Closed (fixed)
Project:
CDN
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Oct 2017 at 09:46 UTC
Updated:
26 Dec 2019 at 09:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersThanks for reporting this issue! Looking into this now :)
Comment #3
wim leersI spent more than an hour on #2854817: Duplicate X-Content-Type-Options headers both with the value nosniff. I had to give up. See #2854817-11: Duplicate X-Content-Type-Options headers both with the value nosniff + #2854817-12: Duplicate X-Content-Type-Options headers both with the value nosniff.
Comment #4
wim leersCan you post a screenshot of what that response looks like?
Can you also please export your
cdn.settingsconfig? You can do that at/admin/config/development/configuration/single/export— it's of the "Simple configuration" configuration type.Comment #5
wim leersI can't help you without more information. After >3 weeks of waiting for more information, I'm closing this, because it doesn't look like this information will ever follow.
Feel free to reopen!
Comment #6
millionleaves commentedRe-opening.
I'm experiencing this issue. CKEditor doesn't work if CDN is enabled with Amazon Cloudfront.
Here's the log from the Chrome console. Let me know if you need more information.
Comment #7
wim leersIf you load
https://randomcode.cloudfront.net/cdn/farfuture/vRNUFFoVIBLXYTJfjXQOupHs5I2VJig2Le9Fll-0LrU/1530738491/core/assets/vendor/ckeditor/lang/en.js?t=pbkn7i, what does the response look like?Comment #8
millionleaves commentedI get an Access Denied error in Drupal.
When visiting using a web sniffer, I get the following response. The Expires line is obviously wrong.
Comment #9
wim leersWhat does the response body look like? Does it contain
Invalid security token.?Comment #10
wim leersWithout a response to #9, I can't help you. I really do want to help you!
Comment #11
millionleaves commentedHi Wim.
Thanks. I messaged you privately via Drupal.org just after your last post a month or so ago. I'm guessing you didn't receive it?
Comment #12
wim leersUgh. I did, but I missed it. Sorry! Stay tuned.
Comment #13
wim leersSo you wrote
… but since the response is a 403, of course it cannot work. Next step: figure out why it's a 403.
I'm 99% certain that this code in
\Drupal\cdn\CdnFarfutureController::download()is causing the 403:i.e. the provided security token is not matching, and
AccessDeniedHttpExceptionis converted to a HTML 403 response by\Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::on403().This is poor DX and should be fixed.
Comment #14
wim leersThis is a test-only patch that should fail, proving the DX problem described in #13.
Comment #15
wim leersAnd here's the fix.
Comment #16
wim leersThis should help confirm that it's indeed this "incorrect security token" that's causing the 403.
Next step: figuring out why that security token is invalid in your case. I'm assuming you did try clicking the "Clear all caches" button at
/admin/config/development/performance?Assuming you did, do you have any modules installed that extend/enhance/alter CKEditor?
Comment #18
wim leersAlright, that worked 👍
Now I need feedback for #16 :) It'd be great if you could apply #15 to your site and confirm that that 403 is no longer returning a HTML response, but just a plain text response containing:
Comment #19
wim leersComment #20
millionleaves commentedPatch #15 applied, but I'm not seeing anything different in the Chrome console.
Comment #21
wim leersSorry for not being more clear.
I never said that patch would fix your problem. I said it'd help confirm the root cause of the problem. I just checked the URL you sent me in private, and it almost is confirmed, but the concrete error message is missing. This should make that error message show up and confirm it 100%.
Comment #22
asak commentedI hit the same issues, tested the patch in 21 and i can confirm that the 403 now shows
{"message":"Invalid security token."}instead of the Drupal "Access Denied" page when trying to access the filehttps://snap.mydomain.com/cdn/farfuture/LPro....J2A/1536185780/core/assets/vendor/ckeditor/lang/en.js?t=peomou.So now that we know for certain that that is the actual problem - what's the fix? :)
Comment #23
wim leers@asak Thanks for confirming!
I'll try to figure out how/why this is happening. Blocked on me now.
Comment #24
Vladimir Tanovic commentedI can confirm this issue exists too. I am using CDN module with KeyCDN provider and CKEditor crashes when JS files are served by CDN.
Comment #25
wim leersReproduced. This is actually the very reason #2827998: Add a new default option to the CDN UI: "all files except CSS+JS", and make this the new default of the CDN module, include upgrade path was done, and it was asked before in #2849041: CKEditor translation JS files cannot be loaded (403) when using Interface Translation + "Serve all files" + "Forever cacheable files". Detailed answer at #2849041-3: CKEditor translation JS files cannot be loaded (403) when using Interface Translation + "Serve all files" + "Forever cacheable files".
I'm very sorry this took so long to figure out :(
Comment #26
wim leersComment #28
wim leersFYI: a potential solution for this was posted at #3061110-11: Automatically prevent CKEditor from loading from the CDN when far future functionality is enabled.