- edited description
InvalidEncryptedFormatError when trying to use a connection which was created using sf org login
Not sure if the connections are interchangeable. But if I use sf commands to authorize an org, it does get listed in, but I receive this error when trying to do any operation like running anonymous Apex.
SFDX Version
sfdx-cli/7.126.0 win32-x64 node-v16.13.0
Comments (5)
-
reporter -
repo owner IC2 will include any (active) connection from the CLI. That status is coming directly from the CLI. You should see it in the CLI directly if you run:
sfdx force:org:list --skipconnectionstatus --json
For that connection, you should see
InvalidEncryptedFormatError
as the value forconnectedStatus
. Whenever the CLI includes a value forconnectedStatus
other thanConnected
, it will display it beside the associated connection. -
repo owner If you do find that authorizations created using the
sf
CLI are not usable by IC2, we should report that to the CLI team directly as those commands are supposed to yield compatible results. In the case of anonymous Apex execution, IC2 uses the access token for the connection reported bysfdx force:org:list
as its authorization header when making the API call. If the access token from ansf
-auth'ed connection isn't valid as an API authorization header, that would be a bug in thesf
auth command. -
repo owner I was able to reproduce this behavior by authorizing a connection using
sf
and trying to usesfdx force:org:display
to get details for that connection:$ sf login org --alias field_history_sf Successfully authorized scottwells@fieldhistory.illuminatedcloud.com with ID 00D4x0000030fahEAA $ sfdx force:org:display -u field_history_sf ERROR running force:org:display: The encrypted data is not properly formatted. Try this: If attempting to create a scratch org then re-authorize. Otherwise create a new scratch org.
I'll log a support case with the CLI team.
-
repo owner - changed status to resolved
Logged the following with the CLI team:
https://github.com/forcedotcom/cli/issues/1314
Resolving this as it's not an IC2-specific issue. As a workaround until this is resolved properly by the CLI team, you can use the
sfdx
command (or IC2 which itself uses thesfdx
command) to authorize org connections. - Log in to comment