New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot spawn puppet-lint ENOENT #17

Closed
quaintance opened this Issue Sep 2, 2015 · 18 comments

Comments

Projects
None yet
@quaintance
Copy link

quaintance commented Sep 2, 2015

since going to 0.5.0 the package is unable to call puppet-lint:
activate linter-erb
index.js:46 Window load time: 3113ms
events.js:141 Uncaught Error: spawn c:\tools\ruby200\bin\puppet-lint ENOENT
events.js:141 Uncaught Error: spawn c:\tools\ruby200\bin\puppet-lint ENOENT
2events.js:141 Uncaught Error: spawn puppet-lint ENOENT

this is windows 7, puppet-lint is in windows path, works fine from powershell, worked fine in previous versions of the package. I did have the path to puppet-lint explicitly configured in config.cson but have since removed that - doesn't seem to matter either way. clearly it's finding it, it just cannot execute it anymore, any ideas?

@quaintance

This comment has been minimized.

Copy link

quaintance commented Sep 2, 2015

resolved this by setting executablePath to puppet-lint.bat, so for whatever reason in either the new package or maybe something about one of my later atom updates causing some issue that now it needs to use the batch file wrapper which calls the shell script explicitly with ruby.exe:

@echo OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/tools/ruby200/bin/puppet-lint" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*

@dieterdemeyer

This comment has been minimized.

Copy link

dieterdemeyer commented Sep 4, 2015

I'm also getting this error on Mac OS X with Atom version: 1.0.11

@rammaram06

This comment has been minimized.

Copy link

rammaram06 commented Sep 14, 2015

I am getting same error on windows 7 with atom version: 1.0.11

'puppet-lint' could not be spawned. Is it installed and on your path?

Uncaught Error: spawn puppet-lint ENOENT

@rammaram06

This comment has been minimized.

Copy link

rammaram06 commented Sep 14, 2015

I added the puppet-lint.bat executable path to config.cson, it doesn't show the error anymore.
But I don't see the puppet-lint warnings or errors for puppet files in the editor..how to fix this?

@DevOpsFu

This comment has been minimized.

Copy link

DevOpsFu commented Sep 15, 2015

Another victim of this here. The issue seems to be related (or at least very similar) to this issue in node where spawn ignores the PATHEXT variable and therefore doesn't invoke puppet-lint.bat:

nodejs/node-v0.x-archive#2318

@DevOpsFu

This comment has been minimized.

Copy link

DevOpsFu commented Sep 17, 2015

Until a fix is found, downgrading the packages has got me working again:

apm install linter@1.2.4
apm install linter-puppet-lint@0.2.9

@mafredri

This comment has been minimized.

Copy link

mafredri commented Sep 23, 2015

It looks like there are now two config entries (not sure if there was before) for the puppet lint executable, I managed to resolve this issue by changing the settings:

Before:

After:

@rafitadiaz rafitadiaz added the bug label Sep 24, 2015

@rafitadiaz

This comment has been minimized.

Copy link
Contributor

rafitadiaz commented Sep 24, 2015

I tried to reproduce this bug on my linux and I couldn't. I'll try to get a windows box to reproduce it this weekend.
@mafredri Anyway the duplicate box in the setting will be fixed.

@DevOpsFu

This comment has been minimized.

Copy link

DevOpsFu commented Sep 27, 2015

@rafitadiaz It's due to the fact that the spawn() call doesn't invoke scripts on Windows - https://www.npmjs.com/package/win-spawn is a shim for this exact issue.

@janorn

This comment has been minimized.

Copy link

janorn commented Oct 26, 2015

Any progress on this? Running OSX and bitten by this bug.

@deesto

This comment has been minimized.

Copy link

deesto commented Oct 30, 2015

@janorn me too, after upgrading OS X to 10.11.1 and Atom to 1.1.0, with all plugins updated including Linter.
Uncaught Error: spawn puppet-lint ENOENT

Puppet-Lint is installed and accessible:
$ puppet-lint --version
puppet-lint 1.1.0

@deesto

This comment has been minimized.

Copy link

deesto commented Nov 4, 2015

@janorn, @dieterdemeyer, all: see @mafredri's work-around to explicitly set your puppet-lint executable path in the plugin settings. This works for me, but the plugin really should be fixed: this path is certainly in my $PATH.

