Git failures, Windows, Chef

I can’t be the only person experiencing frustration with Git on Windows,
which is essential do using any Windows box as a Chef Workstation of
course. I’ve been unable to find any reason and solution to the
following. If anyone has ideas, please share. I find it hard to believe
people use Windows as a Chef workstation on a daily basis with the
configuration below. What’s the secret?

  • Windows 8 (I had these same issues ~7 months ago) and Windows
    8.1 (now)
  • Git 1.9.4 installer from git-scm.org
  • Git-Bash as the command shell

I intermittently get:

ERROR: Errno::EIO: Input/output error - CreateProcessW

… and then the command in question will work fine.

…or I get some unknown failure as part of ‘knife cookbook site
install…’ commands that also then leave me sitting on some
chef-vendor-XXXXX branch:

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install vagrant --verbose
Installing vagrant to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-vagrant) exists, switching to it.
Downloading vagrant from the cookbooks site at version 0.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Removing pre-existing version.
Uncompressing vagrant version 0.2.0.
removing downloaded tarball
No changes made to vagrant
Checking out the master branch.
Installing dmg to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-dmg) exists, switching to it.
Downloading dmg from the cookbooks site at version 2.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Removing pre-existing version.
Uncompressing dmg version 2.2.0.
removing downloaded tarball
3 files updated, committing changes
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit
with [0], but received ‘1’
---- Begin output of git commit -m “Import dmg version 2.2.0” – dmg ----
STDOUT: On branch chef-vendor-dmg
nothing to commit, working directory clean
STDERR:
---- End output of git commit -m “Import dmg version 2.2.0” – dmg ----
Ran git commit -m “Import dmg version 2.2.0” – dmg returned 1

Jeff@PATCHY ~/chef-repo (chef-vendor-dmg)
$

I'm very surprised nobody's having these issues. Maybe everyone
doing git+chef work is on Windows 7 still?

On 8/11/2014 10:26 AM, Jeff Blaine wrote:

I can't be the only person experiencing frustration with Git on Windows,
which is essential do using any Windows box as a Chef Workstation of
course. I've been unable to find any reason and solution to the
following. If anyone has ideas, please share. I find it hard to believe
people use Windows as a Chef workstation on a daily basis with the
configuration below. What's the secret?

  • Windows 8 (I had these same issues ~7 months ago) and Windows
    8.1 (now)
  • Git 1.9.4 installer from git-scm.org
  • Git-Bash as the command shell

I intermittently get:

ERROR: Errno::EIO: Input/output error - CreateProcessW

... and then the command in question will work fine.

...or I get some unknown failure as part of 'knife cookbook site
install...' commands that also then leave me sitting on some
chef-vendor-XXXXX branch:

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install vagrant --verbose
Installing vagrant to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-vagrant) exists, switching to it.
Downloading vagrant from the cookbooks site at version 0.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Removing pre-existing version.
Uncompressing vagrant version 0.2.0.
removing downloaded tarball
No changes made to vagrant
Checking out the master branch.
Installing dmg to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-dmg) exists, switching to it.
Downloading dmg from the cookbooks site at version 2.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Removing pre-existing version.
Uncompressing dmg version 2.2.0.
removing downloaded tarball
3 files updated, committing changes
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit
with [0], but received '1'
---- Begin output of git commit -m "Import dmg version 2.2.0" -- dmg ----
STDOUT: On branch chef-vendor-dmg
nothing to commit, working directory clean
STDERR:
---- End output of git commit -m "Import dmg version 2.2.0" -- dmg ----
Ran git commit -m "Import dmg version 2.2.0" -- dmg returned 1

Jeff@PATCHY ~/chef-repo (chef-vendor-dmg)
$

--
Jeff Blaine
kickflop.net
PGP/GnuPG Key ID: 0x0C8EDD02

The only git errors we get on Windows is when it installs and updates the
environment variable. This is then called within the same chef run by
another cookbook and fails as in Windows the when the shell is loaded it
runs environment variables and only reads the update when it is relaunched.
Hence on the next chef run it works.

Not seen the error you have and unsure if what we see if at all helpful to
you.......

On 14 August 2014 14:23, Jeff Blaine jblaine@kickflop.net wrote:

I'm very surprised nobody's having these issues. Maybe everyone
doing git+chef work is on Windows 7 still?

On 8/11/2014 10:26 AM, Jeff Blaine wrote:

I can't be the only person experiencing frustration with Git on Windows,
which is essential do using any Windows box as a Chef Workstation of
course. I've been unable to find any reason and solution to the
following. If anyone has ideas, please share. I find it hard to believe
people use Windows as a Chef workstation on a daily basis with the
configuration below. What's the secret?

  • Windows 8 (I had these same issues ~7 months ago) and Windows
    8.1 (now)
  • Git 1.9.4 installer from git-scm.org
  • Git-Bash as the command shell

I intermittently get:

ERROR: Errno::EIO: Input/output error - CreateProcessW

... and then the command in question will work fine.

...or I get some unknown failure as part of 'knife cookbook site
install...' commands that also then leave me sitting on some
chef-vendor-XXXXX branch:

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install vagrant --verbose
Installing vagrant to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-vagrant) exists, switching to it.
Downloading vagrant from the cookbooks site at version 0.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Removing pre-existing version.
Uncompressing vagrant version 0.2.0.
removing downloaded tarball
No changes made to vagrant
Checking out the master branch.
Installing dmg to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-dmg) exists, switching to it.
Downloading dmg from the cookbooks site at version 2.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Removing pre-existing version.
Uncompressing dmg version 2.2.0.
removing downloaded tarball
3 files updated, committing changes
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit
with [0], but received '1'
---- Begin output of git commit -m "Import dmg version 2.2.0" -- dmg


STDOUT: On branch chef-vendor-dmg
nothing to commit, working directory clean
STDERR:
---- End output of git commit -m "Import dmg version 2.2.0" -- dmg ----
Ran git commit -m "Import dmg version 2.2.0" -- dmg returned 1

Jeff@PATCHY ~/chef-repo (chef-vendor-dmg)
$

--
Jeff Blaine
kickflop.net
PGP/GnuPG Key ID: 0x0C8EDD02

Hi Jeff!

Jeff Blaine jblaine@kickflop.net writes:

I'm very surprised nobody's having these issues. Maybe everyone
doing git+chef work is on Windows 7 still?

I haven't seen this issue with chef+git+windows. In one case, though not
chef specific, I have regularly used git on windows with a largish repo (150MB+).

Perhaps at the very least you could obtain more info with GIT_TRACE and
maybe GIT_CURL_VERBOSE

since you're using git bash, this should at least give you a lot more
debug output

export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
knife cookbook site install vagrant --verbose

maybe that will give you a better idea what's failing.

On 8/11/2014 10:26 AM, Jeff Blaine wrote:

I can't be the only person experiencing frustration with Git on Windows,
which is essential do using any Windows box as a Chef Workstation of
course. I've been unable to find any reason and solution to the
following. If anyone has ideas, please share. I find it hard to believe
people use Windows as a Chef workstation on a daily basis with the
configuration below. What's the secret?

  • Windows 8 (I had these same issues ~7 months ago) and Windows
    8.1 (now)
  • Git 1.9.4 installer from git-scm.org
  • Git-Bash as the command shell

I intermittently get:

ERROR: Errno::EIO: Input/output error - CreateProcessW

... and then the command in question will work fine.

...or I get some unknown failure as part of 'knife cookbook site
install...' commands that also then leave me sitting on some
chef-vendor-XXXXX branch:

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install vagrant --verbose
Installing vagrant to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-vagrant) exists, switching to it.
Downloading vagrant from the cookbooks site at version 0.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/vagrant.tar.gz
Removing pre-existing version.
Uncompressing vagrant version 0.2.0.
removing downloaded tarball
No changes made to vagrant
Checking out the master branch.
Installing dmg to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-dmg) exists, switching to it.
Downloading dmg from the cookbooks site at version 2.2.0 to
c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/dmg.tar.gz
Removing pre-existing version.
Uncompressing dmg version 2.2.0.
removing downloaded tarball
3 files updated, committing changes
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit
with [0], but received '1'
---- Begin output of git commit -m "Import dmg version 2.2.0" -- dmg ----
STDOUT: On branch chef-vendor-dmg
nothing to commit, working directory clean
STDERR:
---- End output of git commit -m "Import dmg version 2.2.0" -- dmg ----
Ran git commit -m "Import dmg version 2.2.0" -- dmg returned 1

Jeff@PATCHY ~/chef-repo (chef-vendor-dmg)
$

--
-sean

Perhaps at the very least you could obtain more info with GIT_TRACE and
maybe GIT_CURL_VERBOSE

since you're using git bash, this should at least give you a lot more
debug output

export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
knife cookbook site install vagrant --verbose

maybe that will give you a better idea what's failing.

Here's another fresh example but with the above turned on. This is
exactly the craziness I experienced ~7 months ago when I last tried
working in this environment (Windows 8 then and now).

I've annotated it.

This is all in the same fresh Git-Bash:

Trace vars are set

Jeff@PATCHY ~/chef-repo/cookbooks (master)
$ env | grep GIT
GIT_TRACE=1
GIT_CURL_VERBOSE=1

Repo clean state

Jeff@PATCHY ~/chef-repo/cookbooks (master)
$ git status
trace: built-in: git 'status'
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

First, total failure

Jeff@PATCHY ~/chef-repo/cookbooks (master)
$ knife cookbook site install windows --verbose
Installing windows to c:/Users/Jeff/chef-repo/cookbooks
ERROR: Errno::EIO: Input/output error - CreateProcessW

We back up a directory and it tries to work...

Jeff@PATCHY ~/chef-repo/cookbooks (master)
$ cd ..

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install windows --verbose
Installing windows to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-windows) exists, switching to it.
Downloading windows from the cookbooks site at version 1.34.2 to
c:/Users/Jeff/c
hef-repo/cookbooks/windows.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/windows.tar.gz
Removing pre-existing version.
Uncompressing windows version 1.34.2.
removing downloaded tarball
39 files updated, committing changes
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit
with [0],
but received '1'
---- Begin output of git commit -m "Import windows version 1.34.2" --
windows ----
STDOUT: On branch chef-vendor-windows
nothing to commit, working directory clean
STDERR: trace: built-in: git 'commit' '-m' 'Import windows version
1.34.2' '--' 'windows'
---- End output of git commit -m "Import windows version 1.34.2" --
windows ----

Ran git commit -m "Import windows version 1.34.2" -- windows returned 1

Let's get back on master since we were left on chef-vendor-windows

Jeff@PATCHY ~/chef-repo (chef-vendor-windows)
$ git checkout master
trace: built-in: git 'checkout' 'master'
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

And we try again and it WORKS!

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install windows --verbose
Installing windows to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-windows) exists, switching to it.
Downloading windows from the cookbooks site at version 1.34.2 to
c:/Users/Jeff/chef-repo/cookbooks/windows.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/windows.tar.gz
Removing pre-existing version.
Uncompressing windows version 1.34.2.
removing downloaded tarball
No changes made to windows
Checking out the master branch.
Installing chef_handler to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-chef_handler) exists, switching to it.
Downloading chef_handler from the cookbooks site at version 1.1.6 to
c:/Users/Jeff/chef-repo/cookbooks/chef_handler.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/chef_handler.tar.gz
Removing pre-existing version.
Uncompressing chef_handler version 1.1.6.
removing downloaded tarball
No changes made to chef_handler
Checking out the master branch.

We run the same command again for kicks and it FAILS!

Jeff@PATCHY ~/chef-repo (master)
$ knife cookbook site install windows --verbose
Installing windows to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-windows) exists, switching to it.
Downloading windows from the cookbooks site at version 1.34.2 to
c:/Users/Jeff/chef-repo/cookbooks/windows.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/windows.tar.gz
Removing pre-existing version.
Uncompressing windows version 1.34.2.
removing downloaded tarball
5 files updated, committing changes
ERROR: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit
with [0], but received '1'
---- Begin output of git commit -m "Import windows version 1.34.2" --
windows ----
STDOUT: On branch chef-vendor-windows
nothing to commit, working directory clean
STDERR: trace: built-in: git 'commit' '-m' 'Import windows version
1.34.2' '--' 'windows'
---- End output of git commit -m "Import windows version 1.34.2" --
windows ----

Ran git commit -m "Import windows version 1.34.2" -- windows returned 1

We run the same command AGAIN for kicks and it WORKS!

Jeff@PATCHY ~/chef-repo (chef-vendor-windows)
$ knife cookbook site install windows --verbose
Installing windows to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-windows) exists, switching to it.
Downloading windows from the cookbooks site at version 1.34.2 to
c:/Users/Jeff/c
hef-repo/cookbooks/windows.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/windows.tar.gz
Removing pre-existing version.
Uncompressing windows version 1.34.2.
removing downloaded tarball
No changes made to windows
Checking out the master branch.
Installing chef_handler to c:/Users/Jeff/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-chef_handler) exists, switching to it.
Downloading chef_handler from the cookbooks site at version 1.1.6 to
c:/Users/Jeff/chef-repo/cookbooks/chef_handler.tar.gz
Cookbook saved: c:/Users/Jeff/chef-repo/cookbooks/chef_handler.tar.gz
Removing pre-existing version.
Uncompressing chef_handler version 1.1.6.
removing downloaded tarball
No changes made to chef_handler
Checking out the master branch.

Jeff@PATCHY ~/chef-repo (master)
$