Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows command line tar "cannot connect to d: resolve failed" with Chef Knife

Using Windows Command line with cygwin, chef and ruby installed. When trying

knife cookbook site install mysql

returns the following error

Begin output of tar zxvf D:/path/to/chef-repo/cookbooks/mysql.tar.gz  
STDOUT:  
STDERR: tar<child>: Cannot connect to D: resolve failed  
gzip: stdin: undexpected end of file  
tar: Child returned status 128  
tar:  Error is not recoverable: exiting now</code>

How can I remedy this issue? I can manually unzip using

tar zxvf mysql.tar.gz  

but this is less than ideal. I believe this has to do with the colon in filename but how can I change that in the knife or chef preferences?

like image 448
csi Avatar asked Oct 10 '12 15:10

csi


Video Answer


2 Answers

The reason is that tar interprets colons (:) in file names as meaning it is a file on another machine. You can disable this behavior by using the flag --force-local.

This is from an answer from here.

like image 85
Matthias Avatar answered Nov 16 '22 01:11

Matthias


I don't know a complete answer but have been seeing this on Linux machines lately:

$ date > today
$ tar -czf - today > to:day.tgz
$ tar -tzf to:day.tgz
ssh: connect to host to port 22: Connection refused
tar (child): to\:day.tgz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now

gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now
$ tar -tzf - < to:day.tgz 
today
$ 

It appears that tar wants to do some sort of remote file processing because of the colon in the file name and you can fake it out by using some form of redirection or piping - for both reading and writing a tarball. I would still like to find an option or something to tell tar not to behave this way.

like image 31
mrbruno Avatar answered Nov 16 '22 01:11

mrbruno