Since the last update, iTunes is unusable for me on my iMac, because with every song change it shows a "Could not connect to the iTunes Store" error message. My network at work does not allow access to the iTunes store, but that is ok. I just want to listen to my local music connection there.
I have disabled the iTunes Store in the parental settings completely, but still, the error pops up with each and every song change. Any idea how to prevent iTunes from showing this popup?

There are two major annoyances here in iTunes imho
a) iTunes tries to access the store even if it is disabled completely in the settings and you're signed out
b) The error messages "staple" on top of each other, so iTunes diplays the same error 1000 times and you have to click them all away. This reminds me of Windows 95 times.

I use Little Snitch to block outgoing connections if I don't want to access the iTunes Store, and get the same error messages. It used to be sufficient to sign out, but since the last update this no longer does the trick.
– Christian DavidDec 20 '16 at 15:48

Exactly the same here, 12.5.4.42 running OSX 10.11.6, and signing out used to do the trick but does no more. The windows popping up in the background even cause typo errors sometimes on my system when I use programs under X11 when they appear. Very nasty, if i don't find a fix i'll have to remove iTunes and switch to another program. :/
– user2707001Dec 20 '16 at 18:07

Signing out of iTunes used to to the deal. I have tried to sign out of both the App Store and iCloud... maybe this has to do with still being signed in to iTunes? Can i programmatically sign out or something like that? I can't believe there is no solution to this. In any case, "stapling" the same error message for 100 times is really bad code from Apple. I'm not used to that :/
– user2707001Dec 22 '16 at 10:08

Same here, running iTunes 12.5.4.42 on OS X 10.9.5 (because I could not find anything of interest in any of the next releases of "macOS"). I cannot believe I'm looking at alternatives right now.
– Fr.Dec 25 '16 at 0:31

13 Answers
13

I traced the problem down to a TLS handshake (thanks to jonnydigitol below for the idea!) and a total of 63 packets between the host and 23.211.148.217, which is init.iTunes.apple.com - that is executed when iTunes is started. Once this handshake completes, all is fine and you can use iTunes. But you must tunnel traffic to this host on startup, otherwise you get the error with each and every song change as iTunes tries and tries to connect to init.iTunes and throws an error popup.

Consider the answer below by jonnydigitol - you can connect by mobile phone internet or a tunnel to init.iTunes.apple.com, start iTunes and never ever turn it off - then it keeps working without an internet connection "infinitely".

How to really 'fix' the issue by installing your own web server on localhost that answers the ping:

(Check that your iTunes is up to date, there might be a fix out already)

If you get a trust certificate warning, change the policy to "always trust". If the page loads infintely, everything is fine.

Open iTunes. The error should be gone.

For the future, if you want to use iTunes, open a Terminal and run

sudo node ims.js

Then start iTunes.

Alternatively, revert to an older version.

I had given up on the issue, submitted a bug report to Apple, and, after hearing nothing from them, rolled back to the previous iTunes and rebuild by complete library in an hour long effort. Everything works now again, but I'm really disappointed by Apple here. I'm not (yet) used to them releasing such bad code.

The only way out for me was to use Pacifist to unpack an older iTunes pkg which I downloaded from Apple and extract the App, and then rebuild the complete iTunes library (which is HUGE). This is a kind of hacking I got used to being necessary on Windows systems sometimes, but i cannot remember I had to do such a thing on OSX ever. Until now. What's next, disassemble?

I'm using iTunes 10.4.1 under Mac OS 10.12.3. 10.4.1 was the last version that gives absolutely no trouble when network is not available. I keep a copy of iTunes 12.5.5.5 around too, for those times when I need to synch with a new device, or use the store. As far as I'm concerned, Apple has no need to know what I am listening to.
– Wayfaring StrangerJan 26 '17 at 17:01

Well - if you use the code I posted above, Apple won't get noticed anymore.. iTunes will be calling your local webserver instead. So, if you don't want to tell Apple and still use iTunes - go ahead. Just make sure to remove the redirect from /etc/hosts if you want to call Apple again. Definitely better than multiple iTunes versions imho.
– user2707001Feb 5 '17 at 0:14

At user2707001 -> That's a really nice bit of coding you've shown above, but I hate the cutesy look of iTunes 12, the lack of multiple windows, or large album graphics, the problems getting filters to work sensibly, the play que, etc. etc. etc. I'm just better off using an older version, and switching to new only when absolutely needed. As I said, you've got an elegant answer here. It's just not for everyone.
– Wayfaring StrangerFeb 5 '17 at 2:24

iTunes 12.4.3.1 on MacOS 10.12.6 complained about the connection to the iTunes Store being insecure (even after I added the root CA and accepted it in Safari) but neither error message came back after I accepted that insecure connection one, even after I shut down the HTTP server.
– BlenderAug 20 '17 at 5:25

