Vlocode is not initialized; VlocityDatapackService is null
Closed this issue · 4 comments
sfdx-cli/7.173.0 darwin-x64 node-v16.17.1
MAC OS Version 13.4.1
VS CODE Version: 1.80.1 (Universal)
Hello, recently I have been receiving this error when I am trying to Authorize an Org for Vlocity. I am able to authorize the Salesforce org from the browser and I get a success message. However, after its successfully authorized I received the error message "Vlocode is not initialized; VlocityDatapackService is null".
Thanks for reaching out!
Which version of the extension are you using?
And could you provide me with a debug log? Debug logging can be enabled from the settings under log level.
Hello,
Extension Version: v0.19.17
Debug:
10:19:12.313] [CommandExecutor] [verbose] Running command vlocode.selectOrg
[10:19:23.669] [SelectOrgCommand] [info] Opening 'https://test.salesforce.com' in a new browser window
[10:19:28.830] [SelectOrgCommand] [info] Successfully authorized arslan.jumayev@example.com.example, you can now close the browser
[10:19:28.830] [SelectOrgCommand] [info] Connecting to: arslan.jumayev@example.com.example...
[10:19:28.835] [VlocodeService] [debug] No SFDX credentials found for alias or user: arslan.jumayev@example.com.example
[10:19:28.835] [VlocodeService] [error] No SFDX credentials found for alias or user: arslan.jumayev@example.com.example
[10:19:28.835] [CommandExecutor] [verbose] Execution of command vlocode.selectOrg done
This is issue is a bit hard to debug but I will be making some changes to the OAuth2 authentication flow which will hopefully help, if not it should at least give a better error.
In the meantime what you can do is re authenticate using sf/sfdx CLI. Vlocode uses the same credential store so once either CLI gets a new token vlocode will be able to use it as well.
You might need to restart vscode as some of the tokens are cached in memory.
What I have observed that this generally happens when the OAuth2 refresh token expires, when refreshing the token through vlocode it doesn't get properly adopted causing all kinds of strange issues.
In the upcoming release (0.19.21) I will be making changes to better support refresh token expiry, this should help if not resolve this issue.