How to debug Errno::EIO error in Chef recipe using Chef::Provider::Git - ruby

I'm trying to use chef to check out a git repo to a windows client node.
This seems simple enough and I've got the following resource definition:
git "C:\\pathtocheckout" do
repo "https://gitserver/repo.git"
action [ :checkout, :sync]
end
But when this is reached by chef-client I get:
Errno::EIO: git[C:\pathtocheckout] (cookbook_name::test line 21) had an error: Errno::EIO: Input/output error - CreateProcessW
I've had a look at the stacktrace produced and it appears to be something to do with creating a process to run the git command - but this is the limit of my knowledge.
I've made sure git is installed on on Path, removed all other recipes from the run list, running as a different admin user and I've tried different repositories but all with the same error.
So I'm pretty stumped - anyone got a way I can dig into this error and see what is going on?

Related

Error: command "bash" failed with no error message?

I am using terraform on my Mac system, and terraform apply results with below error
Error: command "bash" failed with no error message
on ssm.tf line 7, in data "external" "ssm-dynamic-general":
7: data "external" "ssm-dynamic-general" {
However there is nothing wrong in ssm.tf file, same runs perfectly fine in my another system.
Can some one please let me know what i am missing here?
You might have done what I accidentally did: not follow the external program protocol:
https://www.terraform.io/docs/providers/external/data_source.html#external-program-protocol
In my particular case, I failed to send the errors that were coming from my program to standard error. Instead, those errors were going to standard out.
That's why Terraform wasn't able to report on those errors.
So if you send any and all errors from your program to standard error using > &2, you should be able to see those errors when you run terraform plan.

Jekyll Error - "serve" only works once

Started working on an update to my website. It was working fine the other day but now I get an error.
I generally type on CMD (i'm on Windows 10) "bundle exec Jekyll serve --watch" and the server goes. I can edit and save and its all reflected in browser upon refresh.
Now I can do this, but if I make one change to any file it works. Do another change and I get an error. I have to terminate and type again.
Below is the error:
D:\Tristen Grant\Documents\GitHub\portfolio>bundle exec jekyll serve --watch
DL is deprecated, please use Fiddle
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Source: D:/Tristen Grant/Documents/GitHub/portfolio
Destination: D:/Tristen Grant/Documents/GitHub/portfolio/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.595 seconds.
Auto-regeneration: enabled for 'D:/Tristen Grant/Documents/GitHub/portfolio'
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Server address: http://127.0.0.1:3000//
Server running... press ctrl-c to stop.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:28 ...done in 0.521498 seconds.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:30 ...error:
Error: No such file or directory - git rev-parse HEAD
Error: Run jekyll build --trace for more information.
[2016-09-06 16:19:35] ERROR Errno::ENOTSOCK: An operation was attempted on something that is not a socket.
C:/Ruby21-x64/lib/ruby/2.1.0/webrick/server.rb:170:in `select'
Terminate batch job (Y/N)? y
Terminate batch job (Y/N)? y
I'm using Ruby 2.1.5 64 bit version. RubyDevKit, Sass, Bourbon.
Any ideas how to fix this? I don't know much about Jekyll or ruby. Just starting out.
I also get this error in CMD. You should have github's desktop app installed; try running the same commands from the GitShell you get with that app.
For me that works, it saves me the trouble of installing git globally on Windows and setting it up.

Chef - ArgumentError: too short control escape

I will glad to get an any help in the next issue:
when I run a numerous recipes (when I run an each in a separate way it doesn't fails), I sometimes get a next error:
"ArgumentError: too short control escape"
log:
[2016-03-15T15:41:55+01:00] INFO: Running queued delayed notifications before re-raising exception
[2016-03-15T15:41:55+01:00] ERROR: Running exception handlers
[2016-03-15T15:41:55+01:00] ERROR: Exception handlers complete
[2016-03-15T15:41:55+01:00] FATAL: Stacktrace dumped to c:/chef/chef-stacktrace.out
[2016-03-15T15:41:55+01:00] FATAL: ArgumentError: too short control escape
chef-stacktrace.out:
Generated at 2016-03-14 15:56:29 +0100
ArgumentError: too short control escape
C:/opscode/chef/embedded/apps/chef/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:66:in 'recipe_snippet'
C:/opscode/chef/embedded/apps/chef/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:43:in 'add_explanation'
It happens randomly and I can't to find an explanation,
Thanks
I'm guessing something is going wonky with the regexp compile. It supposed to use Regexp.escape(source) but something might be slipping through? Please include the full error output though.
After a deep investigations, we have found the root cause of the issue. The name of the Github repository was interpreted by Chef as an escape character (the name of repository was starting with capital letter "C") which caused the configuration to fail alternately.
It regards to Chef 12.0.3 version (I hope, they fixed it in a newer next version)
We changed the name of repository and it solved the problem.

Error: EACCES, unlink...

I'm trying to get my meteor app up and running, but I don't understand the error that its throwing at all, which is:
/Users/ten3/.meteor/packages/meteor- tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278
throw(ex);
^
Error: EACCES, unlink '/Users/ten3/Desktop/git/ten/website/prospect-recovery/prospect-recovery/.meteor/local/db/mongod.lock'
at Object.Future.wait (/Users/ten3/.meteor/packages/meteor-tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
at /tools/fs/files.js:1331:28
at Object.wrapper [as unlink] (/tools/fs/files.js:1334:20)
at findMongoAndKillItDead (/tools/runners/run-mongo.js:318:11)
at launchOneMongoAndWaitForReadyForInitiate (/tools/runners/run-mongo.js:400:7)
at launchMongo (/tools/runners/run-mongo.js:656:7)
at [object Object]._.extend._startOrRestart (/tools/runners/run-mongo.js:756:19)
at [object Object]._.extend.start (/tools/runners/run-mongo.js:714:10)
at /tools/runners/run-all.js:168:26
- - - - -
I'm running a shell script before I try to run a local copy of my meteor app. It supposed to stop my application from interacting with other APIs. When I run the script (I'm on a mac) through my terminal, it returns '0' which as I read means that there are zero errors. I know that the error message is guiding me to certain lines of code, but I don't understand why I would change them if my co-worker could get his copy up and running. He is running his application on a windows computer. Thank you. I'm pretty new to this.
It was a permission error just as #thatgibbyguy first suggested. I was able to run it buy using sudo meteor to override the permission restrictions. I wasn't about to remove my mongod.lock file since that my coworker had the file and was able to get it up and running.

File files/default/plugins/README does not exist for cookbook ohai

I'm running a provisioning setup using vagrant and chef-solo to install the gitlab cookbook (however, this problem does not seem to be specific to the gitlab cookbook).
The run-list is simple:
{
"run_list": [
"recipe[ohai::default]"
]
}
The chef-solo run (chef-solo -c solo.rb -j dna.json) results in the following error:
Error executing action create on resource 'cookbook_file[/etc/chef/ohai_plugins/README]'
The file IS there:
# ls -l /tmp/vagrant-chef/e939c8a8cabcf9cdd72f5d7c3a98d728/cookbooks/ohai-2.0.1/files/default/plugins/README
-rwxrwxrwx. 1 vagrant vagrant 49 Oct 21 13:16 /tmp/vagrant-chef/e939c8a8cabcf9cdd72f5d7c3a98d728/cookbooks/ohai-2.0.1/files/default/plugins/README
When I check the process with 'strace' it looks like I can see the error source:
10444 0.000210 stat("/tmp/vagrant-chef/cookbooks/cookbooks/ohai/files/default/plugins/README", 0x7ffff0570bb0) = -1 ENOENT (No such file or directory)
If you notice, the cookbook is named 'ohai-2.0.1' however the process is trying to access the cookbook 'ohai' (i.e., without the version number).
Has anyone else encountered this before? I've seen one other post related to the issue that suggested putting ohai::default first in the run-list, which I've done (see dna.json above)
This happened to me while using Berkshelf. It names all of the cookbooks name-version instead of just name. To solve this, I did berks vendor and added that directory to my cookbooks path. Now everything works!

Resources