fetch failed during build process

Hello, this is the build id 5d2b77a7-9b6c-4565-b2cb-6372c8bab494 During the build process are fetched some files that are stored into a R2 storage named mostrum-cms As you can see from the build logs there is this error 12:37:00.875 [error] Can't load image https://*****_454af3e47a.jpg: fetch failed This error doesn't occur every time or on the same image resource, could you pleas check from your network logs what's the problem? Thanks
55 Replies
Alessandro
Alessandro9mo ago
@Cloudflare (Server Owner) hello, can someone help me? Thanks UP hello @Community Champion sorry for the direct tag, could you please check my request? I'm still stuck. Thanks
zegevlier
zegevlier9mo ago
Don't ping champs for support
Isaac McFadyen
Isaac McFadyen9mo ago
Please don't ping roles or community members for support. By pinging people they're actually less likely to help you since you've interrupted whatever they were doing or in the middle of.
Alessandro
Alessandro9mo ago
I understand but I don't get support and my issue still persists I'm a CF pages paying user.. what should I do?
Erisa
Erisa9mo ago
This community is not an official support channel, to get official support you need to create a support ticket. Pinging people in the community is not the way to go, they are here to volunteer in their own time and not to provide professional support. That includes myself, though I work for Customer Support my presence here is of my own volition and I am volunteering time to help out here
Alessandro
Alessandro9mo ago
I understand, but I can't open tickets.. Workers&Pages paid plan don't let to create tickets. Ok, I don't have a business CF account but I only need support on the service I'm paying for. So please, could someone help me what is the problem?
Cyb3r-Jak3
Cyb3r-Jak39mo ago
What are you using to fetch the images? Is there a way to get more verbose errors/ retry with it
Alessandro
Alessandro9mo ago
Hi @Cyb3r-Jok3 , I'm using an external library that renders a vuejs component and takes a screenshot to create a png resource. The vuejs component inject another image resource linking it using a CF R2 storage public URL stored on the same CF account. What is strange is that with the same resource the 1st run get the error, if I start a new build it doesn't get the error. Should be anything related to the R2 DNS or any kind of network routing?
Cyb3r-Jak3
Cyb3r-Jak39mo ago
Without better logs can’t tell the reason it would be failing. I would check to see if you can increase the logging level of the external library
Alessandro
Alessandro9mo ago
@Cyb3r-Jok3 I can't increase the logs cause the web app is built by CF directly, building it locally with wrangler works fine. Please look at the build log 5d2b77a7-9b6c-4565-b2cb-6372c8bab494
Alessandro
Alessandro9mo ago
No description
Cyb3r-Jak3
Cyb3r-Jak39mo ago
I’m not a Cloudflare employee so I don’t have access to any logs. You can try using node 20 as I know there were some issues with node versions under with how the TLS connections were handled.
Alessandro
Alessandro9mo ago
@Cyb3r-Jok3 ok sorry, didn't know. How can I get support from CF technical team? Thanks
zegevlier
zegevlier9mo ago
?support
Flare
Flare9mo ago
To contact Cloudflare Support about an issue, please visit the Support Portal and fill in the form on the portal. After submission, you will receive confirmation over email. Some issues, such as Account or Billing related issues, cannot be solved by the community. Any plan level can open a ticket for these topics. For more information on the methods by which you can contact Support for your plan level, see Contacting Cloudflare Support - Cloudflare Docs
Alessandro
Alessandro9mo ago
Hello, I can't open tickets, I'm only paying for pages and workers pro plan. At that link CF suggest to ask here on Discord or in the community forum (already done both). Is there anyone from the tech team here?
Ayaan
Ayaan9mo ago
Yes we have but you should open ticket in support portal after CF outage solves.
Alessandro
Alessandro9mo ago
@Minsu Kim I can't open tickets, workers&pages paid plan doesn't allow it. 😩 CF team help 😞 yesterday I got the error again... please tell me why the http request resolution fails.
kian
kian9mo ago
I think there's a typo in your URL (for Matteo) - https://cms-bucket.mostrum.com//1/app_design_progettazione_454af3e47a.jpg
itsmatteomanf
itsmatteomanf9mo ago
Oh yeah, there is a t instead of an i 🙈 It doesn’t load here, too…
kian
kian9mo ago
It is just infinitely spinning in Discord for me though Opens fine in a blobcatthonking
itsmatteomanf
itsmatteomanf9mo ago
Some security thing? I assume it’s on CF, @Alessandro, check the firewall logs 🙂
Alessandro
Alessandro9mo ago
Hi! ok, let me check..
Chaika
Chaika9mo ago
I doubt CF keeps full unsampled logs of every network request from every build anyway, the environment you get is a pretty full featured Ubuntu os though, you could just change your build command to curl that file for example curl https://cms-bucket.mostrum.com//1/app_design_progettazione_454af3e47a.jpg -vvv i did it to test and it looks ok, no challenge for mine, worth checking though, could be a different User Agent the build tool uses or something, or the image really is messed up in some way
What is strange is that with the same resource the 1st run get the error, if I start a new build it doesn't get the error.
Sounds like cache may be transforming it or something? hmm, good question would be if you get the same issues locally
No description
Alessandro
Alessandro9mo ago
Looking at sec logs I didn't find errors, @Chaika locally I don't get any issue locally and the build cache is disabled
Chaika
Chaika9mo ago
no but the actual image itself is cachable/getting cached after the first request, and CF can transform images in cache (ex. that's the place where polish/etc gets applied, if enabled) (Not by the Pages project, but by virtue of the image being behind cf cdn)
Alessandro
Alessandro9mo ago
Looking at the DNS config, the "cms" CNAME rule is proxied by CF. Maybe is it the problem? 🤔 I can try to disable it
itsmatteomanf
itsmatteomanf9mo ago
But if it hit the firewall it should be there…
Chaika
Chaika9mo ago
If you're talking about my mention of unsampled logs, he was asking for the start for the Pages team to look at the network logs from the build, my comment was about that If you can, it's not a bad idea, should give more info one way or another, would also exclude any possibility of the request being blocked
Alessandro
Alessandro9mo ago
Is it a bad practice to keep CF proxy enabled on a DNS R2 rule?
Chaika
Chaika9mo ago
oh lol it's an r2 origin? Then proxied or not it's always going to be through the cdn thought you couldn't even edit those anyway
Alessandro
Alessandro9mo ago
Yes, it's a R2 resource Maybe accessing it through the auto generated R2 public url? (so without using the personalized one)
Chaika
Chaika9mo ago
Do you have any other images being loaded from that bucket/custom domain?
Alessandro
Alessandro9mo ago
yep, a lot, only one per build fails.. randomly
Chaika
Chaika9mo ago
Randomly in the sense it's a different one each time, or it's the same one, failing randomly?
Alessandro
Alessandro9mo ago
different one each time
itsmatteomanf
itsmatteomanf9mo ago
Any chance you can just use the internal binding to fetch those instead of doing the normal fetch?
Alessandro
Alessandro9mo ago
but if i start another built in the closest to the prev one all images are loaded correctly
Chaika
Chaika9mo ago
it's during build, not function/worker execution
Alessandro
Alessandro9mo ago
yep, I can try
itsmatteomanf
itsmatteomanf9mo ago
Oh, dumb me 🙈
Chaika
Chaika9mo ago
would be nice though the r2 pub domain is ratelimited and not meant for production DId you get a chance to check Security -> Events as matteo suggested?
Alessandro
Alessandro9mo ago
Sure, already checked, here it is:
No description
Alessandro
Alessandro9mo ago
yesterday (6th nov) I got the last build issue as you can see the activity log is empty
Chaika
Chaika9mo ago
What's the build setup you're using, nitro with some framework? Any way to get better logs out of it then "fetch failed"? Increase timeouts, etc?
Alessandro
Alessandro9mo ago
The web app is made using vue/nuxt, and it's build using the nitro preset config. I have already asked the owner of the js lib that is causing this issue if it can be related to a timeout but increasing it didn't resolve the problem. Essentially, this lib create a png file using satori lib, satori make a screenshot of a vue component when rendered. In the vue component there is an html tag that uses the failing image resource as a background css rule.
Chaika
Chaika9mo ago
hmm, so do you know where that error is being thrown from? I can't find can't load image or fetch failed in satori or nitro Could it be nuxt server-side rendering that, and satori throwing that and it's reflected down the build? Weird too that it doesn't stop/kill the build, wonder if you couldn't put in some retries there or something
Alessandro
Alessandro9mo ago
Looking at satori source code I can find the error can't load image but searching with github in the current last version it doesn't exist I must try to update my dependency (if I can cause in this case satori is not a primary dependency) Let me investigate, I'll come back
Chaika
Chaika9mo ago
Interesting.. I see it was removed here: https://github.com/vercel/satori/commit/52fa760e63656900f482e85a5ffc481dd2b4b818 and some more image types were supported When it errors out like that, does it actually mess up the output (i.e the image is missing)? actually nvm even in the latest version it's still there at the same spot: https://github.com/vercel/satori/blob/a2abe37948071414ba93d2e084e1c09dad5c4899/src/handler/image.ts#L266C13-L266C13 Still, worth updating and seeing if they haven't fixed anything
Alessandro
Alessandro9mo ago
do you intend the final rendered image?
Chaika
Chaika9mo ago
My question was just if it effects it at all yea, it looks like there's a few other moving parts there with cache and whatnot
Alessandro
Alessandro9mo ago
simply satori renders it as a black image yep, satori uses something like a cache layer but if I'm not wrong I have disabled it (if I remember well)
Chaika
Chaika9mo ago
I don't think you did considering the image file has this at the top
* TODO: We might want another option to disable image caching by default.
lol
Alessandro
Alessandro9mo ago
omg lol ahah, in this case the cache I have disabled works for something different maybe it cache the rendering result (i'm rebuilding the app with the last satori version) ok, nitro builded without errors, but I can't be sure the issue is resolve, this could be one of the cases where it works 😦 I'll monitor for now, thank you guys for the hints, really appreciated