SFDX: Authorize an org error: listen EACCES: permission denied 127.0.0.1:1717

900    Asked by DanielBAKER in Salesforce , Asked on Apr 8, 2021

I have been using DX for quite some time. Authorizing an org either through command palette or with a command in terminal had never been a problem [Command is like this: sfdx force:auth:web:login --setalias mySandbox --instanceurl https://test.salesforce.com ] Today while trying to authorize a sandbox, I encountered the following error message which seems to be from node.js:

{ Error: listen EACCES: permission denied 127.0.0.1:1717 at Server.setupListenHandle [as _listen2] (net.js:1253:19) at listenInCluster (net.js:1318:12) at GetAddrInfoReqWrap.doListen [as callback] (net.js:1451:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10) code: 'EACCES', errno: 'EACCES', syscall: 'listen', address: '127.0.0.1', port: 1717 } { Error: listen EACCES: permission denied 127.0.0.1:1717 at Server.setupListenHandle [as _listen2] (net.js:1253:19) at listenInCluster (net.js:1318:12) at GetAddrInfoReqWrap.doListen [as callback] (net.js:1451:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10) code: 'EACCES', errno: 'EACCES', syscall: 'listen', address: '127.0.0.1', port: 1717 } { Error: listen EACCES: permission denied 127.0.0.1:1717 at Server.setupListenHandle [as _listen2] (net.js:1253:19) at listenInCluster (net.js:1318:12) at GetAddrInfoReqWrap.doListen [as callback] (net.js:1451:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10) code: 'EACCES', errno: 'EACCES', syscall: 'listen', address: '127.0.0.1', port: 1717 }

Recently I have done several changes to my Desktop and I do not know if it has something to do with them: O.S. updated to Windows 10 [Version 10.0.18363 Build 18363] Installed Docker Desktop Installed Gitlab-runner If not, how can I solve this problem? Thank you.

Answered by Chris EVANS

Administered Port Exclusions are the reason. In the Salesforce CLI log, you also see: error: listen EACCES: permission denied 127.0.0.1:1717 Run this in a Cmd Prompt:

  > netsh interface ipv4 show excludedportrange protocol=tcp Protocol tcp Port Exclusion Ranges Start Port End Port ---------- -------- 80 80 443 443 808 808 1068 1167 1168 1267 1268 1367 1473 1572 1573 1672 1673 1772 5357 5357 11821 11920 11921 12020 12263 12362 12363 12462 12463 12562 12563 12662 16013 16013 20807 20807 22221 22221 22223 22223 37408 37408 50000 50059 * * - Administered port exclusions.You can see port 1717 is in a blocked range (1673 to 1772) I changed mine to 1771 by adding this line to sfdx-project.json:
      "oauthLocalPort": "1771",

and it worked OK - sort of. In the Browser, I still got the error: But, when I looked, I saw it was still trying to use pot 1717. I edited the URL in the browser to the new Port I had selected (1771 in my case - yours may be different) and it worked - the callback to VS Code completed and I was logged in to SF and could download my code.



Your Answer

Interviews

Parent Categories