When you try to follow, mention, or view the profile of a user on another Mastodon instance, you may see the error message “Could Not Fetch Remote Account.” This error usually means your home instance cannot complete the handshake with the remote server to download that user’s profile data. The cause is often a temporary federation glitch, a network block, or an outdated DNS record on the remote instance. This article explains why the error occurs and provides a clear set of steps to resolve it on your own instance.
Key Takeaways: Fixing the Mastodon Remote Account Fetch Error
- Mastodon admin dashboard > Federation > Resolve: Manually retry fetching the remote account after a failed attempt.
- Mastodon admin dashboard > Sidekiq > Dead: Check for stuck background jobs that block the federation handshake.
- Remote instance’s .well-known/host-meta endpoint: Verify that the remote server exposes this endpoint correctly for federation to work.
Why Mastodon Cannot Fetch a Remote Account
Mastodon relies on ActivityPub, a decentralized protocol, to exchange data between instances. When you search for or interact with a user on another instance, your server sends a GET request to the remote server’s API endpoint, typically https://remoteinstance.com/users/username. The remote server must respond with a JSON-LD document that contains the user’s profile data, including their display name, bio, avatar, and public key.
The “Could Not Fetch Remote Account” error occurs when your server cannot receive or parse that JSON-LD document. Several conditions can cause this failure:
Network-Level Blocks
The remote instance may be blocking your server’s IP address. This can happen if your instance was flagged for spam or if the remote admin manually added your server to a blocklist. Some instances also use firewalls or Cloudflare to restrict traffic from unknown IP ranges.
DNS Resolution Failure
Your server’s DNS resolver may not be able to resolve the remote instance’s domain name. This can happen if the remote domain’s DNS records are misconfigured, expired, or temporarily unreachable. Without a valid A or AAAA record, your server cannot open a TCP connection.
SSL/TLS Certificate Issues
Mastodon enforces HTTPS for all federation traffic. If the remote instance’s SSL certificate is expired, invalid, or self-signed, your server will reject the connection and fail to fetch the account. This is a common issue on small personal instances that use Let’s Encrypt but have not renewed their certificates in time.
Stale or Corrupted Cache on Your Server
Your instance caches remote profile data to reduce bandwidth. If the cache entry for a remote user becomes corrupted or outdated, Mastodon may refuse to re-fetch the data and return the error instead. This is especially common after a remote user moves to another instance or deletes their account.
Steps to Resolve the Remote Account Fetch Error
Follow these steps in order. Test after each step to see if the error clears.
- Clear the remote account from your server’s cache
Open your Mastodon admin dashboard. Go to Preferences > Administration > Federation. In the search box, type the full address of the remote user (for example,@user@remoteinstance.com). If the account appears in the results, click the account name to open its detail page. Click Resolve to force your server to re-fetch the profile data. If the account does not appear, your server has no cached entry, so proceed to the next step. - Check Sidekiq for dead or stuck jobs
Federation requests are processed by Sidekiq background workers. If a worker crashes or a job gets stuck, your server never completes the fetch. In your admin dashboard, go to Preferences > Administration > Sidekiq. Click the Dead tab. If you see jobs related to fetching remote accounts, click Retry all. Then click the Queues tab and verify that the queue namedpullordefaultis not overloaded. If the queue has more than 1000 pending jobs, restart the Sidekiq service:sudo systemctl restart sidekiqon your server. - Verify DNS resolution from your server
SSH into your Mastodon server. Rundig remoteinstance.com +short. If the command returns an IP address, DNS is working. If it returns nothing or an error, your server cannot resolve the domain. Check your/etc/resolv.conffile and ensure it points to a working DNS server, such as 8.8.8.8 or 1.1.1.1. You can also flush the local DNS cache withsudo systemd-resolve --flush-cachesif using systemd-resolved. - Test the remote instance’s federation endpoint
From your server, runcurl -I https://remoteinstance.com/.well-known/host-meta. A successful response returns HTTP status 200 and anapplication/xrd+xmlcontent type. If you get a 403 or 404, the remote instance is not exposing the required endpoint. If you get a certificate error, runcurl -v https://remoteinstance.comand look forSSL certificate problemin the output. Contact the admin of the remote instance to resolve these issues. - Manually trigger a fetch via the Mastodon CLI
If the admin dashboard and Sidekiq checks do not work, use the command-line interface. SSH into your server. RunRAILS_ENV=production bin/tootctl accounts refresh remoteinstance.com. This command forces Mastodon to re-fetch all remote accounts from that instance. Replaceremoteinstance.comwith the actual domain. Wait 30 seconds and try searching for the remote user again. - Restart the Mastodon web service
As a final step, restart the entire Mastodon stack:sudo systemctl restart mastodon-web. This clears any in-memory caches and reloads the federation configuration. After the restart, try to view the remote profile again.
If the Error Persists After the Main Fix
Remote instance has blocked your server
Some instances maintain blocklists that prevent federation with certain domains. You can check if your server is blocked by visiting the remote instance’s API endpoint directly from your browser: https://remoteinstance.com/api/v1/instance/domain_blocks?domain=yourinstance.com. If the response includes your domain, the remote admin has blocked your instance. You must contact the remote admin and request removal from the blocklist.
Remote user account is deleted or moved
If the remote user has deleted their account or moved to a different instance, Mastodon cannot fetch the profile because it no longer exists at the original URL. Verify the user’s status by visiting their profile page directly in a web browser. If the page shows a 404 or a redirect, ask the user for their new account address.
Your server’s firewall is blocking outbound connections
Your server’s firewall may be blocking outbound HTTPS traffic on port 443. Run sudo iptables -L -n to list the current rules. Look for a REJECT or DROP rule on the OUTPUT chain for port 443. If you find one, add an ACCEPT rule: sudo iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT. Save the rules so they persist across reboots.
Mastodon Federation Fetch: Local Instance vs Remote Instance
| Item | Local Instance | Remote Instance |
|---|---|---|
| Role in the error | Initiates the fetch request | Serves the account data |
| Common failure point | Stale cache or Sidekiq job jam | SSL certificate or DNS misconfiguration |
| Admin tool | Admin dashboard > Federation > Resolve | Remote admin must fix server config |
| Recovery time | Seconds to minutes after fix | Depends on remote admin response |
After completing the steps above, you should be able to view remote profiles and interact with users across instances. If the error was caused by a temporary federation glitch, the fix is immediate. For persistent issues, verify that your server’s DNS and firewall settings are correct. As an advanced tip, you can monitor federation health by enabling Sidekiq logging in config/sidekiq.yml and reviewing the logs with journalctl -u sidekiq -f.