Avatar image download failures

I've been noticing this a lot more lately in regards to remote Mastodon instances, specifically from a shared item.

Looking at the logs, attempting to retrieve the avatar from the instance returns a 404:

2022-10-07 00:45:55.929 | INFO     | app.main:serve_proxy_media_resized:1108 | 1b7d0c25531c7568 - failed to proxy https://cdn.mastodon.la/accounts/avatars/108/489/072/088/012/978/original/5d6b08e86b3676a9.png, got 404
INFO:     xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx - "GET /proxy/media/aHR0cHM6Ly9jZG4ubWFzdG9kb24ubGEvYWNjb3VudHMvYXZhdGFycy8xMDgvNDg5LzA3Mi8wODgvMDEyLzk3OC9vcmlnaW5hbC81ZDZiMDhlODZiMzY3NmE5LnBuZw%3D%3D/50 HTTP/1.0" 404 Not Found
2022-10-07 00:45:55.929 | INFO     | app.main:__call__:167 | 1b7d0c25531c7568 - status_code=404 elapsed_time=0.05s

If I manually go to the user's timeline, their avatar is there and opening up the image in a new tab shows a slightly different URL for the avatar. In the example above, this turned out to be the correct URL:


I'm not sure if this is necessarily a bug on the microblog.pub side or potentially an incorrect URL being returned from the Mastodon API, but I figured I'd report it just in case.

Let me know if you need anything else. Thanks!

Assigned to
2 months ago
8 days ago
No labels applied.

~tsileo 2 months ago


I haven't been able to find a nice workaround for this yet, and I've noticed this too.

Mastodon keeps a cached version of the avatar (and serves it via its custom API), but we use the URL embedded in the ActivityPub profile.

Most of the time when I checked manually, the URL from the ActivityPub profile is actually 404ing, and Mastodon have a valid cached version on the web UI, but the case you're explaining looks a bit different.

If you saw this happening happening from shared object, my guess is that the profile was updated and we were not notified via an Update activity because you're not following the actor and we use our internal cache.

I will tweak the logic to refresh actor once in a while, I think that should solve some issues!


~tsileo 2 months ago*

I just pushed a fix that should help, we now periodically refresh actor profile even when we have it in DB, in case the instance wasn't notified via an Update activity.

Note that this process happens only when we process an incoming object, so it won't retroactively fix all profiles, it will take a bot of time.

I think it should help, please give it some time and let me know if you notice an improvement.

I will keep trying to see if there's something else we can do to improve this.


~jodhus 2 months ago

Updated this morning and there seems to be improvement so far. I did have one missing avatar, but when I clicked on "Reload Image" from Firefox, the image finally loaded.

Progress! : )

~tsileo REPORTED FIXED 8 days ago

Since then, I also added 1 retry when fetching remote media. Closing this issue.

Register here or Log in to comment, or comment via email.