2

This is a weird one. At first I thought it was just a problem with the Twitter app running in macOS sometimes just stops loading any media (pictures, gifs, videos). But then I noticed that twitter.com through Safari would exhibit the exact same problem, and loading the same tweet in Chrome worked perfectly. This happens sometimes, I think most notably the next morning. My computer doesn't go to sleep since I use it for some server purposes.

Screenshots below are of the same tweet around the same time, one in the Twitter app, one in Safari and one in Chrome just to illustrate the point.

I'm thinking this is some sort of issue with macOS' networking/cache layer? I'm running Little Snitch but tries disabling it but the problem persisted.

I don't know, anyone have any ideas? Thanks in advance for any help I can get on this!

Twitter.app

Twitter.app

Safari

twitter.com on Safari

Chrome

twitter.com on Chrome

2 Answers 2

3

I just had this problem for the third or fourth time. Restarting Safari or clearing website data didn't help. I did some digging while it was happening. I couldn't see any problems in the Safari developer tools Console (well, I could, but they were all complaining about loading .map files from ton.local.twitter.com and are irrelevant as map files don't need to be there for everything to work.)

I tried to load a particular failing image in a separate Safari window and it just hung. Then I tried to get the image using a command-line Curl command and found something interesting:

matt@Matts-iMac ~/tmp> curl https://pbs.twimg.com/media/FScZYbgXEAAd1iQ\?format\=png\&name\=small > out.png
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:29 --:--:--     0
curl: (6) Could not resolve host: pbs.twimg.com

So, it looked like the problem was with DNS—neither Safari nor my command line could find pbs.twimg.com, oddly. (Everything worked fine in Chrome, and I think that's because Chrome has its own DNS stuff built in; it certainly has more of a local cache than Safari, as I understand it.)

I had no problems using dig to retrieve the address of pbs.twimg.com, so I figured my Mac's local DNS cache must be a bit broken. And clearing the cache and restarting the cache daemon from the command line fixed the problem:

sudo dscacheutil -flushcache  
sudo killall mDNSResponder  

After I ran those two commands in Terminal, I refreshed Twitter in the still-running Safari window and everything was back up and running.

2
  • It's wild to think that DNS could break OS wide with such ease. Thanks for investigating!
    – Arno
    Aug 8, 2022 at 21:11
  • Wow, this was happening to me for a week. Twitter.com wouldn't load and the console was full of "ton.local.twitter.com" errors. Running the two commands and then restarting Safari fixed it.
    – danneu
    Jan 13 at 18:13
1

Restarting Safari (quitting and reopening) or deleting all website data for twitter.com both fixes it.

So it's probably not in the macOS network layer, but might be a cache issue?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .