Background: A dev member in my team has created a feature testing scratch org using SFDX, no CumulusCI (Cci) involved. I, part of QA, am automating the same Salesforce product and need to access this scratch org to incorporate the new feature in our test suite. I am using Cci-RobotFramework-Selenium tech stack for this purpose. Cci test automation works like a charm when I create my own scratch orgs (via Cci or SFDX) and add them to my Cci keychain.

Issue: I need to connect (using Cci) to the feature testing org since that has the latest code. Pointing my repo to the latest branch and creating a scratch org by myself can be an option, but then it would cross the limit for our org and hence dont want to go that way.

What I have done so far:

  1. I changed my "sfdcLoginUrl" parameter under sfdx-project.json to "sfdcLoginUrl": "https://avengers-****-****-dev-ed.my.salesforce.com"

  2. I am able to connect to my colleagues scratch org using SFDX: (MyProjVirtualEnv) C:\Dev\AmpImpact>sfdx force:auth:web:login --setalias Feature_ScOrg1 Successfully authorized test-*******@example.com with org ID 0***********I You may now close the browser

  3. However, when I try to register its keychain with Cci, Cci errors out: cci org connect Feature_ScOrg1 --login-url https://avengers-****-****-dev-ed.my.salesforce.com

  4. Here is the Cci error. Surprisingly, as soon as I fire the command # 3 above the stack trace come up, it launches the browser though, but the stack trace comes up instantly: Launching web browser for URL https://avengers-****-****-dev-ed.my.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3****************************e.l***************************************n.f**********6&redirect_uri=http://localhost:8200/OauthRedirect&scope=web%20full%20refresh_token&prompt=login Traceback (most recent call last): File "c:\python37\Lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\python37\Lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\myself\.virtualenvs\MyProjVirtualEnv\Scripts\cci.exe\__main__.py", line 9, in <module> File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\click\core.py", line 764, in __call__ return self.main(*args, **kwargs) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\click\core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\click\core.py", line 555, in invoke return callback(*args, **kwargs) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\cumulusci\cli\cci.py", line 219, in new_func func(config, *args, **kw) File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\cumulusci\cli\cci.py", line 737, in org_connect oauth_dict = oauth_capture() File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\cumulusci\oauth\salesforce.py", line 114, in __call__ self._create_httpd() File "c:\users\myself\.virtualenvs\MyProjVirtualEnv\lib\site-packages\cumulusci\oauth\salesforce.py", line 136, in _create_httpd self.httpd = HTTPServer(server_address, OAuthCallbackHandler) File "c:\python37\Lib\socketserver.py", line 452, in __init__ self.server_bind() File "c:\python37\Lib\http\server.py", line 137, in server_bind socketserver.TCPServer.server_bind(self) File "c:\python37\Lib\socketserver.py", line 466, in server_bind self.socket.bind(self.server_address) OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Some insights into resolving this issue and advice on how to connect someone elses Scratch org to my Cci would be helpful.

  • Are you running a firewall or other security software that might block inbound network connectivity? – David Reed May 6 '19 at 14:57
  • hey @DavidReed I am getting {"error":"unsupported_grant_type","error_description":"grant type not supported"} It seem url is getting blocked. – Pronit Agrawal Apr 22 '20 at 6:05

Since you've established a link to the org already via Salesforce DX, you can use the cci org import command to add it to CCI:

 $ sfdx force:org:list

  ALIAS                 SCRATCH ORG NAME      USERNAME                      
  ────────────────────  ────────────────────  ───────────────────────────── 
  test_scratch          Test Org              test-XXXX@example.com


$ cci org import test_scratch NewOrgName
$ cci org list

org            default  scratch  days  expired  config_name  username
-------------  -------  -------  ----  -------  -----------  --------
NewOrgName              *        1                           test_scratch
beta                    *        1              beta
dev                     *        7              dev
feature                 *        1              feature
release                 *        1              release

(Disclosure: I work on the Salesforce.org release engineering team).

  • Thanks @David, cci org import... was the missing step. Executed cci org import test-****@example.com NewOrgName followed by cci org browser NewOrgName and that worked. – vish4444 May 7 '19 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.