salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Refresh SObject Definitions hangs infinitely with no errors

Open mjaggard opened this issue 1 year ago • 6 comments

Summary

When I select "SFDX: Refresh SObject Definitions" from the command palette, it appears to start but nothing happens for multiple hours.

Steps To Reproduce:

  1. Sign in to Developer Org
  2. Check that the connection works by selecting "SFDX: Deploy This Source to Org" for example
  3. Select "SFDX: Refresh SObject Definitions"

Expected result

The SObject definitions should be refreshed

Actual result

Nothing. The progress bar is shown forever (tested 15 hours) along with the following messages:

Starting SFDX: Refresh SObject Definitions

11:31:20.184 sfdx sobject definitions refresh

Additional information

Salesforce Extension Version in VS Code: v55.4.1

SFDX CLI Version: sfdx-cli/7.159.0 darwin-x64 node-v16.15.1

OS and version: macOS 12.4

mjaggard avatar Jul 19 '22 10:07 mjaggard

Related but different issues: #4093 - shows error "Failure performing sObject describe aborted" #3056 - shows error "Cannot read property 'forEach' of undefined" #2802 - shows error "command 'sfdx.force.internal.refreshsobjects' not found". Also, running sfdx force:schema:sobject:list -c all worked fine but did not resolve the issue. #3679 - shows error "Cannot convert undefined or null to object" and result was to contact Salesforce support. https://github.com/forcedotcom/salesforcedx-vscode/issues/3679#issuecomment-985047577 but I'm not sure if I can do that because I don't have any support relationship with Salesforce.

mjaggard avatar Jul 19 '22 10:07 mjaggard

Is there any command that I can run on the CLI to do the same job? When I run sfdx sobject definitions refresh I get "Warning: sobject is not a sfdx command."

mjaggard avatar Jul 19 '22 11:07 mjaggard

Hi @mjaggard how large is the org that you're working with, in terms of classes, objects, etc that you're hoping to retrieve? Are you seeing anything retrieved under .sfdx/tools/ in that time? Unfortunately this is an extensions-specific command, so you'll have to run it through VS Code. Have you tried re-authenticating to the org that you're working with as well?

randi274 avatar Jul 19 '22 14:07 randi274

@randi274 thanks for the reply. I have tried re-authenticating but that didn't help. I've also looked in .sfdx/tools/sobjects and I seem to have some standardObject files there but it doesn't update when I run the refresh.

I have 26 custom objects, 12 triggers, 174 classes, 66 visualforce pages. Does that help?

mjaggard avatar Jul 19 '22 15:07 mjaggard

I am able to see the same behavior on my machine, running macOS 12.5. We'll create a work item to look into this. Thanks for reporting, @mjaggard.

klewis-sfdc avatar Aug 11 '22 20:08 klewis-sfdc

This issue has been linked to a new work item: W-11587594

git2gus[bot] avatar Aug 11 '22 20:08 git2gus[bot]

Seeing the same thing on macOS Version 13.0 Beta (22A5358e)

KipperBush avatar Oct 02 '22 03:10 KipperBush

@mjaggard, I was able to resolve it by removing the '.sfdx' directory, closing VS Code, opening, and running 'SFDX: Authorize an Org'.

KipperBush avatar Oct 02 '22 04:10 KipperBush

Thanks for sharing your solution @KipperBush! @mjaggard does that workaround happen to work for you as well?

randi274 avatar Oct 03 '22 18:10 randi274

Came across this whilst searching for solutions to the same issue.

MacOS 12.1 Visual Studio Code 1.72.0 sfdx-cli/7.167.2 darwin-x64 node-v16.17.0

The steps suggested by @KipperBush did solve the issue for me. I'll keep an eye to see if it reoccurs

ScubaJimmE avatar Oct 10 '22 20:10 ScubaJimmE

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

github-actions[bot] avatar Oct 20 '22 02:10 github-actions[bot]