forcedotcom / code-builder-feedback

This repository is used to collect feedback for the Code Builder beta.
29 stars 2 forks source link

Scratch Org creation fails with "The requested resource does not exist" error #179

Closed FabienTaillon closed 2 years ago

FabienTaillon commented 2 years ago

Describe the bug Trying to create a Scratch Org from Code Builder fails with "The requested resource does not exist" error.

To Reproduce Steps to reproduce the behavior:

  1. Open Code Builder (I used this repo to test: https://github.com/FabienTaillon/lwc-oss-on-platform)
  2. Authenticate to a Dev Hub via Command Palette
  3. Create a Scratch Org via the Command Palette with all default options

Expected behavior Scratch Org is created.

Screenshots

SO1 SO2

Desktop (please complete the following information):

jgellin-sf commented 2 years ago

@FabienTaillon I am unable to reproduce in my Code Builder environment. Depending on when you provisioned your environment, your toolset might be different from what I'm working with. Will you please let me know which version of the Salesforce Extension Pack (can be found in the Extension view) and the CLI (run sfdx --version in the Code Builder terminal) you have in your environment?

FabienTaillon commented 2 years ago

@jgellin-sf Salesforce Extension Pack is v55.8.0. sfdx --version gives me this:

Warning: sfdx-cli update available from 7.144.2 to 7.163.0.
sfdx-cli/7.144.2 linux-x64 node-v16.13.2

I tried to update to the latest version but neither sfdx update nor npm update --global sfdx-cli are working.

I just recreated a brand new env right now so it's still happening for me with an env created recently.

jgellin-sf commented 2 years ago

Interesting. I have the same setup and I am pointing your GitHub project and I do not have this problem.

I tried to update to the latest version but neither sfdx update nor npm update --global sfdx-cli are working.

Code Builder environments prevent users from having root access to avoid abuse.

The "requested resource does not exist" error is a CLI error that is most often associated with someone attempting to create a scratch org using an org that does not have DevHub enabled. I suspect that Code Builder is not recognizing your dev hub as the default dev hub for some reason. When you authorize an org in the Code Builder Dashboard during environment setup, Code Builder passes some information to the environment in order to set up that connection. I wonder if something is going wrong in the setup there that is preventing you from setting the default dev hub correctly when you authorize it. Will you please run sfdx force:org:list in your terminal after authorizing the dev hub to make sure that your dev hub org is properly set as the default?

FabienTaillon commented 2 years ago

You were right ! As I'm using Code Builder on a specific dev org I created just to test it, and not my regular DevHub, I just simply forgot to enable the DevHub feature on it !

jgellin-sf commented 2 years ago

Great. Thanks for confirming.

FabienTaillon commented 2 years ago

Though this could use a better error message, but I guess this should be an issue on the CLI repo, right @mshanemc ?