okta / samples-nodejs-express-4

Express 4 samples. Will publish an artifact that can be consumed by end-to-end sample repos
Other
120 stars 120 forks source link

npm start /failed with Resource temporarily unavailable #19

Closed warddaniel closed 6 years ago

warddaniel commented 7 years ago

I am reporting this bug which throws an error but little else by way of error handling to detect root cause.

 npm start

> @okta/samples-nodejs-express-4@1.0.0 prestart /home/trophy12/public_html/okta/samples/samples-nodejs-express-4
> build-frontend

node[1728]: pthread_create: Resource temporarily unavailable
child_process.js:524
    throw err;
    ^

Error: Command failed: DIST_OUT=/home/trophy12/public_html/okta/samples/samples-nodejs-express-4/dist npm run build
    at checkExecSyncError (child_process.js:481:13)
    at execSync (child_process.js:521:13)
    at Object.<anonymous> (/home/trophy12/public_html/okta/samples/samples-nodejs-express-4/node_modules/@okta/samples-js-angular-1/scripts/build-frontend.js:23:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)

npm ERR! Linux 2.6.32-042stab094.7
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @okta/samples-nodejs-express-4@1.0.0 prestart: `build-frontend`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @okta/samples-nodejs-express-4@1.0.0 prestart script 'build-frontend'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @okta/samples-nodejs-express-4 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     build-frontend
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @okta/samples-nodejs-express-4
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @okta/samples-nodejs-express-4
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/trophy12/public_html/okta/samples/samples-nodejs-express-4/npm-debug.log

]# cat  /home/trophy12/public_html/okta/samples/samples-nodejs-express-4/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@3.10.10
3 info using node@v6.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: @okta/samples-nodejs-express-4@1.0.0
6 verbose lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/trophy12/public_html/okta/samples/samples-nodejs-express-4/node_modules/.bin:/usr/local/jdk/bin:/home/trophy12/perl5/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/trophy12/bin
8 verbose lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: CWD: /home/trophy12/public_html/okta/samples/samples-nodejs-express-4
9 silly lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: Args: [ '-c', 'build-frontend' ]
10 silly lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: Returned: code: 1  signal: null
11 info lifecycle @okta/samples-nodejs-express-4@1.0.0~prestart: Failed to exec prestart script
12 verbose stack Error: @okta/samples-nodejs-express-4@1.0.0 prestart: `build-frontend`
12 verbose stack Exit status 1
12 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
12 verbose stack     at emitTwo (events.js:106:13)
12 verbose stack     at EventEmitter.emit (events.js:191:7)
12 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
12 verbose stack     at emitTwo (events.js:106:13)
12 verbose stack     at ChildProcess.emit (events.js:191:7)
12 verbose stack     at maybeClose (internal/child_process.js:891:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
13 verbose pkgid @okta/samples-nodejs-express-4@1.0.0
14 verbose cwd /home/trophy12/public_html/okta/samples/samples-nodejs-express-4
15 error Linux 2.6.32-042stab094.7
16 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
17 error node v6.11.0
18 error npm  v3.10.10
19 error code ELIFECYCLE
20 error @okta/samples-nodejs-express-4@1.0.0 prestart: `build-frontend`
20 error Exit status 1
21 error Failed at the @okta/samples-nodejs-express-4@1.0.0 prestart script 'build-frontend'.
21 error Make sure you have the latest version of node.js and npm installed.
21 error If you do, this is most likely a problem with the @okta/samples-nodejs-express-4 package,
21 error not with npm itself.
21 error Tell the author that this fails on your system:
21 error     build-frontend
21 error You can get information on how to open an issue for this project with:
21 error     npm bugs @okta/samples-nodejs-express-4
21 error Or if that isn't available, you can get their info via:
21 error     npm owner ls @okta/samples-nodejs-express-4
21 error There is likely additional logging output above.
22 verbose exit [ 1, true ]
jmelberg-okta commented 7 years ago

@warddaniel: Looks like this issue is caused by the machine running out of address space. You can try: Increasing number of threads per process in linux

niketpathak commented 7 years ago

@jmelberg-okta What if increasing the number of threads in not an option (for example, in case of hosting on a shared server)? is there an alternate option?

robertjd commented 6 years ago

Closing, as this was related to the old version of this sample.

Sebastian-Nielsen commented 6 years ago

@niketpathak I am the same boat as you, did you solve it? If so, how?

vthink123 commented 6 years ago

I am also face same problem anybody got soluation?

node[849]: pthread_create: Resource temporarily unavailable

robertjd commented 6 years ago

Hi @Sebastian-Nielsen , @vthink123 , could you tell me more about the environments that you're using, e.g. which OS, are you using docker, etc? Thanks!

Sebastian-Nielsen commented 6 years ago

Hi @Sebastian-Nielsen , @vthink123 , could you tell me more about the environments that you're using, e.g. which OS, are you using docker, etc? Thanks!

@robertjd Windows 10, it's running on a heroku server. I found that it only occurs when I create too many requests/threads at once. If I run one at time everything works fine. So I guess the reason for the error - at least in my case - is exactly as the error message phrased it: "resource temporarily unavailable" -> I got to either slow down or optimize the code to run more efficiently.

SVRao19056 commented 6 years ago

Trying to run sample. Got below error Running on Windows 8 Steps followed

  1. Cloned Repo (https://github.com/okta/samples-nodejs-express-4.git)
  2. npm start --failed 'unable to find script'
  3. npm run okta-hosted-login-server

npm Error log

info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Users\\Suresh\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'okta-hosted-login-server' ] 2 info using npm@6.4.1 3 info using node@v9.3.0 4 verbose run-script [ 'preokta-hosted-login-server', 4 verbose run-script 'okta-hosted-login-server', 4 verbose run-script 'postokta-hosted-login-server' ] 5 info lifecycle @okta/samples-nodejs-express-4@3.0.0~preokta-hosted-login-server: @okta/samples-nodejs-express-4@3.0.0 6 info lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: @okta/samples-nodejs-express-4@3.0.0 7 verbose lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: unsafe-perm in lifecycle true 8 verbose lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: PATH: C:\Users\Suresh\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\dev\CRMApp\OktaSample\samples-nodejs-express-4\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Suresh\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\HP SimplePass\x64;C:\Program Files (x86)\HP SimplePass;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\FSharp-2.0.0.0\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Subversion\bin;C:\keenops\bin ;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files (x86)\LINQPad4;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Sudowin\Clients\Console;C:\Program Files\nodejs;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\dotnet;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Suresh\AppData\Roaming\npm;C:\Users\Suresh\AppData\Local\GitHubDesktop\bin 9 verbose lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: CWD: C:\dev\CRMApp\OktaSample\samples-nodejs-express-4 10 silly lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: Args: [ '/d /s /c', 'node okta-hosted-login/server.js' ] 11 silly lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: Returned: code: 1 signal: null 12 info lifecycle @okta/samples-nodejs-express-4@3.0.0~okta-hosted-login-server: Failed to exec okta-hosted-login-server script 13 verbose stack Error: @okta/samples-nodejs-express-4@3.0.0 okta-hosted-login-server:node okta-hosted-login/server.js 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (C:\Users\Suresh\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:159:13) 13 verbose stack at ChildProcess.<anonymous> (C:\Users\Suresh\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:159:13) 13 verbose stack at maybeClose (internal/child_process.js:943:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid @okta/samples-nodejs-express-4@3.0.0 15 verbose cwd C:\dev\CRMApp\OktaSample\samples-nodejs-express-4 16 verbose Windows_NT 6.3.9600 17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Suresh\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "okta-hosted-login-server" 18 verbose node v9.3.0 19 verbose npm v6.4.1 20 error code ELIFECYCLE 21 error errno 1 22 error @okta/samples-nodejs-express-4@3.0.0 okta-hosted-login-server:node okta-hosted-login/server.js 22 error Exit status 1 23 error Failed at the @okta/samples-nodejs-express-4@3.0.0 okta-hosted-login-server script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]