Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Problem with Cloudflare Worker Image on specific Cloudflare data centers - Cloudflare Developers
CD
Cloudflare Developers
•
3y ago
•
1 reply
Palm
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
)
;
}
}
YouTube
Christian Palm
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
.
.
.
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Was this page helpful?
Yes
No
Similar Threads
Similar Threads
How to exclude specific data centers (colos) from Worker routing?
CD
Cloudflare Developers / workers-and-pages-help
8mo ago
Specific Worker Access in Cloudflare Team
CD
Cloudflare Developers / workers-and-pages-help
10mo ago
Cant get worker to overlay image hosted on cloudflare
CD
Cloudflare Developers / workers-and-pages-help
11mo ago
Mariadb with cloudflare worker
CD
Cloudflare Developers / workers-and-pages-help
3y ago