@janorn

This comment has been minimized.

Copy link

janorn commented Nov 5, 2015

This does not work for me. I have already tried it.

Uncaught BufferedProcessError: Failed to spawn command /Users/XXXX/.rvm/bin/puppet-lint . Make sure /Users/XXXX/.rvm/bin/puppet-lint is installed and on your PATH

$ ls -l /Users/XXXX/.rvm/bin/puppet-lint 
lrwxr-xr-x  1 XXXX  staff  63 24 Jun  2014 /Users/XXXX/.rvm/bin/puppet-lint -> /Users/XXXX/.rvm/wrappers/ruby-1.9.3-p547@vagrant/puppet-lint
$ ls -l /Users/XXXX/.rvm/wrappers/ruby-1.9.3-p547@vagrant/puppet-lint
-rwxr-xr-x  1 XXXX  staff  326 26 Okt 14:49 /Users/XXXX/.rvm/wrappers/ruby-1.9.3-p547@vagrant/puppet-lint
$ /Users/XXXX/.rvm/wrappers/ruby-1.9.3-p547@vagrant/puppet-lint --version
puppet-lint 1.1.0
@janorn

This comment has been minimized.

Copy link

janorn commented Nov 13, 2015

Wiping atom cson config file. And pasting in the suggested config from the wiki made it start working again.

@paul-krohn

This comment has been minimized.

Copy link

paul-krohn commented Dec 13, 2015

There are 2 issues here.

  • puppet-lint isn't in your $PATH unless it happens to be at /usr/bin/puppet-lint. Workaround: put the full path in executablePath
  • specifying the full path to an rvm-installed puppet-lint doesn't work, because rvm installs executables with #!/usr/bin/env ruby_executable_hooks as the shbang line; ruby_executable_hooks is a shell function, not an executable. Workarounds: install puppet-lint as a system gem, or modify the shbang line to #!/usr/bin/env ruby
@janorn

This comment has been minimized.

Copy link

janorn commented Dec 14, 2015

@paul-krohn it sure is in my PATH. All of my rvm installed gems are in my path.
The solution here is not to install it as root, which i detest, but much simpler point it at the wrapped rvm version. I figured it must have had something todo with the rvm install.

cat ~/.rvm/wrappers/ruby-1.9.3-p547@vagrant/puppet-lint
#!/usr/bin/env bash

if
  [[ -s "/Users/XXXX/.rvm/gems/ruby-1.9.3-p547@vagrant/environment" ]]
then
  source "/Users/XXXX/.rvm/gems/ruby-1.9.3-p547@vagrant/environment"
  exec puppet-lint "$@"
else
  echo "ERROR: Missing RVM environment file: '/Users/XXXX/.rvm/gems/ruby-1.9.3-p547@vagrant/environment'" >&2
  exit 1
fi
@adam-moss

This comment has been minimized.

Copy link

adam-moss commented Dec 29, 2015

I have the same issue in OSX where puppet-lint is installed to /usr/local/bin. The workaround of hardcoding the full path to the executable works fine.

For reference:

gem installation:
gem install --user-install --no-document --bindir /usr/local/bin puppet-lint

/etc/paths:
/usr/local/bin /usr/bin /bin /usr/sbin /sbin

path:
/Users/user.name/.nvm/versions/node/v5.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(node is sourced via the nvm script in my .bash_profile)

@steelbrain had a similar issue in steelbrain/linter#726

@Arcanemagus

This comment has been minimized.

Copy link
Member

Arcanemagus commented Dec 29, 2015

@adam-moss that's just a part of running on OS X and Apple's "interesting" choice of giving applications launched from the GUI an empty environment. Workarounds for that are planned in Atom itself, and over in steelbrain/atom-linter#62.

I'm going to mark this as closed since from what I can tell every case reported has been a configuration issue and not an issue with linter-puppet-lint itself.

If anyone is having an issue running it that doesn't fall into one of these categories please comment further or better yet file a new issue 😉.

  • Running Atom on OS X through the GUI without fully specifying the path
  • Running puppet-lint through rvm and not using the wrapper (Thanks @janorn!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment