For Workes & Pages, what is the name of the domain?
save-high-res-images.azure-parking.pages.dev
& azure-parking.pages.dev
What is the issue or error you’re encountering
I am unable to fetch from within my deployed app. Cancelled requests with no error code or message
What steps have you taken to resolve the issue?
I have tested this on my local machine using node, and workerd and code works as expected. Hitting 3rd party API is not a problem. Image downloads and is successfully saved to R2 bucket on my local machine.
When I deploy to Cloudflare this fails in a very cryptic way. I have tried fetching from 2 domains now (same image, just served from different domains) and in both cases it fails without a message. the only indication something is wrong is that in the logs it shows the request was cancelled, but does not specify why it was cancelled
If I remove the fetch line everything else is working fine, and the fetch is wrapped in a try/catch with logs, but I don’t see anything in wrangler tail, except that the request was cancelled with no reason given.
In my other deployed app, it is hitting a different server and I can see it has error 521 (being printed by my many logs). By the absence of these logs in my first app (despite essentially the same code running on both apps)
A typical Cancelled response (no logs):
"truncated": false,
"outcome": "canceled",
"scriptName": "pages-worker--3401139-preview",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [],
"eventTimestamp": 1726681322417,
"event": {
"request": {
"url": "https://branch.XXX.pages.dev/event",
"method": "POST",
"headers": {
"accept": "text/html, application/json",
"accept-charset": "UTF-8",
"accept-encoding": "gzip, br",
"cf-connecting-ip": "18.212.67.35",
"cf-ipcountry": "US",
"cf-ray": "8c5321590ab858a8",
"cf-visitor": "{\"scheme\":\"https\"}",
"connection": "Keep-Alive",
"content-length": "37611",
"content-type": "application/json",
"host": "branch.XXX.pages.dev",
"user-agent": "(webhooks)",
"x-forwarded-proto": "https",
"x-real-ip": "18.212.67.35"
},
"cf": {
"clientTcpRtt": 1,
"longitude": "-77.49030",
"httpProtocol": "HTTP/1.1",
"tlsCipher": "AEAD-AES256-GCM-SHA384",
"continent": "NA",
"asn": 14618,
"country": "US",
"verifiedBotCategory": "",
"tlsClientAuth": {
"certIssuerDNLegacy": "",
"certIssuerSKI": "",
"certSubjectDNRFC2253": "",
"certSubjectDNLegacy": "",
"certFingerprintSHA256": "",
"certNotBefore": "",
"certSKI": "",
"certSerial": "",
"certIssuerDN": "",
"certVerified": "NONE",
"certNotAfter": "",
"certSubjectDN": "",
"certPresented": "0",
"certRevoked": "0",
"certIssuerSerial": "",
"certIssuerDNRFC2253": "",
"certFingerprintSHA1": ""
},
"tlsClientHelloLength": "508",
"tlsExportedAuthenticator": {
"clientFinished": "0a0eadb8c1d91fada935227051fd57c80e48ed77a6957a6903a0a5ea143c62f5065d827155b085646299c92a8b7face4",
"clientHandshake": "1e22de69912ae1cd51c237649ea34704c9fb360ae1e38ffcba29865e15e4233e2605fdb0ffe3649bc1b780cc3b44cf6c",
"serverHandshake": "0c72d1dbc98897fa81ef98774a05c8a1e2142bdf583cea269fe8cb7015747e9ba2e8aa8a84a491bb70ab5671a1badcb8",
"serverFinished": "31a9c018157cf9ce58173447cd22a31166e3cb2e07cdb08e1770fe6b2cf146bdaeb4b0ca6a4dbf6441384c029bdddd3b"
},
"tlsVersion": "TLSv1.3",
"city": "Ashburn",
"timezone": "America/New_York",
"tlsClientExtensionsSha1": "8mdbvvrtGYb/r69DcvRrZYgEGmg=",
"region": "Virginia",
"edgeRequestKeepAliveStatus": 1,
"requestPriority": "",
"latitude": "39.04690",
"postalCode": "20149",
"tlsClientRandom": "XoyhFkBc4nM8mZu3rluO0l6qbXMFjBe33/ThBWKTzLs=",
"regionCode": "VA",
"asOrganization": "Amazon.com",
"metroCode": "511",
"colo": "IAD",
"pagesHostName": "branch.XXX.pages.dev",
"botManagement": {
"corporateProxy": false,
"verifiedBot": false,
"jsDetection": {
"passed": false
},
"staticResource": false,
"detectionIds": {},
"score": 99
}
}
}
},
"id": 2
}```
A typical response from the other server (the one showing some logs):
```{
"truncated": false,
"outcome": "ok",
"scriptName": "pages-worker--3401139-production",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
"error code: 521"
],
"level": "error",
"timestamp": 1726681035449
},
{
"message": [
"Error: Failed to fetch image from XXXX server: http://vpn.xxx.co.uk:21155/img/XXX-YYY-ZZZ.jpg?company_id=AAAA"
],
"level": "error",
"timestamp": 1726681035449
},
{
"message": [
"Getting high res image took 109ms"
],
"level": "log",
"timestamp": 1726681035449
},
{
"message": [
"Error getting high res image"
],
"level": "error",
"timestamp": 1726681035449
}
],
"eventTimestamp": 1726681033028,
"event": {
"request": {
"url": "https://XXX.pages.dev/event",
"method": "POST",
"headers": {
"accept": "text/html, application/json",
"accept-charset": "UTF-8",
"accept-encoding": "gzip, br",
"cf-connecting-ip": "3.89.182.9",
"cf-ipcountry": "US",
"cf-ray": "8c531a4858cd0784",
"cf-visitor": "{\"scheme\":\"https\"}",
"connection": "Keep-Alive",
"content-length": "44256",
"content-type": "application/json",
"host": "XXX.pages.dev",
"user-agent": "(webhooks)",
"x-forwarded-proto": "https",
"x-real-ip": "3.89.182.9"
},
"cf": {
"clientTcpRtt": 1,
"longitude": "-77.49030",
"httpProtocol": "HTTP/1.1",
"tlsCipher": "AEAD-AES256-GCM-SHA384",
"continent": "NA",
"asn": 14618,
"country": "US",
"verifiedBotCategory": "",
"tlsClientAuth": {
"certIssuerDNLegacy": "",
"certIssuerSKI": "",
"certSubjectDNRFC2253": "",
"certSubjectDNLegacy": "",
"certFingerprintSHA256": "",
"certNotBefore": "",
"certSKI": "",
"certSerial": "",
"certIssuerDN": "",
"certVerified": "NONE",
"certNotAfter": "",
"certSubjectDN": "",
"certPresented": "0",
"certRevoked": "0",
"certIssuerSerial": "",
"certIssuerDNRFC2253": "",
"certFingerprintSHA1": ""
},
"tlsClientHelloLength": "508",
"tlsExportedAuthenticator": {
"clientFinished": "07384b66726bbf30f3301b4473de3764bd2a55f3289df293f78f60a1944001c713ab9c5d079f6e26f6b1fba5ae651846",
"clientHandshake": "d5d93db8a887345f3d68986cbdef718bdc1f14e8f1da919004133ca5effbd059957424dbdaee01079837952bf90a1d4e",
"serverHandshake": "de200ebbbc846d3112b4a100d7d3e112be2c03b11f2ec90d487a3855347338985fb739dbc1859eae7d8783e3c6aca491",
"serverFinished": "6f84a2ea92d80f813c3eb046a0e9b601df9faa114da57357b7e5d33deeadaaf93581a5e6329b049b482c65d2482260ed"
},
"tlsVersion": "TLSv1.3",
"city": "Ashburn",
"timezone": "America/New_York",
"tlsClientExtensionsSha1": "8mdbvvrtGYb/r69DcvRrZYgEGmg=",
"region": "Virginia",
"edgeRequestKeepAliveStatus": 1,
"requestPriority": "",
"latitude": "39.04690",
"postalCode": "20149",
"tlsClientRandom": "+3DJLSlSa+C4i+Bh2U6L1ozKYqTZ7C8sH/rJHfBhyq4=",
"regionCode": "VA",
"asOrganization": "Amazon.com",
"metroCode": "511",
"colo": "IAD",
"pagesHostName": "XXX.pages.dev",
"botManagement": {
"corporateProxy": false,
"verifiedBot": false,
"jsDetection": {
"passed": false
},
"staticResource": false,
"detectionIds": {},
"score": 99
}
}
},
"response": {
"status": 200
}
},
"id": 1
}```
### What are the steps to reproduce the issue?
Deploy a remix app with a resource route handler that accepts post requests.(eg POST to `/webhook`)
Use fetch to get an image (maybe from unsplash or similar) from withing the request handler/endpoint
Deploy the app to pages
Make a post request to the endpoint you create (eg POST to `YOUR_APP.pages.dev/webhook`)
Check if you get a valid response, or if it is Cancelled
### Screenshot of the error
![Screenshot 2024-09-18 180442.png|1293x1100](upload://9NZo9mPufue9S6fch1MCFdOzxJU.png)