Skip to content
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

force:auth:web:login and force:org:open throw "spawn UNKNOWN" error #977

Closed
DebuggingYou opened this issue Apr 19, 2021 · 6 comments
Closed
Labels
investigating We're actively investigating this issue

Comments

@DebuggingYou
Copy link

Summary

By typing in the command sfdx force:org:open -u $alias or sfdx force:auth:web:login -a $alias -r $url I get always the error message Error: spawn UNKOWN

Steps To Reproduce:

  1. Go to a terminal/cmd with SFDX already installed
  2. Type the command sfdx force:auth:web:login -a somealias -r https://test.salesforce.com

Expected result

The expected result should be, that my default browser opens with the login site of Salesforce.

Actual result

Error in terminal/cmd will be thrown with the message Error: spawn UNKOWN

Additional information

By adding the flag --dev-debug I got this detailed message:

ERROR running auth:web:login: spawn UNKNOWN
*** Internal Diagnostic ***

Error: spawn UNKNOWN
at ChildProcess.spawn (internal/child_process.js:403:11)
at Object.spawn (child_process.js:553:9)
at module.exports (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\open\index.js:175:34)
at async Login.executeLoginFlow (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\plugin-auth\lib\commands\auth\web\login.js:54:9)
at async Login.run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\plugin-auth\lib\commands\auth\web\login.js:35:30)
at async Login._run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\command\lib\sfdxCommand.js:81:40)
at async Config.runCommand (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\config\lib\config.js:173:24)
at async Main.run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\command\lib\main.js:27:9)
at async Main._run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\command\lib\command.js:43:20)
at async Object.run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\dist\cli.js:114:21)
Outer stack:
at Function.wrap (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\core\lib\sfdxError.js:171:27)
at Login.catch (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\command\lib\sfdxCommand.js:248:67)
at async Login._run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\command\lib\sfdxCommand.js:85:13)
at async Config.runCommand (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\config\lib\config.js:173:24)
at async Main.run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\command\lib\main.js:27:9)
at async Main._run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\command\lib\command.js:43:20)
at async Object.run (C:\Users\xxx\AppData\Roaming\npm\node_modules\sfdx-cli\dist\cli.js:114:21)
******

 sfdx:Login ERROR [
sfdx:Login '\x1B[1mERROR running auth:web:login: \x1B[22m',
sfdx:Login '\x1B[31mspawn UNKNOWN\x1B[39m',
sfdx:Login '\x1B[31m\x1B[39m\n' +
sfdx:Login '\x1B[31m*** Internal Diagnostic ***\x1B[39m\n' +
sfdx:Login '\x1B[31m\x1B[39m\n' +
sfdx:Login '\x1B[31mError: spawn UNKNOWN\x1B[39m\n' +
sfdx:Login '\x1B[31m at ChildProcess.spawn (internal/child_process.js:403:11)\x1B[39m\n' +
sfdx:Login '\x1B[31m at Object.spawn (child_process.js:553:9)\x1B[39m\n' +
sfdx:Login '\x1B[31m at module.exports (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\open\\index.js:175:34)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Login.executeLoginFlow (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@salesforce\\plugin-auth\\lib\\commands\\auth\\web\\login.js:54:9)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Login.run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@salesforce\\plugin-auth\\lib\\commands\\auth\\web\\login.js:35:30)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Login._run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:81:40)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Config.runCommand (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Main.run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Main._run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Object.run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\dist\\cli.js:114:21)\x1B[39m\n' +
sfdx:Login '\x1B[31mOuter stack:\x1B[39m\n' +
sfdx:Login '\x1B[31m at Function.wrap (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:171:27)\x1B[39m\n' +
sfdx:Login '\x1B[31m at Login.catch (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:248:67)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Login._run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:85:13)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Config.runCommand (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Main.run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Main._run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\x1B[39m\n' +
sfdx:Login '\x1B[31m at async Object.run (C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\sfdx-cli\\dist\\cli.js:114:21)\x1B[39m\n' +
sfdx:Login '\x1B[31m******\x1B[39m\n' +
sfdx:Login '\x1B[31m\x1B[39m'
sfdx:Login ] +167ms
@oclif/config start postrun hook +212ms
@oclif/config postrun hook done +24ms

From my understanding, it seems to be an issue with the npm module open, but I can't figure out, for what reason this message appears.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

sfdx-cli/7.96.0 win32-x64 node-v14.16.1

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-3 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.9 (core)
auth 1.5.1 (core)
config 1.2.8 (core)
generator 1.1.5 (core)
salesforcedx 51.7.1 (core)
├─ data 0.4.3 (core)
├─ apex 0.1.21 (core)
├─ org 1.6.1 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 51.3.0 (core)
├─ limits 1.0.5 (core)
├─ salesforce-alm 51.6.10 (core)
├─ user 1.2.8 (core)
└─ schema 1.0.5 (core)
sfdx-cli 7.96.0 (core)
telemetry 1.1.1 (core)

OS and version:

  • Edition: Windows 10 Pro
  • Version: 1809
  • OS build: 17763.1397
@DebuggingYou DebuggingYou added the investigating We're actively investigating this issue label Apr 19, 2021
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@peternhale
Copy link
Contributor

@DebuggingYou I am un able to reproduce this error on my windows machine. Searching for this error on web typically point at an issue with node installation on the windows machine. How did you install sfdx on your machine?

@WillieRuemmele
Copy link
Member

@peternhale this is a bug in the open library. I've already filed an issue there

@DebuggingYou
Copy link
Author

Hi @peternhale,
like @WillieRuemmele has said, I think it's related to the bug with the open module.
It seems on Windows, as long as you don't have access to the PowerShell due to Group Policies, you are not able to use this module anymore.

I have submitted a request to my admins, and if it works afterwards, I will close this bug.

@peternhale
Copy link
Contributor

Being tracked on open library

@DebuggingYou
Copy link
Author

Hello together,
I can confirm, that my issue is solved by enabling PowerShell on my PC. After my admins have given me access to it, the error did not appear anymore :)
Thank you for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

3 participants