None of my iDevices can read my iTunes library after an hour of availibility. When I first start iTunes I can read the library, but after about 30 minutes my iPad's and iPhones can no longer access the library. I see it in the shared list, but no access.

None of my iDevices can read my iTunes library after about 30 minutes. My iDevices lose connection to my library and I have to do one of the three following things in iTunes to regain connectivity: 1. Restart iTunes 2: Stop / Start Home Services 3: Start playing a song.

I'ts as if iTunes goes into a background or sleep mode. During the loss of connectivity my iDevices show that there's a library shared, but I cannot connect to it.

iPhone 4, iOS 5

Posted on May 13, 2012 1:34 PM

Reply
221 replies

Jun 5, 2012 12:09 PM in response to Davids8477

This is really getting interesting. My little iTunes DoS bug and our getting to the bottom of it may be exposing the root of this problem. I'm happy I goofed!


I'm now conscience of connections to home sharing and am noticing a growing number of open connections in an ESTABLISHED state to 3689 on my mac mini from what I beileve is my appleTV (I will confirm when I get home).


So, this backs up the theory that this is actually an appleTV bug or some combo of appleTV and iTunes. Even if the bug is in appleTV, it could still affect other devices since it basically DoSes home sharing. Either way, the bug could exist or be corrected on either side and its possible that both sides are misbehaving.


I've added some debug to my ruby script so I can get output on the number of connections just before it tries to wake up itunes.

Jun 5, 2012 12:44 PM in response to aut0maticdan

I've updated the script to report back the number of connections before and after the restart of itunes. If you don't mind, please update and run. I'm running as well, but you may get there quicker than I do.


The output will look like:


Tue Jun 05 15:30:20 -0400 2012 :: Number of HS connections: 1

Home sharing is broken. I am going to restart iTunes.

iTunes restarted

Tue Jun 05 15:30:34 -0400 2012 :: Number of HS connections: 0


If you get a restart, just report back with the output. thanks!


EDIT: Its worth noting that this update does not provide any additional functionality to help resolve the problem. Its purely for my curiosity. Even if the ruby script mitigates the issue, I'll feel much better know what is going wrong. Its just the way I am.


Message was edited by: aut0maticdan

Jun 5, 2012 12:57 PM in response to aut0maticdan

Thanks for the updated script! I've just gotten home and thought I'd check some stuff on my Mac mini (which is sharing the library).


Running netstat from terminal gave me a crazy long list of connections from my AppleTV 3 (over 20 at least). I haven't used the AppleTV 2 in the bedroom since coming back from holiday and powering it all up; it only had one connection listed.


I tried turning both the AppleTVs off, no change with netstat or AppleTV functionality. I tried pulling the network lead out of the Mac Mini, no change in the netstat list. So I tried restarting iTunes, and the netstat list of connections from them vanished and of course the AppleTVs both worked.


Also, when I powered on both AppleTVs, they offered me updates (5.0.2). Since I powered them both up when back home on Sunday and they didn't offer anything then, I'm assuming this is a fresh form Apple update? If so, fingers crossed!

Jun 5, 2012 2:02 PM in response to aut0maticdan

I'm not running the script yet: but I looked at it and took the netstat portion to check my home mini. I have two Apple TV's and apparently 768 HS connectioins.


WOW. Just wow.


Looking closer I noticed almost all those connections have the status CLOSE_WAIT. My familiarity is that this status means the client side has requested a close and is waiting on the server side to do it. That would suggest to me, if this is the case, that it is itunes as we had previously assumed.


Very interesting info though. I wonder what makes it stop responding. Just too many connections for itunes to manage?

Jun 5, 2012 2:10 PM in response to cendrizzi

Yep, I'm noticing the close_wait piling on as well. Very strange! I'm curious to see its breaking point.


EDIT: Oh, one thing worth mentioning. Once you start getting the CLOSE_WAIT connections, the script adds to them every time it iterates, so the testing of the port may accellerate the breakage and then hopefully resolve it.


EDIT 2: Is your home sharing working at this point? I wonder if its broken once the CLOSE_WAITs start accumulating. It will be interesting to see at what point I can't connect and the amount of time in between.

Jun 5, 2012 2:16 PM in response to SilverSevens

Well I' running the script show above and normally the library loads within 5-10 seconds. This time it was well over 2 minutes and no load. Nothing in the terminal widown of the script (no messages).


On the server I started a song playing and almost instantly the library loaded on the remote machine.


Maybe a coincidence but its inforamtion.


I'll try it again when (if) I get a loading library hang.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

None of my iDevices can read my iTunes library after an hour of availibility. When I first start iTunes I can read the library, but after about 30 minutes my iPad's and iPhones can no longer access the library. I see it in the shared list, but no access.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.