Similar issue since the update. Seems to happen only while listening to iTunes offline. Alas, I may have found a solution (for me at least). Connect your computer to your phone's personal WiFi (I chose USB connect), play a song and voila! No more error! Afterward, I turned off the hotspot (optional) and to my surprise— still no error. Hope this works!

I awarded the 50 bounty to this answer because it brings something new. If you use a SSL tunnel or your smartphone to EVER connect to iTunes, you can use it afterwards until you reboot. This is at least a valid observation and a workable way out, although it's really ugly. The network security guys will kill me if I do this at work, but for some people it might be a way out. Just connect once, then disconnect and iTunes is usable -.-
– user2707001Dec 30 '16 at 16:06

I have just tested this answer. Re-installed new iTunes and my "real" library as I hated the "rebuilt" one. Set up an SSL tunnel to my external server, started iTunes, played a song, turned of the SSL tunnel. It works flawlessly from them (with disabled iTunes store in the preferences). I can work with this but its REALLY AWFUL. I will capture the traffic/requests and try to find a workaround based on this answer maybe, but I still hope Apple will fix this.... in vain?
– user2707001Dec 30 '16 at 16:20

This worked fantastic for me. Turned wifi off on the laptop after connecting to personal hotspot and the problem has not returned
– heathobrienJan 24 '17 at 10:43

This leads nowhere. As I wrote, I have disabled the iTunes store completely in the "Restrictions" section already. Then, these dialogs are all disabled and grayed out anyway so you cannot select anything.
– user2707001Dec 30 '16 at 16:14

And the grayed out boxes are not selected ?? - if they was selected before you in "Restrictions" disabled iTunes, then iTunes might still trying to sync with the Store - but this is just a guess from me, because the disabling just disable iTunes for the user - not iTunes it self.
– Rene LarsenDec 30 '16 at 16:20

Nope, they are all deselected and I am not signed in either. Plus, no network connection at all in the test setup.
– user2707001Dec 30 '16 at 16:25

One way to solve this is go back to a previous version of itunes but many people here have a problem accessing their old libraries.

I might have a solution to do that and it involves editing a new version of your library.xml - which is not that hard if you have program to do that. Text Wrangler is still free AFAIK and would do the job, but there might be others. I have no favorites in this. I do not think text edit would be ok for this since it might not save it in the original format.

Before removing itunes you open it one more time and choose File > Library > export Library (NOT export Playlist!!!)

Itunes will then export your library as a library.xml. There is also one in your user folder:Music:iTunes - but that one might be old.

you can now remove your itunes program and install another version (link below). Also remove the library files from your user folder:Music:iTunes - simply everything that starts with 'itunes library' but leave the rest, like folders and what is in them. If you can not delete itunes - I will explain that below

Open your freshly made library.xml - mind you this could be a large file if you have many playlists.

Find the line with your itunes version number. With me that is line 8 and it reads like <key>Application Version</key><string>12.5.4.42</string>

Go to the freshly installed itumes program in the finder, select it, press comand + I to open the info about the program and find the long version number. In my case I installed itunes 12.4.3, and that is what you see at the version, but you find the long number in the copyright info and in my case it says '12.4.3.1'. Now replace 12.5.4.42 with the number from your current itunes version.

Press save

Open up your new old itunes install and check if all your preferences are still the same - for instance the stuff in the advanced tab (copy files to itunes library and keep it organized) was not as it was before.

Now go to File > Library > import Playlist (yes this makes no sense, but just do it) and import your edited library.xml. Wait. If you have a big library, wait some more. If it is a large library, be prepared to wait even longer.

Your playlist, folders, songs, playcounts and ratings will be there, but your loves and dislikes not. All your listings will be reset to 'Playlist'

Now as prommised: removing itunes from your applications folder. If you want to drop it in the trash or use command + backspace the finder will tell you iTunes is important operating system software and you can not delete it.

Select iTunes

Press command + i

You see the information window. At the bottom it says 'Sharing & Permissions' - if that is closed open it by pressing the triangle.

You see a tiny lock, press it and give in your password (assuming you have administrator rights)

if your name is there it probably says 'read' behind your name. Change that to 'Read and write'

If your name is not there, press the + below the list with names. An address book will open and you can add your name or the name you use as a user of that computer. Set the rights of that name to 'Read and write

You can now press the lock again to end the editing. Afterwards you can delete iTunes anyway you want, and you can install another version of iTunes.

Not a bad idea, editing instead of rebuilding. Does "your" way keep the song ratings (stars etc.)?
– user2707001Jan 8 '17 at 15:30

Stars are there - play counts as well - but the hearts are gone. there are also other things you can do with the library.xml. If you look further down into the file where the songs are you can see the location with name of the disk etc. You could move your complete library to another disk and re-import everything (except the hears of course) that way if you do a search and replace the right way
– YuriGoulJan 11 '17 at 11:22

