VMware Cloud Community
MitC
Contributor
Contributor
Jump to solution

Problem with esxupdate and the FTP depot option

Hello,

Does anyone know why I'm getting this error when I try to use the FTP depot option with esxupdate?

\# esxupdate -r ftp://172.28.247.223/dslib/ESX-1006511 update

INFO: Configuring...

INFO: Preparing to install VMware ESX Server ESX-1006511...

ERROR: Error (1) executing \[yum info]

retrygrab() failed for:

ftp://172.28.247.223/dslib/ESX-1006511/headers/header.info

Executing failover method

failover: out of servers to try

Error getting file ftp://172.28.247.223/dslib/ESX-1006511/headers/header.info

\[Errno 6] ERROR: Url Return no Content-Length - something is wrong

Gathering header information file(s) from server(s)

Server: Esxupdate-compatible repository for VMware ESX Server ESX-1006511

I've checked the header.info file and it seems fine (a single line of info). I'm not doing anything fancy, and my Windows IIS FTP server has anonymous access enabled (I see the server is able to login and access the files through the FTP log file). I can run the "info" command on the file without a problem.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
tgradig
Hot Shot
Hot Shot
Jump to solution

Just heard back from VMware today on our FTP Depot problem..Great News..

There have been a few reports of this issue, there's a general workaround that you can try

Here's the procedure:

\- Login to the service console as root

\- Change directory to /usr/share/yum

\- Make a backup copy of urlgrabber.py (IMPORTANT)

cp urlgrabber.py urlgrabber.py.BAK

\- Edit urlgrabber.py and find the following lines:

if have_urllib2 or scheme != 'file':

  1. urllib does not provide content-length for local files

if not hdr is None and not hdr.has_key('Content-Length'):

raise URLGrabError(6, _('ERROR: Url Return no Content-Length - something is wrong'))

