andrewchilds/overcast

overcast/bin/ssh: fork: Resource temporarily unavailable

garnold opened this issue · 3 comments

Hey @andrewchilds, when attempting to run a command using a freshly forked clone of the Overcast repo (and adding /path/to/overcast/bin to my path), I'm receiving the following error:

overcast garnold$ overcast run all health

sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 
sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 
sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 

...

sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: 
sux-pi-1: $ /bin/bash -s /Users/garnold/Dropbox/Development/Projects/overcast/scripts/health
sux-pi-1: /Users/garnold/Development/Projects/overcast/bin/ssh: fork: Resource temporarily unavailable
sux-pi-1: SSH connection exited with a non-zero code (128). Stopping execution...

When installing Overcast via NPM and issuing the same command, everything works as expected:

overcast garnold$ overcast run all health

sux-pi-1: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-1: {
sux-pi-1: "cpu_1min": "0.12",
sux-pi-1: "cpu_5min": "0.05",
sux-pi-1: "cpu_15min": "0.05",
sux-pi-1: "disk_total": "6095",
sux-pi-1: "disk_used": "2483",
sux-pi-1: "disk_free": "3285",
sux-pi-1: "mem_total": "437",
sux-pi-1: "mem_used": "391",
sux-pi-1: "mem_free": "46",
sux-pi-1: "cache_used": "49",
sux-pi-1: "cache_free": "388",
sux-pi-1: "swap_total": "99",
sux-pi-1: "swap_used": "0",
sux-pi-1: "swap_free": "99",
sux-pi-1: "tcp": "3",
sux-pi-1: "rx_bytes": "806350951",
sux-pi-1: "tx_bytes": "2912126130",
sux-pi-1: "io_reads": "",
sux-pi-1: "io_writes": "",
sux-pi-1: "processes": [
sux-pi-1: "...",
sux-pi-1: ""
sux-pi-1: ]
sux-pi-1: }
sux-pi-1: 

sux-pi-2: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-2: {
sux-pi-2: "cpu_1min": "0.24",
sux-pi-2: "cpu_5min": "0.21",
sux-pi-2: "cpu_15min": "0.16",
sux-pi-2: "disk_total": "5986",
sux-pi-2: "disk_used": "3251",
sux-pi-2: "disk_free": "2409",
sux-pi-2: "mem_total": "437",
sux-pi-2: "mem_used": "422",
sux-pi-2: "mem_free": "15",
sux-pi-2: "cache_used": "106",
sux-pi-2: "cache_free": "330",
sux-pi-2: "swap_total": "99",
sux-pi-2: "swap_used": "0",
sux-pi-2: "swap_free": "99",
sux-pi-2: "tcp": "21",
sux-pi-2: "rx_bytes": "2739004562",
sux-pi-2: "tx_bytes": "1680153943",
sux-pi-2: "io_reads": "169010266",
sux-pi-2: "io_writes": "250421112",
sux-pi-2: "processes": [
sux-pi-2: "...",
sux-pi-2: ""
sux-pi-2: ]
sux-pi-2: }
sux-pi-2: 

sux-pi-3: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-3: {
sux-pi-3: "cpu_1min": "0.00",
sux-pi-3: "cpu_5min": "0.03",
sux-pi-3: "cpu_15min": "0.05",
sux-pi-3: "disk_total": "5986",
sux-pi-3: "disk_used": "3208",
sux-pi-3: "disk_free": "2452",
sux-pi-3: "mem_total": "437",
sux-pi-3: "mem_used": "409",
sux-pi-3: "mem_free": "27",
sux-pi-3: "cache_used": "44",
sux-pi-3: "cache_free": "392",
sux-pi-3: "swap_total": "99",
sux-pi-3: "swap_used": "0",
sux-pi-3: "swap_free": "99",
sux-pi-3: "tcp": "3",
sux-pi-3: "rx_bytes": "0",
sux-pi-3: "tx_bytes": "0",
sux-pi-3: "io_reads": "",
sux-pi-3: "io_writes": "",
sux-pi-3: "processes": [
sux-pi-3: "...",
sux-pi-3: ""
sux-pi-3: ]
sux-pi-3: }
sux-pi-3: 

sux-pi-4: $ /bin/bash -s /usr/local/lib/node_modules/overcast/scripts/health
sux-pi-4: {
sux-pi-4: "cpu_1min": "0.00",
sux-pi-4: "cpu_5min": "0.01",
sux-pi-4: "cpu_15min": "0.05",
sux-pi-4: "disk_total": "13207",
sux-pi-4: "disk_used": "3309",
sux-pi-4: "disk_free": "9204",
sux-pi-4: "mem_total": "437",
sux-pi-4: "mem_used": "414",
sux-pi-4: "mem_free": "23",
sux-pi-4: "cache_used": "45",
sux-pi-4: "cache_free": "392",
sux-pi-4: "swap_total": "99",
sux-pi-4: "swap_used": "0",
sux-pi-4: "swap_free": "99",
sux-pi-4: "tcp": "3",
sux-pi-4: "rx_bytes": "2333643989",
sux-pi-4: "tx_bytes": "2121280946",
sux-pi-4: "io_reads": "",
sux-pi-4: "io_writes": "",
sux-pi-4: "processes": [
sux-pi-4: "...",
sux-pi-4: ""
sux-pi-4: ]
sux-pi-4: }
sux-pi-4: 

Any thoughts?

@andrewchilds I think I know what's going on. By adding /path/to/overcast/bin to the front of my $PATH, when Overcast invokes the /path/to/overcast/bin/ssh wrapper script, which attempts to invoke the ssh command, it is instead recursively invoking the wrapper script since it's first in the path. Let me try adding /path/to/overcast/bin after /usr/bin (but before /usr/local/bin, where the NPM-installed overcast executable is located).

@andrewchilds Yep, that worked!

What do you think about renaming the overcast/bin/ssh and overcast/bin/vagrant wrapper scripts to avoid this problem?

Moving discussion to #34 .