Universal Links - SWCERR00305 - denied because the CDN told us to stop with HTTP status 404

Hey Folks!

Maybe someone can point me into the right direction. I have an App which should be opened by the associated domain.

I think on the xcode-side I did everything right as I can see the swcd trigger in the console on fresh install. here is the output:

Code Block
Request for '<private>' for task AASA-1C727A71-EAC0-4EF7-8F40-0EB4DBFAAFFF { domain: me….do….de, bytes: 0, route: cdn } denied because the CDN told us to stop with HTTP status 404: SWCERR00305 Network error -- {"cause":"EOF"}

Serverside I hosted the apple-app-site-association file in the .well-known directory like so:
Code Block {
"appIDs": [ "69NHXD8TDC.org.natgo.dolspotmeet" ],
"components": [
{
"/": "/*",
"comment": "Matches any URL"
}
],
"defaults": { "caseSensitive": false }
}


When I curl the file its perfectly reachable:

Code Block
curl -v https://meet.dolspot.de/.well-known/apple-app-site-association


Output:
Code Block
HTTP/2 200
server: nginx/1.14.0 (Ubuntu)
date: Tue, 26 Jan 2021 15:15:56 GMT
content-type: application/pkcs7-mime
content-length: 183
last-modified: Tue, 26 Jan 2021 15:05:07 GMT
etag: "60102fa3-b7"
strict-transport-security: max-age=31536000
accept-ranges: bytes
{
"appIDs": [ "69NHXD8TDC.org.natgo.dolspotmeet" ],
"components": [
{
"/": "/*",
"comment": "Matches any URL"
}
],
"defaults": { "caseSensitive": false }
}%


As you can see I also already changed the served Application-type to application/pkcs7-mime in the nginx config.

I really dont understand why apples crawler wont crawl this. In the server access logs I am not able to see any accesses from the AASA-Bot. Also I deleted any robots.txt in the corresponding directory, so the bot shouldnt be blocked.

The Error is reproducable when hitting the following curl:
Code Block
curl -v https://app-site-association.cdn-apple.com/a/v1/meet.dolspot.de

Resulting in the following:
Code Block
< HTTP/1.1 404 Not Found
< Date: Tue, 26 Jan 2021 15:05:40 GMT
< Content-Length: 0
< Apple-Failure-Details: {"cause":"EOF"}
< Apple-Failure-Reason: SWCERR00305 Network error
< Apple-From: https://meet.dolspot.de/.well-known/apple-app-site-association
< Apple-Try-Direct: false
< Cache-Control: max-age=1800,public
< Age: 825
< Via: https/1.1 uklon5-vp-vst-007.ts.apple.com (ApacheTrafficServer/8.1.0), https/1.1 uklon5-vp-vfe-005.ts.apple.com (ApacheTrafficServer/8.1.1), http/1.1 dedus1-edge-lx-002.ts.apple.com (ApacheTrafficServer/8.1.1), https/1.1 dedus1-edge-bx-002.ts.apple.com (ApacheTrafficServer/8.1.1)
< Server: ATS/8.1.1
< CDNUUID: 09a85634-db60-46ba-8a28-5d22021aaf4a-18339802882
< X-Cache: miss, hit-fresh, hit-stale, miss
< Expires: Tue, 26 Jan 2021 15:05:50 GMT
< Connection: keep-alive
<
* Connection #0 to host app-site-association.cdn-apple.com left intact
* Closing connection 0


I am pretty much at the end of my troubleshooting-journey and would greatly appreciate any help on this 🙂

Cheers

Kian



Hi Kian1991,

The 404 response means that for some reason your website is blocking the Apple CDN from accessing the AASA file, and you might need to ask your hosting provider for advice. Also, you should use MIME type application/json. I hope this helps.
Were you able to solve this @Kian1991? I'm also not sure how to debug this further. In the console I found the exact error you have:


Request for '<private>' for task AASA-43125F81-FE26-4132-9AA3-370970059919 { domain: ….com, bytes: 0, route: cdn } denied because the CDN told us to stop with HTTP status 404: SWCERR00305 Network error -- {"cause":"dial tcp 162.255.119.167:443: connect: connection refused"}

The only idea I have now is to just wait a few days and see if the CDN refreshes as initially I mistakingly had an extra comma in the JSON, which is a frustrating way to debug things. Have you tried Apple's Validation Tool? What do you get in the Link to Application row? I get "Error no apps associated with url".

Edit: I just tried my website on the URL in your post:

https://app-site-association.cdn-apple.com/a/v1/

and it returned the correct JSON. Not sure what's going on!

Edit 2: I deleted then re-installed the app and it seems to be working now.

One thing I noticed is the URL you have prompts me to download the file on Safari, which is not supposed to happen. I'm not familiar with how file downloads are implemented, but this file should be presented the same as CSS or JS files, just text content.
Universal Links - SWCERR00305 - denied because the CDN told us to stop with HTTP status 404
 
 
Q