Fixing missing remote avatars


#1

I set up my instance a few days ago, and mostly it is running smoothly. However, a small number of remote/federated user avatars didn’t get pulled over/are showing as the default.

Here are the things I’ve tried to fix these accounts:

  • Unfollowed and re-followed.
  • Had a remote user upload a new avatar to the remote instance
  • The “refresh avatar” button for the user in the moderator/accounts panel.
  • Used the rake redownload_avatars task. No obvious errors, but truthfully I didn’t scrutinize all of its voluminous output.

Most of the remote accounts’ avatars show up fine. Two of these accounts are located on Mastodon.social, and one is another instance I forget which.

Suggestions for what to try next are welcome. I’m starting to think the solution will involve digging into SQL.

Thanks!


#2

Okay I’m going to bump my own thread; sorry.

Looking at /public/system/accounts/avatars/000/000/ the directories for these users didn’t exist. And running the redownload_avatars task skips them, even after I created the appropriate directories. So I feel like there must be something wrong with their database entries that none of the available tools I can find can easily fix.


#3

I straight up used the rails console command to delete the entry for the remote user: Account.destroy(account_id)

Then I refollowed the remote user, and … the remote user gets a new account_id, but still no avatar.

I’m at a complete loss. Remote users without avatars are on mastodon.social and mastodon.cloud (but plenty of other users from mastodon.social are working). Am I going to have to just start my database from scratch?


#4

I have no idea here. I tried to research similar problems but got discourage in almost total lack of debug logging in the API routines…


#5

Thanks for the reply, at least. Whenever I figure this out I’ll post here. It’s frustrating that this very small but glaring and pernicious snafu is taking my attention away from other ways I could improve my instance. It feels like I have to have expertise in every layer of the application to diagnose and fix this problem (is it postgres? is it rails? is it sidekiq?), which isn’t very “anyone can run their own instance.”


#7

For people who might run into this in the future, I figured out the right combination of manual commands to fix this problem. In this case, the avatar_remote_url field was set to nul and none of the other tools to refresh remote avatars would populate the field, instead the account was just skipped.

Here are the steps I performed to get the remote avatars. Might have to do a similar thing for remote headers as well, so far the accounts this happened to for me didn’t have headers.

cd ~live
RAILS_ENV=production bundle exec rails c
a = Account.find_remote('USERNAME', 'REMOTE.DOMAIN')
a.avatar_remote_url = "https://url/to_remote_avatar.png"
a.save

To get the remote_url of the avatar, I went to the user’s profile on the remote domain and poked around in the web console.