Five Glass Cannon feeds show no artwork, and every page load logs a 502 for each #169
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Five feeds from the same Patreon campaign (369921, Glass Cannon Network) name cover art on c10.patreonusercontent.com that is over the 5 MB limit in
art(src/web.rs): blood-of-the-wild-quest-for-the-frozen-f, raiders-of-the-lost-continent-ruins-of-a, the-glass-cannon-podcast-gatewalkers-pat, voyagers-of-the-jump-traveller-rpg, wicked-empire-d-d-5e. wicked-empire's is a 7.3 MB PNG (Content-Length 7340145)./api/artanswers 502 "larger than 5242880 bytes". The failure is not remembered, so each time the page shows those feeds it downloads up to 5 MB from Patreon again, five times over, and logs fiveGET /api/art -> 502warnings. Production logs about 84 a day, 162 in the last 7 days (6045 art requests answered 200 in the same time).The log has no clue to which image failed or why: the reason goes only to the browser in the body. Found by replaying
/api/artfor each subscribed feed'simageas the user.Possible fixes: shrink large images instead of refusing them, or raise the limit; remember a failed address for a while so it is not fetched again on every load; and log the reason and the address at the warning.
Fixed in
1e7a858, deployed as 0.10.4-dev: /api/art takes images up to 20 MB, so the five covers (the largest 7.3 MB) now load; a fetch that fails is answered from memory for an hour instead of fetched again on every page load; and the failure is logged as "could not fetch artwork" with its url and error. Images are not shrunk: that would need an image library, and the art cache and the browser's 30-day cache keep them after the first fetch. All 34 of the campaign's feed covers answer 200 after the deploy.