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

Error: Couldn't run ps ax: {} #2158

Closed
bodiam opened this Issue May 19, 2014 · 7 comments

Comments

Projects
None yet
3 participants
@bodiam

bodiam commented May 19, 2014

Hi all,

I just downloaded the newest version of Meteor, and when I try to start a simple application on my Mac, I get the following error: Error: Couldn't run ps ax: {}

LM-AMS-00963649:my_cool_ap2 epragt$ meteor
[[[[[ ~/Projects/playground/my_cool_ap2 ]]]]]

=> Started proxy.
=> Starting MongoDB... -
/Users/epragt/.meteor/tools/6f23056589/lib/node_modules/fibers/future.js:206
                        throw(ex);
                              ^
Error: Couldn't run ps ax: {}
    at Object.Future.wait (/Users/epragt/.meteor/tools/6f23056589/lib/node_modules/fibers/future.js:326:15)
    at findMongoPids (/Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:84:14)
    at findMongoAndKillItDead (/Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:114:14)
    at launchOneMongoAndWaitForReadyForInitiate (/Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:229:5)
    at launchMongo (/Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:491:7)
    at _.extend._startOrRestart (/Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:580:19)
    at _.extend.start (/Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:546:10)
    at _.extend.start (/Users/epragt/.meteor/tools/6f23056589/tools/run-all.js:131:24)
    at Object.exports.run (/Users/epragt/.meteor/tools/6f23056589/tools/run-all.js:272:10)
    at main.registerCommand.name [as func] (/Users/epragt/.meteor/tools/6f23056589/tools/commands.js:210:17)
    at /Users/epragt/.meteor/tools/6f23056589/tools/main.js:949:23
    - - - - -
    at /Users/epragt/.meteor/tools/6f23056589/tools/run-mongo.js:55:22
    at ChildProcess.exithandler (child_process.js:633:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
LM-AMS-00963649:my_cool_ap2 epragt$

glasser added a commit that referenced this issue May 22, 2014

get error message in 'ps ax' failure case
We still want JSON.stringify too because that includes stuff like the
exit code.

See #2158
@glasser

This comment has been minimized.

Member

glasser commented May 22, 2014

OK, first off we have an error handling problem: we should get more information than {} from a failure. Just pushed something to address that.

It's pretty surprising to me that this doesn't work for you. ps is a basic Unix command that should ship with all Macs.

Can you show the terminal output from these commands?

ps ax
which ps
type -a ps
echo $PATH
ls -l /bin/ps

What version of Mac OS X are you running

@bodiam

This comment has been minimized.

bodiam commented May 23, 2014

Hi, thanks for the help! Sure, the output is as follows:

ps ax

LM-AMS-00963649:~ epragt$ ps ax
  PID   TT  STAT      TIME COMMAND
    1   ??  Ss    16:35.46 /sbin/launchd
   11   ??  Ss     2:44.97 /usr/libexec/UserEventAgent (System)
   12   ??  Ss     0:24.11 /usr/libexec/kextd
   13   ??  Ss     1:18.47 /usr/libexec/taskgated -s
   14   ??  Ss     1:33.71 /usr/sbin/notifyd
   15   ??  Ss     0:20.92 /usr/sbin/securityd -i
   16   ??  Ss     0:25.03 /System/Library/CoreServices/powerd.bundle/powerd
   17   ??  Ss     0:14.78 /usr/libexec/diskarbitrationd
   18   ??  Ss     1:11.08 /usr/libexec/configd
   19   ??  Ss     0:36.87 /usr/sbin/syslogd
   21   ??  Ss     0:22.91 /usr/sbin/distnoted daemon
   22   ??  Ss     4:54.61 /usr/libexec/opendirectoryd
   29   ??  Ss     0:04.86 com.apple.authd
   36   ??  Ss     0:23.73 /System/Library/CoreServices/coreservicesd
   39   ??  Ss    22:31.92 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Support/fseventsd
   40   ??  Ss     0:02.46 /usr/libexec/usbd
   41   ??  Ss     1:28.24 /usr/sbin/mDNSResponder
   42   ??  Ss     0:23.60 /usr/libexec/networkd
   62   ??  SNs    0:01.32 /usr/libexec/warmd
   66   ??  Ss     0:00.69 /usr/libexec/stackshot -t
...etc

which ps:

LM-AMS-00963649:~ epragt$ which ps
/bin/ps

type -a ps:

LM-AMS-00963649:~ epragt$ type -a ps
ps is /bin/ps

echo $PATH

LM-AMS-00963649:~ epragt$ echo $PATH
/Users/epragt/dev/tools/maven-mp/bin:bin:/opt/boxen/homebrew/share/python:/opt/boxen/rbenv/shims:/opt/boxen/rbenv/bin:/opt/boxen/rbenv/plugins/ruby-build/bin:node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:/opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:/Users/epragt/dev/tools/maven-mp/bin:bin:/opt/boxen/homebrew/share/python:/opt/boxen/rbenv/shims:/opt/boxen/rbenv/bin:/opt/boxen/rbenv/plugins/ruby-build/bin:node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:/opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/epragt/dev/tools/localstatus:/opt/boxen/nodenv/versions/v0.8/bin

ls -l

LM-AMS-00963649:~ epragt$ ls -l /bin/ps
-rwsr-xr-x  1 root  wheel  46784 Feb 25 23:58 /bin/ps

I also applied your fix to my location installation, and I got a better, but still very weird, error message:

=> Starting MongoDB... -
/Users/epragt/.meteor/tools/6f23056589/lib/node_modules/fibers/future.js:206
                        throw(ex);
                              ^
Error: Couldn't run ps ax: {}; stdout maxBuffer exceeded.

This might be something, but I'm not sure if it applies to Meteor also: gmarty/grunt-closure-compiler#12

@bodiam

This comment has been minimized.

bodiam commented May 23, 2014

Btw, I'm running 10.9.2 of MacOSX

@bodiam

This comment has been minimized.

bodiam commented May 23, 2014

I found it, thanks for adding the patch! The problem is that there's an 'exec' of the ps ax, and it's exceeding the limit of 'exec'. There seem to be 2 solutions: increase the maxBuffer, which is what I did by adding {maxBuffer: 1024*1024}, or spawn the process instead, which seems to be the better solution.

If you want, I can try to write a fix using the spawn?

@glasser glasser closed this in 2e79408 May 24, 2014

@glasser

This comment has been minimized.

Member

glasser commented May 24, 2014

spawn is actually subtle enough (properly piping, using the right events, etc... we've messed this up before) that I'd rather just boost the maxBuffer. 10MB should be enough, riiiiiiight? Thanks for tracking this down.

@bigtbigtbigt

This comment has been minimized.

bigtbigtbigt commented Mar 13, 2015

I was experiencing this with Meteor 0.8.1.3, and I solved the issue by closing several of my many open applications.

@glasser

This comment has been minimized.

Member

glasser commented Mar 13, 2015

This was fixed in Meteor 0.8.2 last June, for the record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment