- changed status to open
Connection to existing org not valid for project
For reference, this had been working previously but in the last 2 weeks it has shifted.
Im using Intellij and Illuminated Cloud 2.
I clone my repository from github and generate my scratch org in my terminal with the Salesforce CLI. I then take my login credentials and add them to Intellij. I load my project and usually I would be able to add the connection to the project and load the offline table. However, the connection isnt shown to be selected.
Comments (11)
-
repo owner -
reporter What needs to go in the Alias field? It says everything I type is invalid.
-
repo owner That’s the same thing you’d provide to the
sfdx force:auth:web:login
command for the-a/--alias
flag. It will end up being the IC2 connection name. It should be alphanumeric with no spaces, though simple punctuation like-
and_
is allowed. -
reporter I was able to start the Oauth connection process with the alias and authenticate on the browser but the new connection is not appearing on my list of connections. I followed the steps in the document but a new connection is not listed. I tried refreshing connections and restarting the IDE but nothing appeared either.
-
repo owner Can you please confirm that your Salesforce CLI is 100% up-to-date? That’s the most common cause of such issues. If you’ve confirmed that it is and this issue is still occuring, please enable debug logging for Salesforce DX, reproduce the issue, and either attach or email the resulting
idea.log
file for review. -
reporter Sorry for the delay! I just emailed you the log file.
-
repo owner Thanks, Jake. I replied directly with more details, but it appears to be an issue with the Salesforce CLI as immediately after a successful
force:auth:web:login
execution, a subsequent execution offorce:org:list
yields an empty list of orgs which is obviously incorrect. I recommend a full uninstall/reinstall of the CLI, making sure to remove cache directories, etc., as documented at:and then if the problem persists, logging a bug in the CLI public issue tracker:
-
reporter Uninstalling and reinstalling CLI did the trick! I was able to connect to my new org.
My last question is did this setup change recently? I used to only have to add the connection with the username and password as recently as a month ago. Now I have to use the DX connections.
-
repo owner Not surprising that a CLI uninstall/reinstall fixed it. There has been extensive refactoring by Salesforce in the CLI, and I’ve found that quite a few upgrade-in-place installs of it have had issues that are resolved by a scorched earth reinstall.
As for whether the IC2 behavior has changed, no, it’s been that way for quite a long time. There have been some improvements to ensure that users are told more explicitly about invalid connection/project type combinations, but even those have been in place for perhaps a year or so. Did you happen to change this project from metadata format to source format recently, even just adding an
sfdx-project.json
file to it? That would explain the difference in behavior. -
repo owner - changed status to resolved
-
repo owner - removed component
Removing component: IntelliJ IDEA (automated comment)
- Log in to comment
If the project is in source format--basically if it has an
sfdx-project.json
file--you cannot use a native IC2 connection with it. You must instead create an OAuth connection to the org:https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/wiki/User_Guide/Configuring_Connections#markdown-header-oauth-connections-to-existing-salesforce-orgs
Please let me know if that doesn't help to resolve the issue.