You need to sign in to do that
Don't have an account?
Raviteja_K
Issue with SFDX: Authorize an Org
Hello All,
I am trying to Create a Hello World Lightning Web Component as mentioned in the URL below.
Hello World Lightning Web Component (https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component?trail_id=build-lightning-web-components)
But in VS code I am getting below output and did some analysis but unable to risolve it please help me how can I proceed further.
VS code output:
Starting SFDX: Authorize an Org
09:42:18.175 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername
ERROR running force:auth:web:login: Cannot start the OAuth redirect server on port PortInUseAction.
Try this:
Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
09:42:23.367 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1
------------------------------Sometimes below error is coming-------------------
use a custom connected app and update OauthLocalPort in the sfdx-project.json file
Thanks in Advance :)
I am trying to Create a Hello World Lightning Web Component as mentioned in the URL below.
Hello World Lightning Web Component (https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component?trail_id=build-lightning-web-components)
But in VS code I am getting below output and did some analysis but unable to risolve it please help me how can I proceed further.
VS code output:
Starting SFDX: Authorize an Org
09:42:18.175 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername
ERROR running force:auth:web:login: Cannot start the OAuth redirect server on port PortInUseAction.
Try this:
Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
09:42:23.367 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1
------------------------------Sometimes below error is coming-------------------
use a custom connected app and update OauthLocalPort in the sfdx-project.json file
Thanks in Advance :)
You have to kill the port 1717 process. please follow below link, this may help you.
http://www.callstack.in/tech/blog/windows-kill-process-by-port-number-157#close-overlay
Please let me know in case of any issue.
Thanks,
Parteek
Post performing the steps mentioned in the given URL got output as mentioned below.
Starting SFDX: Authorize an Org
11:33:00.980 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=b5d7ace33b21^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=2tdcYoPQwS4SytSxyyCWZPvXbjG-cJG42iesCBF4DDo' ] }
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=b5d7ace33b21^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=2tdcYoPQwS4SytSxyyCWZPvXbjG-cJG42iesCBF4DDo' ] }
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=b5d7ace33b21^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=2tdcYoPQwS4SytSxyyCWZPvXbjG-cJG42iesCBF4DDo' ] }
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=b5d7ace33b21^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=2tdcYoPQwS4SytSxyyCWZPvXbjG-cJG42iesCBF4DDo' ] }
Please suggest me on this.
Thanks in Advance :)
Did you check enviorment variables for your system. You must add below enviorment variables.
JAVA, Salesforce CLI, VS Code, System32
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks,
Parteek Goyal
Thank you Prateek for your respone.
Issue is Resolved after setting Proxy settings.
"Identified the issue. I had set the environment variable HTTP_PROXY in the Environment Variables section of my windows System Properties to
http://webproxyaddress:8080/
instead of
http://user:pwd@webproxyaddress:8080/
I had set these correctly everywhere else, but since I was on a windows machine I somehow missed going back and checking my systems environment variable. Turns out this is a really important step!"
i am using local machine , i don't things it will be proxy setting issue.
Kindly suggest
http://webproxyaddress:8080/. The issue is still not resolved. I keep getting the same error as below.
Starting SFDX: Authorize an Org
11:35:26.773 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://login.salesforce.com --setdefaultusername
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=46c1108c2830^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=KaSmJ2QYMtuO06KLUUM1B_3c5FZaUDADD6ugrRaF0h4' ] }
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=46c1108c2830^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=KaSmJ2QYMtuO06KLUUM1B_3c5FZaUDADD6ugrRaF0h4' ] }
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=46c1108c2830^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=KaSmJ2QYMtuO06KLUUM1B_3c5FZaUDADD6ugrRaF0h4' ] }
{ Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/b',
'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=46c1108c2830^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=KaSmJ2QYMtuO06KLUUM1B_3c5FZaUDADD6ugrRaF0h4' ] }
I have been struggling from few days on this issue.
Any help is appreciated.
Thanks in advance.
find the PID running on port no 1717
netstat -ano | findstr :1717
Then kill task with that PID No
taskkill /PID <PID> /F
Output from My system
C:\Windows\system32>netstat -ano | findstr :1717
TCP 127.0.0.1:1717 0.0.0.0:0 LISTENING 9064
TCP 127.0.0.1:53448 127.0.0.1:1717 TIME_WAIT 0
C:\Windows\system32>taskkill /PID 9064 /F
SUCCESS: The process with PID 9064 has been terminated.
It worked for me.