Comment them out (Add a '#' at the beginning of the line):

  1. if have_urllib2 or scheme != 'file':

  1. # urllib does not provide content-length for local files

  1. if not hdr is None and not hdr.has_key('Content-Length'):

  1. raise URLGrabError(6, _('ERROR: Url Return no Content-Length -

something is wrong'))

Try the esxupdate command again..

View solution in original post

0 Kudos
20 Replies
kharbin
Commander
Commander
Jump to solution

Did you open the firewall to allow ftp?

0 Kudos
mbrassel
Contributor
Contributor
Jump to solution

We've got the same problem.

When analyzing the ftp stream on the ftp server we found an issue with the transfer mode.

The update tool does download the header.info file in Binary mode. We suspect it should download the file in ASCII mode, as it is a simple text file.

This seems to be a bug in the esxupdate.

0 Kudos
ako
Contributor
Contributor
Jump to solution

Getting the same Error here a debug extract

DEBUG: Lock file /var/run/esxupdate.pid created with PID 21831

DEBUG: Options \{'url': 'ftp://chbbwpss001/esxvi3/updates/ESX-1006511', 'verbosity': 10, 'enableRollback': 1} Command update

DEBUG: Entering \[ 12:06:10 12/08/06] \[ConfigState ]

INFO: Configuring...

DEBUG: Attempting to retrieve descriptor.xml from \[ftp://chbbwpss001/esxvi3/updates/ESX-1006511/]

DEBUG: rpms created = 1 for tag='rpmlist'

DEBUG: Host version \[3.0.1] release \[32039]

DEBUG: LogCommand(grep vmware-vmx /proc/vmware/sched/cpu)

DEBUG: Configure yum.conf to use repositories

DEBUG: Saving descriptor to file /etc/vmware/patchdb/ESX-1006511.xml

DEBUG: Adding entry with key

DEBUG: Entering \[ 12:06:10 12/08/06] \[PrepState ]

INFO: Preparing to install VMware ESX Server ESX-1006511...

DEBUG: Prepare pending package list...

DEBUG: Matching package name 1 and NAVR 0

DEBUG: LogCommand(yum info)

ERROR: Error (1) executing \[yum info]

retrygrab() failed for:

ftp://chbbwpss001/esxvi3/updates/ESX-1006511/headers/header.info

Executing failover method

failover: out of servers to try

Error getting file ftp://chbbwpss001/esxvi3/updates/ESX-1006511/headers/header.info

\[Errno 6] ERROR: Url Return no Content-Length - something is wrong

Gathering header information file(s) from server(s)

Server: Esxupdate-compatible repository for VMware ESX Server ESX-1006511

DEBUG: Saving descriptor to file /etc/vmware/patchdb/ESX-1006511.xml

DEBUG: Adding entry with key

DEBUG: Entering \[ 12:06:11 12/08/06] \[PrepFailed ]

DEBUG: Install cleanup...

DEBUG: LogCommand(rm -f /etc/vmware/esx.conf.WRITELOCK)

DEBUG: LogCommand(rm -f /var/lib/rpm/__db*)

DEBUG: Lock file /var/run/esxupdate.pid deleted

DEBUG: Final state: PrepFailed

0 Kudos
wt29
Contributor
Contributor
Jump to solution

Hi All.

I'm having the same problem (exactly) - did anyone find a solution?

I have reconfigured my IIS to use HTTP. I still get exactly the same result except I now get

\[Errno 4] IOError: HTTP Error 404: Not Found[/b]

When I run -info (using either FTP or HTTP) I get the expected information on the patch, RPMS's included etc.

Is this a Microsoft thing? I don't have the experience (or the spare servers) to set up an Apache based depot - nor do I want to as our management repositories are all Windows based.

When I run -v 10 I the first error in the DEBUG listing is

Error (1) executing \[yum info]

retrygrab() failed for:

http://......../depot/ESX-2158032/headers/header.info[/b]

Cheers

Tony

0 Kudos
AndyE
Contributor
Contributor
Jump to solution

have the same issue with an IIS 6 webserver.

i solved part of the problem by adding a mime-type to the folder where i store my updates.

esx-

\ |-ESX-1410076

\ |-ESX-.....

right click "esx" in IIS->Properties->HTTP-Headers->MIME Types->new

under Extension enter '*' under MIME Type enter 'application/octet-stream'

it will then show as '.* application/octet-stream'

this gets rid of the original error (which could also be seen when trying to download the .info file in a normal browser)

but now it claims it cant download the rpm's.

\[root@server1 isoimages]# esxupdate --force --noreboot -v 10 -r http://server/esx/ESX-1410076 update

DEBUG: Lock file /var/run/esxupdate.pid created with PID 16540

DEBUG: Options \{'url': 'http://server/esx/ESX-1410076', 'verbosity': 10, 'force': 1, 'noreboot': 1, 'enableRollback': 1} Command update

DEBUG: Entering \[ 10:26:01 12/28/06] \[ConfigState ]

INFO: Configuring...

DEBUG: Attempting to retrieve descriptor.xml from \[http://server/esx/ESX-1410076/]

DEBUG: rpms created = 6 for tag='rpmlist'

DEBUG: Host version \[3.0.1] release \[32039]

DEBUG: LogCommand(grep vmware-vmx /proc/vmware/sched/cpu)

DEBUG: Configure yum.conf to use repositories

DEBUG: Saving descriptor to file /etc/vmware/patchdb/ESX-1410076.xml

DEBUG: Adding entry with key

DEBUG: Entering \[ 10:26:02 12/28/06] \[PrepState ]

INFO: Preparing to install VMware ESX Server ESX-1410076...

DEBUG: Prepare pending package list...

DEBUG: Matching package name 6 and NAVR 6

DEBUG: LogCommand(yum info)

DEBUG: updates = []

DEBUG: newlist = []

DEBUG: downlist = []

DEBUG: downgrade pend : VMware-esx-apps.i386

DEBUG: downgrade pend : VMware-esx-backuptools.i386

DEBUG: downgrade pend : VMware-esx-debug-tools.i386

DEBUG: downgrade pend : VMware-esx-srvrmgmt.i386

DEBUG: downgrade pend : VMware-esx-vmx.i386

DEBUG: downgrade pend : VMware-hostd-esx.i386

DEBUG: -- Total 6 pending 6 installed 0

DEBUG: Checking $PATH...

DEBUG: PATH env variable = /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

DEBUG: Enabling rollbacks for this install...

DEBUG: LogCommand(ls /boot/grub/grub.conf /boot/grub/device.map /boot/initrdvmnix.img | xargs tar -P -czf /var/spool/esxupdate/systemfilesbackup.tar.gz /etc/vmware/*)

INFO: All system files backed up...

DEBUG: Removing files 0 <= mod time < 1167297961

DEBUG: iow... 01:00:00 01/01/70 <= mod time < 10:26:01 12/28/06

DEBUG: Saving descriptor to file /etc/vmware/patchdb/ESX-1410076.xml

DEBUG: Adding entry with key

DEBUG: Entering \[ 10:26:03 12/28/06] \[ForceState ]

INFO: Using rpm to downgrade 6 pkgs

DEBUG: Force installing package VMware-esx-vmx.i386

DEBUG: LogCommand(rpm -Uv --force --nodeps --repackage http://server/esx/ESX-1410076/VMware-esx-vmx-3.0.1-34176.i386.rpm)

DEBUG: | error: skipping http://server/esx/ESX-1410076/VMware-esx-vmx-3.0.1-34176.i386.rpm - transfer failed - Unknown or unexpected error

DEBUG: | Retrieving http://server/esx/ESX-1410076/VMware-esx-vmx-3.0.1-34176.i386.rpm

ERROR: Did not find VMware-esx-vmx-3.0.1-34176 in rpm -Uv output.

ERROR: Error (1) executing \[rpm -Uv --force --nodeps --repackage http://server/esx/ESX-1410076/VMware-esx-vmx-3.0.1-34176.i386.rpm]

error: skipping http://server/esx/ESX-1410076/VMware-esx-vmx-3.0.1-34176.i386.rpm - transfer failed - Unknown or unexpected error

Retrieving http://server/esx/ESX-1410076/VMware-esx-vmx-3.0.1-34176.i386.rpm

DEBUG: Checking 6 rpms in patch descriptor...

DEBUG: Matching package name 6 and NAVR 6

DEBUG: downgrade done: VMware-esx-apps.i386

DEBUG: downgrade done: VMware-esx-backuptools.i386

DEBUG: downgrade done: VMware-esx-debug-tools.i386

DEBUG: downgrade done: VMware-esx-srvrmgmt.i386

DEBUG: downgrade done: VMware-esx-vmx.i386

DEBUG: downgrade done: VMware-hostd-esx.i386

DEBUG: -- Total 6 pending 0 installed 6

DEBUG: Entering \[ 10:26:03 12/28/06] \[ForceFailed ]

DEBUG: Install cleanup...

DEBUG: LogCommand(rm -f /etc/vmware/esx.conf.WRITELOCK)

DEBUG: LogCommand(rm -f /var/lib/rpm/__db*)

INFO: --- TOTALS: 6 packages installed, 0 pending or failed, 0 excluded ---

INFO: Rpm install failed, correct the problem and retry the update.

DEBUG: Lock file /var/run/esxupdate.pid deleted

DEBUG: Final state: ForceFailed

i can retrieve the files without problem in a browser.

do you get the same behaviour when adding the mime-type?

kind regards

Andy

0 Kudos
mbrassel
Contributor
Contributor
Jump to solution

The change of MIME types may help with http update but not with the ftp issue. But be careful adding a MIME type with wildcards. Better try changing the MIME type of the actual file extension.

About the FTP problem I found something about the YUM which is used by esxupdate.

https://lists.dulug.duke.edu/pipermail/yum/2004-September/005272.html

ESX 3.0.1 has YUM version 2.0.7 on it and the issue should be resolved with yum 2.1.x.

If I check the installation source of ESX 3.0.1 the naming of the YUM rpm file shows that it may have been customized by VMWare. VMWare might want to check if a more current version of yum may be a good idea.

0 Kudos
tgradig
Hot Shot
Hot Shot
Jump to solution

Just heard back from VMware today on our FTP Depot problem..Great News..

There have been a few reports of this issue, there's a general workaround that you can try

Here's the procedure:

\- Login to the service console as root

\- Change directory to /usr/share/yum

\- Make a backup copy of urlgrabber.py (IMPORTANT)

cp urlgrabber.py urlgrabber.py.BAK

\- Edit urlgrabber.py and find the following lines:

if have_urllib2 or scheme != 'file':

  1. urllib does not provide content-length for local files

if not hdr is None and not hdr.has_key('Content-Length'):

raise URLGrabError(6, _('ERROR: Url Return no Content-Length - something is wrong'))

Comment them out (Add a '#' at the beginning of the line):

  1. if have_urllib2 or scheme != 'file':

  1. # urllib does not provide content-length for local files

  1. if not hdr is None and not hdr.has_key('Content-Length'):

  1. raise URLGrabError(6, _('ERROR: Url Return no Content-Length -

something is wrong'))

Try the esxupdate command again..

0 Kudos
GavinJ
Hot Shot
Hot Shot
Jump to solution

Thanks for posting Tony; I had same problem but this workaround is a good'un.

Cheers

Gavin

0 Kudos
MitC
Contributor
Contributor
Jump to solution

Thanks! Modifying the urlgrabber.py file allowed me to use the FTP depot option now.

0 Kudos
davidbarclay
Virtuoso
Virtuoso
Jump to solution

Had the same problem and this fix worked for me too!

Good work. I love the solution too, get error message so we comment out the error message logic.

LOL

Dave

0 Kudos
pmorrison
Enthusiast
Enthusiast
Jump to solution

OK so I tried that and it did work... But how can I incorporate this fix into a scripted kixstart ESX install?

0 Kudos
davidbarclay
Virtuoso
Virtuoso
Jump to solution

I haven't tried this, but technically you could use the %post part of your kickstart file to run a script. The script could use awk to search for the lines and comment them out.

Worth a shot.

Dave

0 Kudos
BenConrad
Expert
Expert
Jump to solution

I'm running v3.0.1 and it seems all I had to do was fix the mime type as AndyE suggested (IIS 6.0). FYI, I'm using HTTP for my updates.

I did not need to edit the .py file.

Ben

Message was edited by:

BenConrad

0 Kudos
MikeTedescucci
Enthusiast
Enthusiast
Jump to solution

Found it! Great post!

Mike

Message was edited by:

MikeTedescucci

0 Kudos
fastd
Contributor
Contributor
Jump to solution

I found that I needed to add a trailing / after the URL and it worked for me.

Hope this helps,

Darin.

0 Kudos
fastd
Contributor
Contributor
Jump to solution

Actually the trailing / made no difference...

My co-worker applied the modification to the /usr/share/yum/urlgrabber.py and didn't tell anyone.

Regards,

Darin.

0 Kudos
dominic7
Virtuoso
Virtuoso
Jump to solution

I've written a perl script to ftp/download check md5sums and patch hosts which can be found at this post:

http://www.vmware.com/community/thread.jspa?threadID=77514&tstart=0

Sounds like it might be useful in this situation.

0 Kudos
dapto
Contributor
Contributor
Jump to solution

Folks I believe this problem is caused by a space in the path to the patch.

Replace it with an underscore or something.

Cheers

Derek Benson

0 Kudos
Preetam_Zare
Contributor
Contributor
Jump to solution

Thought this seems to be ages old. But this information provided here has helped to resolve my problem. Thanks a lot.

- Preetam Zare
0 Kudos