Problem with Cloudflare Worker Image on specific Cloudflare data centers

We are starting to have problems with our Cloudflare worker which we are using to resize images. The problem started for 16 hours ago. In CPH if fails but in AMS it works. To show the error I have created a super simple worker, see below I have recorded a video showcasing the error https://www.youtube.com/watch?v=PhmfZehZXcY addEventListener("fetch", event => { event.respondWith(handleRequest(event.request)) }) const getLastItem = thePath => thePath.substring(thePath.lastIndexOf('/') + 1) async function handleRequest(request) { let url = new URL(request.url) let imageURL = "https://cloudflaretesting.blob.core.windows.net/assets/TESTCHPA0000.jpg"; let action = getLastItem(url.pathname); let options = { cf: { image: { width: 200, height: 200 }, }}; if (action == "resize") { // https://assets.cdnlemu.dk/cloudflare/test/image/resize // On some Cloudflare data centers gives: // ERROR 9408: Could not fetch the image — the server returned HTTP error 400 Bad Request return fetch(imageURL, options); } else { //https://assets.cdnlemu.dk/cloudflare/test/image/ // Returns the image without image modifications return fetch(imageURL); } }
Christian Palm
YouTube
cloudflare image worker data center error
Source code: https://gist.github.com/lm-chpa/c2cc08ba039628326cda2fa86e213df8 https://assets.cdnlemu.dk/cloudflare/test/image/resize On some Cloudflare data centers gives: ERROR 9408: Could not fetch the image — the server returned HTTP error 400 Bad Request https://assets.cdnlemu.dk/cloudflare/test/image/ Returns the image without image modif...
1 Reply
Palm
PalmOP13mo ago
It turns out, that when adding the image option, Cloudflare will change the origin url from https to http. But only in some data centers. The temporary soution was to disable require secure transfer in the Azure storage configuration more info here https://community.cloudflare.com/t/problem-with-cloudflare-worker-image-on-specific-datacenter-cph-ams-and-fra-is-working-fine/575660/8
Cloudflare Community
Problem with Cloudflare Worker Image on specific datacenter CPH. AM...
Yes it seems to relate to Azure Blob Storage. I have created a AWS S3 storage and uploaded a image And created a new worker using the AWS S3 and that is working fine, no matter which Cloudflare data center is used NB I tried to switch from Azure Blob in West Europe to US and that did not change anything
Want results from more Discord servers?
Add your server