Error -3001 with Software Update resolved
I just tried to update my system. The update application displayed four updates, one of them iTunes 9.0.0. As I was on a slow link, I let the machine running while I went out for lunch. After coming back and waking my machine from either suspend to RAM or at least screen saver mode, I got an error message that the iTunes update could not be loaded and I should try again. I did so, and got an error message quite fast. It looked similar, might even have been the same. The new error message read thus in German:
Das Update "iTunes" konnte nicht gesichert werden.
Es ist ein Netzwerkfehler aufgetreten: Datei kann nicht geöffnet werden (-3001). Überprüfen Sie Ihre Verbindung zum Internet und versuchen Sie es erneut.
Roughly speaking, the title claims that it failed to save the file. The text says there was a network error and some file couldn't be opened. I should check my Internet connection.
I used Wireshark to have a look at the dialog with the download server. It turned out that my machine was sending a request for a partial file. To this the server answered with a partial response, all looking proper as far as I could see. While the server kept sending content data, my machine for some reason sent a bunch of reset packets, cutting the connection. I assume that after requesting the partial content, it tried to open the already received initial part from some local file, and failing to do so, canceled the download and reported the error. Dunno where that partial file should have been, and why it wasn't.
Next, I browsed the web for similar reports. In one case I found some reference to the /var/folders system directory. Looking at my own system, I found a file called
/var/folders/ /*/-Caches-/com.apple.SoftwareUpdate/swcdn.apple.com/content/downloads/*/*/*//iTunesX.tar.resumeData
(with the * standing for what looks like sequence numbers or random strings). That file did indicate the number of bytes received, which were used to formulate the partial download request I saw in Wireshark.
Removing that file caused a subsequent software update to fetch the whole file again, and now everything went all right.
To sum it up, there seems to be some problem with the way partial downloads get resumed. The problem is solvable by the user by removing the corresponding resumeData file. Unfortunately the software update application doesn't seem capable of fixing this kind of problem all by itself. One would hope that in the absence of any file containing a partial download, as I above assumed, it should automatically do a full download. It does not, so there is room for improvement.
I guess I'll write some feedback item on this topic as well. But as I don't expect it to be fixed really soon, I thought I'd write this post here to let you know the workaround. Let's hope people who need it will find it.
Mac OS X (10.5.8)