dalgibbard / citrix_xenserver_patcher

Auto / Manual Patching tool for Citrix XenServer Boxes
Do What The F*ck You Want To Public License
142 stars 45 forks source link

List index out of range #47

Closed forall closed 8 years ago

forall commented 8 years ago

Hi,

When I install patches I have that issue:

Traceback (most recent call last): File "./patcher.py", line 894, in ? file_name = str(download_patch(patch_url)) File "./patcher.py", line 286, in download_patch file_size = int(meta.getheaders("Content-Length")[0]) IndexError: list index out of range

I must again run a script to install a patches.

spont4e commented 8 years ago

I have the same problem

dalgibbard commented 8 years ago

Looks like the upstream isn't telling us how large the file is anymore... Will have to wrap it in a try statement. Thanks for bringing this to my attention!

thctlo commented 8 years ago

Hai, an update on this. I just installed a new 6.5 server, and i did run also in to this problem,but this is i.m.o. NOT a bug in xen patcher.

Why? The following patches, are downloaded and installed without any problem. xs65001-3,5,6,7,8,9,10,13,14,15,SP1,SP1003-5, SP1008-11,SP1013

after the installation of above, you get the error, again and again when you start patcher.. but the solution is very simple. reboot your server, start patcher again. now the last 3 updates are downloaded without any problem, (015,sp1012,sp1014)

So i suspect that one of the patches, after installation, causes these problems and you must reboot to get this working again.

hope this helps development time a bit, so its not needed to spent time on this.

dalgibbard commented 8 years ago

I've had a quick stab at it, but haven't had a chance to test at all; if anyone fancies pulling the version from the 'Issue47' branch and giving it a whirl, I'd very much appreciate it! :)

forall commented 8 years ago

I want to test a new version, but houston we have a problem in syntax :-)

chmod +x patcher.py [root@hp-dev ~]# ./patcher.py File "./patcher.py", line 310 file_size_dl = 0 ^ SyntaxError: invalid syntax

dalgibbard commented 8 years ago

Haha! I literally just spotted that just now - please try the latest commit in the Issue47 branch :D

forall commented 8 years ago

Hello :-)

I download the latest commit and run on XS62, where script download all patches, without any error messages. Today or tomorrow I going to update XS62 to XS65 and then I check script for patches XS6.5.

dalgibbard commented 8 years ago

That's a great start! Let me know if the script says anything about it not being able to find the download size; it will list it as a WARN, wait 4 seconds (to give the user some time to read), and then continue on anyway :)

forall commented 8 years ago

I update XS62 to XS65 and install all patches with script. Everyting is ok, only I have a WARN :-) with this patches:

Downloading: XS65ESP1005.zip ...WARN: Failed to get download size from: http://support.citrix.com/filedownload/CTX201514/XS65ESP1005.zip Will attempt to continue download, with unknown file size

Downloading: XS65ESP1009.zip ...WARN: Failed to get download size from: https://support.citrix.com/filedownload/CTX201741/XS65ESP1009.zip Will attempt to continue download, with unknown file size Download Size: 1 Bytes 14378447 Downloading: XS65ESP1010.zip ...WARN: Failed to get download size from: http://support.citrix.com/filedownload/CTX201974/XS65ESP1010.zip Will attempt to continue download, with unknown file size

I don't have error: "List index out of range". I think script now works good :-)

dalgibbard commented 8 years ago

Excellent; It definitely seems like some sort of odd bug as @thctlo pointed out, so I think this fix is a satisfactory workaround :) Will merge and close.