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

ε祈祈猫儿з 提交于 2019-12-08 14:55:49

问题


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?


回答1:


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.




回答2:


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.




回答3:


Will the tar command work if ran from cmd? Also what if the output is to a local drive. Something else try this,

tar zxvf "D:/path/to/chef-repo/cookbooks/mysql.tar.gz"


来源:https://stackoverflow.com/questions/12823499/windows-command-line-tar-cannot-connect-to-d-resolve-failed-with-chef-knife

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!