Network Connection Reset in iTunes

greenapple I consider myself an experienced IT Professional, but sometimes I just wonder what the heck is really going on. More specifically, how in the world does iTunes really work on a Windows platform? I’ve always felt that iTunes probably works just fine in an Apple ecosystem, but that the port to Windows has never been fully baked. We were trying to stream some new songs from our iTunes library but they either didn’t play or cut out at a few seconds. Time to put on my IT support hat.

I checked the Windows Explorer folder for the songs in question. They all looked fine. Sizes were right. But when I tried to play the problem tracks in Windows Media player they either stopped after a few seconds or were simply silence. Ok, I thought. Corrupt download. Delete the files and re-download my purchases.

After a bit of research to figure out how to do that, I discovered you can go to the iTunes store and find a link for past purchases. From there you can find the album or tracks that are not local and choose to download them again. That seems easy. But then the fun started.

I kept getting the infamous “network connection was reset” error. So back to Google. Oh. My. God. I found posts as far back as 2007 with people reporting this problem. The saddest part is that Apple could never fully address it. I couldn’t believe when Apple support apparently told people to look to their ISPs, routers and firewalls. Well I knew my problem was not ISP related since I’ve had this problem for a long time, even though I didn’t realize it. My son reported problems downloading purchases but eventually we got it to work so I didn’t do much digging. That was when I was on Time-Warner. This week I switched to Verizon FiOS so clearly not an ISP problem. And I have no problems with anything else Internet-related.

I found there was a new version of iTunes so I updated that. No change. Of course if this problem has been going on since at least 2007, the iTunes app isn’t fixing anything. But there is one change I read about that promised a fix. At first I ignored it because I couldn’t possibly imagine what effect it would have.

The suggestion was to change the DNS settings to a public DNS server like the ones from OpenDNS. Willing to try anything at 10PM on Thanksgiving evening, I manually set DNS to Google’s 8.8.8.8 server. And it worked. And it was faster. After I recovered from the whiplash of shaking my head, I proceeded to download other tracks that had never made it. How in the world would it matter what I used for DNS to download a chunk of data? Normally I use my own internal DNS server with the usually forwarders and root hints. I never have Internet-related problems.

However, even with this change I still encountered the error so clearly this isn’t the perfect solution. I had also read about changing your download settings in iTunes to NOT allow simultaneous downloads. Once I made that change, downloads took longer but I no longer encountered the error. Of course by now it was 10:40PM EST on Thanksgiving evening so I have no way of knowing if any of those changes really made a difference or if I just got lucky.

All of this takes my back to my original rant in that iTunes on Windows is probably not the best piece of software ever written. From the limited programming I know, I am at a loss to figure out what iTunes is doing networking-wise when it comes to downloading files. From my perspective it is clearly doing something unexpected. I will have to continue to monitor iTunes. Next time I might even throw on Wireshark so I can see what is going on.

By the way, if you think you’ve had this problem, open up the root folder where you’ve told iTunes to store your music. You should see a Downloads folder. When files are downloaded from iTunes, this is the temporary folder. After the file is downloaded and processed this folder is cleaned up. But if you have had interruptions downloading files, you’ll find some temp files. I found files going back to 2012 which is why I know I’ve had this problem a while. I deleted the files first, made sure problem tracks were not showing in the library list and then tried to re-download from the iTunes store. You may need to restart iTunes.

From my research it seems the vast majority of people having this network reset error were running on some version of Windows. I have no doubt that there are many very smart developers at Apple, but sadly I suspect Windows programming is not something Apple places much value.

What has been your experience with iTunes on Windows? Any one else run into this problem and found a definitive answer?

iTunes Lyrics Viewer HTA

I’ve been toying around with the iTunes COM object (iTunes.Application) which gives you some pretty handy control over the iTunes application. I was particularly interested in having something display song lyrics so I developed an HTA that displays album art, artist and song information and lyrics. The tool will refresh whenever a new song is played. If no lyrics are available a link will be provided that might help you find lyrics to LyricWiki.org. The link will open in an external browser window and is a “best guess” based on iTunes song information. If the song does not show up, you can probably still search the site for lyrics. This version does not update lyrics. You’ll have to do that manually.

If you attempt to close iTunes and get a message about another application using iTunes, close the HTA first. If iTunes is not running, when you launch the HTA it will also launch iTunes.

The HTA is not intended as an iTunes replacement, although you could certainly extend the functionality. At some point, I might add better code to find lyrics and even update the song in iTunes. If someone else comes up with code like that, I hope they’ll share.

You can download the zip file with the HTA at http://www.jdhitsolutions.com/scripts.

Technorati tags: , , , ,