I'm making a request to get 10 artists with their top songs at once, but for some artists it will always fail with a 504. The response is also in HTML which leads to a decoding error. This is my code
var request = MusicCatalogResourceRequest<Artist>(matching: \.id, memberOf: ids)
request.properties = properties
let response = try await request.response()
where ids
is MusicItemId
. Below I have an input which will always fail 100% of the time, even when retried.
10 elements
- 0 : "51639"
- 1 : "331584"
- 2 : "120199"
- 3 : "45058"
- 4 : "284786497"
- 5 : "44984"
- 6 : "37299"
- 7 : "518462"
- 8 : "39525"
- 9 : "73568"
Example response:
[DataRequesting] Failed to parse body of response with status code Unknown (504):
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
font-size: 15px;
font-weight: 200;
line-height: 20px;
color: #4c4c4c;
text-align: center;
}
.section {
margin-top: 50px;
}
</style>
</head>
<body>
<div class="section">
<h1></h1>
<h3>Gateway Timeout</h3>
<p>Correlation Key: WFRI6Q5HXAUJYXGNRKQ6YTBYIM</p>
</div>
</body>
</html>
I have also tried batching these into 2 requests of 5 artists instead of 1 request of 10 artists which still fails. However, I do have sets of 10 artists that work fine. Anyone know why?