always keep a backup of the old file if you start to experiment
– YuriGoulJan 11 '17 at 11:28

A sequence of your older libraries is stored in "Previous iTunes Libraries" inside the "iTunes Folder". To revert to an older version, just drag "iTunes Library 2015-09-11 5.itl", or whatever out to the main iTunes Library level, and rename it "iTunes Library.itl". Obviously you'll have to move the current "iTunes Library.itl" somewhere else first. Upon opening, iTunes will update the replaced .itl to whatever version of iTunes you happen to be running.
– Wayfaring StrangerJan 27 '17 at 15:05

In my case this was not an option because the library was too old.
– YuriGoulJan 28 '17 at 17:05

Well, the big problem with this is that I have to rebuild my iTunes Library as the "old" iTunes cannot open my "new" xml. This means that e.g. all my song rating are GONE. This was only like 50 hours of work to rate all the songs... -.-. Plus, it's very Microsoft to me to just roll back to an elder version because the new version has bugs so big you can neither fix them nor use the software anymore...
– user2707001Dec 30 '16 at 16:03

additionally, downloading software from a (to me) non-trusted source like "downloadbestnow" is completely out of the question
– user2707001Dec 30 '16 at 16:17

I think more you use iTunes options, more you have problems. Few times ago I understood that I should less options possible if I want really a clean and secure iTunes. So I think you need do some concessions.
– AnonymousBossDec 30 '16 at 16:32

About the security i understand, but it's the only link i found to download mac version of iTunes in this version.
– AnonymousBossDec 30 '16 at 16:33

Thanks for the effort. It might be good to some people having this problem - just to me, it doesn't help that much. I have posted a link for an older version of iTunes above directly from Apple, but your version might be good for some who have no problems running from non-trusted sources.
– user2707001Dec 30 '16 at 16:41

The same thing was happening to me on my office PC and it just fixed itself, but unfortunately I didn't notice exactly when it actually happened. After about 5 songs I realized I wasn't getting the error anymore. My best guess is that the Genius results from pre-update Genius playlists might have been trying to check themselves between each song - even though I haven't played them in a month or so.

I was messing with a Smart playlist based on some Genius playlists that were carryovers from before I updated. I had deleted the older Genius playlists and made some new ones and I'm thinking that was when the errors stopped stacking up. Now I only get the error when I try to manually update the Genius results from File>Library>Update Genius, which is fine.

I can't re-create the problem now to test it, so hopefully you guys can tell me if I'm on to something or not. Sorry if this is a red herring. I was doing a lot of clicking around at the time.

I had the same problem and subsequently downgraded to iTunes 12.4.3.1 (from Apple.com). Since then, no more annoying popups. I wasn't too bothered about scrapping my playlists, and am now revisiting parts of my library I completely forgot about.

This is an ugly shortcut, I agree, but it worked for me, I hope it does for you.

Is unchecked (and always was) and does not work. If I boot without network, start iTunes and press play, the error pops up.
– user2707001Jan 8 '17 at 18:09

@user2707001 Yes, it might give you an error warning once or twice, when you do some network-related activity, but it killed the multiple pop-ups which were stacked on top of one another, making the app hard to use.
– LewJan 12 '17 at 14:42

nope, one popup with each and every song change with the checkbox unchecked
– user2707001Jan 12 '17 at 15:02

Biggest issue with this is that I have to enable parental controls. This is quite out of the question for my programming account.
– user2707001Dec 30 '16 at 16:07

Meaning if I go to the system preferences. Going to Preferences>Restrictions>Disable iTunes store is what I did as I posted above. STILL, iTunes will pop up the error (!!!)
– user2707001Dec 30 '16 at 16:16

Thanks for your reply. I installed LittleSnitch and blocked all iTunes traffic (iTunes - deny any outgoing connection). The problem still persists, with EVERY song change, I get an error popup. Any idea?
– user2707001Dec 19 '16 at 14:58

The worst thing is that these popups even "staple", so i have to click like 20 popups away when i listen to an hour of music in the background. WTF, Apple?
– user2707001Dec 19 '16 at 15:20

@user2707001 try disabling all connections not just outgoing. It should work. In my case there was something wrong not just "Could not connect to iTunes Store", it takes a long time to startup, and it freezes. I had to block all connections then only the iTunes think macbook is offline and it was fine again.
– Thu Yein TunDec 19 '16 at 22:43

negative, this does not work. disabled ALL traffic to iTunes, incoming and outgoing, still the error popup persists on each and every song change. but i guess the idea is good, i will need to block another process/application and it should work. will try to wireshark it.
– user2707001Dec 20 '16 at 12:48

actually, the error message even appears when i plug out the ethernet cable and disable wifi altogether
– user2707001Dec 20 '16 at 13:25

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).