-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sfdx org create scratch command error "Cannot destructure property 'hubBaseUrl' of 'cache.get(...)' as it is undefined." #2528
Comments
Hello @HyruleConsulting 👋 It looks like you're using an outdated version of Salesforce CLI. Moving to After you move to the latest version of |
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
@HyruleConsulting are you running these commands in parallel? |
@cristiand391 Yes, Scratch orgs are built on parallel agents in this scenario |
there's known issue when running commands that read/write the config file in parallel, see: from the stacktrace I see |
Ok thanks @cristiand391 this makes sense. I do try to space out agent invocation (I use 5 minute delays) when bulk building scratch orgs overnight which does help - What I might do is create a single CI service for Scratch Org building which guarantees an order of invocations to avoid the command being used in parallel. Alternatively, I could build a re-attempt loop when faced with the hubBaseUrl error. |
Sounds good, added |
Sure sounds good, thanks @cristiand391 |
@HyruleConsulting the Are you able to try your repro with the new version? |
Sorry @mshanemc I missed your comment before requesting to test this out. Looks like you’ve merged the feature now, thanks for delivering this! 👍 |
Summary
I have a process that builds scratch orgs overnight for developers which has been running a while now however I would say roughly 10% of the time the Scratch Org Creation fails with the message
Cannot destructure property 'hubBaseUrl' of 'cache.get(...)' as it is undefined
.It's hasn't been too much of an issue as it only happens for 1 in every 10 scratch org creations however since the weekend (Winter24) I have seen a sharp uptick in this failure rate. It's more like 40-50% of the scratch orgs I create will now fail with this message.
It's worth noting that I use Org Shape in this process, and I have also recently had to rebuild the org shape following the Salesforce Major Release (Winter24).
Steps To Reproduce
sfdx org create scratch --target-dev-hub *** --definition-file <path to definition file> --duration-days 30 --async --json
sfdx org resume scratch --job-id <Scratch Org Job Id> --json
Receive error message
Cannot destructure property 'hubBaseUrl' of 'cache.get(...)' as it is undefined
about 40-50% of the time.Expected result
Should show a status message either Scratch Org Created or Scratch Org Failed
Actual result
40-50% of the time it shows an unhandled exception
{ "code": 1, "context": "EnvResumeScratch", "commandName": "EnvResumeScratch", "message": "Cannot destructure property 'hubBaseUrl' of 'cache.get(...)' as it is undefined.", "name": "TypeError", "status": 1, "stack": "TypeError: Cannot destructure property 'hubBaseUrl' of 'cache.get(...)' as it is undefined.\n at EnvResumeScratch.run (/Users/**/.local/share/sf/client/2.12.9-007e29c/node_modules/@salesforce/plugin-org/lib/commands/org/resume/scratch.js:25:17)\n at async EnvResumeScratch._run (/Users/**/.local/share/sf/client/2.12.9-007e29c/node_modules/@oclif/core/lib/command.js:117:22)\n at async Config.runCommand (/Users/**/.local/share/sf/client/2.12.9-007e29c/node_modules/@oclif/core/lib/config/config.js:314:25)\n at async run (/Users/**/.local/share/sf/client/2.12.9-007e29c/node_modules/@oclif/core/lib/main.js:89:16)", "exitCode": 1, "warnings": [] }
System Information
Process runs on linux agents and authentication to DevHub is handled with
sfdx org login jwt
command.Let me know if there's anything I can do to reduce the failure rate
The text was updated successfully, but these errors were encountered: