Getting "Failed to create the Salesforce DX project: A name parameter is required to create a storage" error while creating a new project

1,100 views
Skip to first unread message

Timothy Chiang

unread,
Apr 7, 2021, 10:57:51 AM4/7/21
to Illuminated Cloud Q&A
Hi there,  I have notice recently that when I try to create a new DX project, I get the following error "Failed to create the Salesforce DX project: A name parameter is required to create a storage" and the project fails to generate all the typical directories from a standard template.

This only happens when I try to create via IC2. VSC works perfectly.

I run into this issue in both Webstorm 2021.1 and 2020.3.3

Thanks!


2021-04-07_10-50-31.png2021-04-07_10-50-49.png2021-04-07_10-51-04.png

Scott Wells

unread,
Apr 7, 2021, 11:01:54 AM4/7/21
to Illuminated Cloud Q&A, t...@blumauconsulting.com
Hi. IC2 is just running "sfdx force:project:create", so perhaps we should see the exact command it's running. Please enable debug logging for Salesforce DX, reproduce the issue, and in idea.log (Help>Show Log in Finder) you should see the exact CLI invocation being used. If it doesn't look correct, please share the exact invocation with me, either here or via email. If it does look correct, please execute that command via the command-line and verify that you see the exact same behavior. If that's the case, I'd recommend a full uninstall/reinstall of the CLI to see if that resolves it. I've spoken with a number of folks recently who have found CLI issues that are resolved by scorched earth reinstall.

Regards,
Scott Wells

Timothy Chiang

unread,
Apr 7, 2021, 11:19:27 AM4/7/21
to Illuminated Cloud Q&A, scott...@gmail.com
Thanks Scott, here is the result:

2021-04-07 11:08:08,208 [1616267]  DEBUG - atedcloud.util.CommandLineUtil - Running command line: '/usr/local/bin/sfdx force:project:create -d /Users/timothychiang/Documents/Projects/Webstorm -n test-create -p force-app -t standard --json' from working directory: '/Users/timothychiang/Documents/Projects/Webstorm/test-create'. 

2021-04-07 11:08:10,219 [1618278]  DEBUG - atedcloud.util.CommandLineUtil - Returning command-line response: CommandLineResponse{exitCode=1, output='{  "status": 1,  "name": "AssertionError",  "message": "A name parameter is required to create a storage",  "exitCode": 1,  "commandName": "Project",  "stack": "AssertionError [ERR_ASSERTION]: A name parameter is required to create a storage\n    at new Storage (/usr/local/lib/node_modules/sfdx-cli/node_modules/yeoman-generator/lib/util/storage.js:24:5)\n    at ProjectGenerator._getStorage (/usr/local/lib/node_modules/sfdx-cli/node_modules/yeoman-generator/lib/index.js:621:12)\n    at new Generator (/usr/local/lib/node_modules/sfdx-cli/node_modules/yeoman-generator/lib/index.js:148:24)\n    at Object.construct (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:196:36)\n    at new SfdxGenerator (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/templates/lib/generators/sfdxGenerator.js:18:9)\n    at new ProjectGenerator (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/templates/lib/generators/projectGenerator.js:40:9)\n    at Environment.instantiate (/usr/local/lib/node_modules/sfdx-cli/node_modules/yeoman-environment/lib/environment.js:429:12)\n    at Environment.create (/usr/local/lib/node_modules/sfdx-cli/node_modules/yeoman-environment/lib/environment.js:407:17)\n    at Environment.run (/usr/local/lib/node_modules/sfdx-cli/node_modules/yeoman-environment/lib/environment.js:464:28)\n    at Project.<anonymous> (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/plugin-templates/lib/utils/templateCommand.js:57:38)\nOuter stack:\n    at Function.wrap (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/plugin-templates/node_modules/@salesforce/core/lib/sfdxError.js:171:27)\n    at Project.catch (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/plugin-templates/node_modules/@salesforce/command/lib/sfdxCommand.js:255:67)\n    at async Project._run (/usr/local/lib/node_modules/sfdx-cli/node_modules/@salesforce/plugin-templates/node_modules/@salesforce/command/lib/sfdxCommand.js:95:13)\n    at async Config.runCommand (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js:173:24)\n    at async Main.run (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/main.js:27:9)\n    at async Main._run (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js:43:20)\n    at async Object.run (/usr/local/lib/node_modules/sfdx-cli/dist/cli.js:114:21)",  "warnings": []}', error='', duration=2011} 

I ran the command "/usr/local/bin/sfdx force:project:create -d /Users/timothychiang/Documents/Projects/Webstorm -n test-create -p force-app -t standard —json” in the command line and got the exact same error.

Scott

unread,
Apr 7, 2021, 11:27:29 AM4/7/21
to Illuminated Cloud Q&A, t...@blumauconsulting.com
Okay. That's a valid execution of that command, and it's actually unchanged since June 25, 2020 when it was extended for the template parameter ("-t standard" in your invocation), and before that the last change was in 2019. Given that, I would suggest a reinstall of the CLI to see if that resolves it, and if that doesn't resolve it, I'd recommend logging a bug in the CLI's public issue tracker showing that it fails when executed directly from the command-line as well.

Regards,
Scott Wells

Timothy Chiang

unread,
Apr 7, 2021, 11:30:51 AM4/7/21
to Illuminated Cloud Q&A, Scott
I did a recent uninstall of the CLI this morning to no effect. With that said, perhaps I am not getting rid of it the right way.

Are there steps that I should follow on top of a regular uninstall command? (I installed via npm)

Scott

unread,
Apr 7, 2021, 11:33:07 AM4/7/21
to Illuminated Cloud Q&A, t...@blumauconsulting.com, Scott
These are the best instructions to my knowledge:


If that doesn't resolve it, definitely log a case in the CLI's public issue tracker and feel free to post the issue link here so I can add some details for the CLI team.

Regards,
Scott

Timothy Chiang

unread,
Apr 7, 2021, 11:46:16 AM4/7/21
to Illuminated Cloud Q&A, Scott, Timothy Chiang
Okay thanks for that. That's what I did earlier, and re-tried again.

I still have this issue. I'll log it with the public tracker then.

Timothy Chiang

unread,
Apr 7, 2021, 11:47:04 AM4/7/21
to Illuminated Cloud Q&A, Timothy Chiang, Scott
does this mean that people will not be able to create a proper project structure in IC2 until this gets resolved?

Scott

unread,
Apr 7, 2021, 11:50:01 AM4/7/21
to Illuminated Cloud Q&A, t...@blumauconsulting.com, Scott
This doesn't seem to be an endemic issue. I've only heard about it from you, and I just verified that I'm able to create an SFDX project without issue. The main difference between our environments is that your install is via NPM and mine is via the installer. You might try to use the standard installer while you wait for feedback on the issue you log in their issue tracker, but I don't think others are having this problem.

Regards,
Scott

Timothy Chiang

unread,
Apr 7, 2021, 12:17:46 PM4/7/21
to Illuminated Cloud Q&A, Scott, Timothy Chiang
Actually, pretty sure this is localized to me.

as it turns out /usr/local/bin/sfdx force:project:create -d /Users/timothychiang/Documents/Projects/Webstorm -n test-create -p force-app -t standard --json
is probably confused because in the "Projects" directory I had a "Webstorm" directory and a "Webstorm - Arch" directory. Once I renamed "Webstorm - Arch", the command worked as normal.

Scott

unread,
Apr 7, 2021, 12:20:05 PM4/7/21
to Illuminated Cloud Q&A, t...@blumauconsulting.com, Scott
Hmmmm...I still wouldn't expect it to fail just because there's another similarly-named directory, but I'm also not sure how to address that since the command-line arguments are already handled distinctly when the "sfdx" process is invoked. I guess we'll call this one good, but I don't walk away with the sense of relief I generally prefer.

Regards,
Scott Wells

Timothy Chiang

unread,
Apr 7, 2021, 12:25:32 PM4/7/21
to Illuminated Cloud Q&A, Scott, Timothy Chiang
I'm probably wrong about this too, since I can't seem repo the effect. =P

Well... it works now....

Thanks!

Santosh Duvvuri

unread,
Aug 15, 2021, 3:35:28 PM8/15/21
to Illuminated Cloud Q&A, Scott, t...@blumauconsulting.com
Hi Scott,
I'm having the same issue 
2021-08-15_12-34-55.png

Scott

unread,
Aug 15, 2021, 3:40:28 PM8/15/21
to Illuminated Cloud Q&A, Santosh Duvvuri, Scott, t...@blumauconsulting.com
Hi. It's probably best to get the exact command-line that's being executed and the resulting response as described in the first response to this thread:


The CLI project creation command is one of the simplest executed by IC2, so one of the next things I'll likely ask you to do is a scorched earth uninstall/reinstall of the CLI. For better or worse, that tends to resolve 90+% of all CLI integration issues. Often something ends up corrupted after multiple in-place updates to the CLI. It would be good to rule that out as solution either way.

Regards,
Scott Wells

Kiran Machhewar

unread,
Aug 18, 2021, 2:54:32 AM8/18/21
to Illuminated Cloud Q&A, Scott, Santosh Duvvuri, t...@blumauconsulting.com

I also uninstalled sfdx and installed back but no luck. I came across this very old post https://wipdeveloper.com/sfdx-create-project-error/
I tried similar thing with IntelliJ which helped to solve this issue for me. Below are the steps

1. Create a folder 
2. Create a package.json file with the content as below
{
"name" : "GetRidOfNameParameterRequiredError"
}
3. Create the project in intelliJ and choose this folder as project location. 

You should not see the "A name parameter is required to create a storage" error.

Thanks,
Kiran Machhewar

Scott

unread,
Aug 18, 2021, 10:26:06 AM8/18/21
to Illuminated Cloud Q&A, Kiran Machhewar, Scott, Santosh Duvvuri, t...@blumauconsulting.com
Great find! Because that happens independent of IC2, it may be worth logging a bug in the Salesforce CLI's issue tracker referencing that same link. That will put it on their radar so that it can be addressed in the right place.

Regards,
Scott Wells

Reede Stockton

unread,
Aug 22, 2021, 10:27:32 PM8/22/21
to Illuminated Cloud Q&A, Scott, Kiran Machhewar, Santosh Duvvuri, t...@blumauconsulting.com
I can reliably reproduce this issue and it doesn't seem to be anything wrong with sfdx.

Here are the steps I can take to reproduce:
  1. Create New Project in WebStorm
  2. In New Project dialog, select IC SFDX as type
  3. Select a directory with an existing SFDX project
  4. WebStorm displays "Directory not empty" dialog offering choice of "Open" or "Create From Existing Sources"
  5. Select "Create From Existing Sources"
  6. The name parameter error is displayed
I didn't initially bother reporting this when I ran into it because choosing "Open" instead of "Create..." works just fine.  Still, it does seem like this is not the way it should behave, so I probably should have reported it.

Reede

Scott

unread,
Aug 23, 2021, 11:21:15 AM8/23/21
to Illuminated Cloud Q&A, Reede Stockton, Scott, Kiran Machhewar, Santosh Duvvuri, t...@blumauconsulting.com
Thanks for the details, Reede. I'm still unable to reproduce this. I followed your steps exactly and didn't see any errors, but let me ask for a few clarifications where things weren't specified.

First, does the existing project already have any IDE config files, i.e., a .idea directory or .iml file? I'm assuming not and in my own attempt to reproduce I removed those before running through the steps. I'll try it again shortly with those already existing, though, to see if it changes the behavior.

Second, did you check Generate manifest or leave that unchecked? I've tried it both ways and it doesn't seem to affect anything, but I figured it was worth asking.

Third, I'd like to see the actual executed command-line when this fails. Since you can reproduce it reliably, can you please enable debug logging for Salesforce DX, reproduce the error, and in the resulting idea.log file find the actual invocation of "sfdx force:project:create" so that I can see it? It should look like:

2021-08-23 10:15:09,655 [ 474075]  DEBUG - atedcloud.util.CommandLineUtil - Running command line: 'C:/Program Files/sfdx/bin/sfdx.cmd force:project:create -d C:/Users/Scott/dev/projects/IlluminatedCloudTestProjects -n create-error -p force-app -t standard -x --json' from working directory: 'C:\Users\Scott\dev\projects\IlluminatedCloudTestProjects\create-error'. 

and then further down you'll also see the output from that command that will look like:

2021-08-23 10:15:11,678 [ 476098]  DEBUG - atedcloud.util.CommandLineUtil - Returning command-line response: CommandLineResponse{exitCode=0, output='{  "status": 0,  "result": {...} }', error='', duration=2023} 

I'd like to see that as well if possible. I've seen threads where this happens independent of IC2 with attempts at project creation directly from the command-line, so while it's not likely unique to IC2, it could perhaps be an issue with how IC2 is invoking the command-line in a specific scenario, e.g., when the specific project directory already exists. If so, perhaps a bug should be logged in the CLI issue tracker either to fail fast in that situation or not to result in this specific type of failure. To know for sure, though, I'd need to be able to reproduce it properly.

Thanks much!
Scott

Reede Stockton

unread,
Aug 23, 2021, 9:16:23 PM8/23/21
to Illuminated Cloud Q&A, Scott, Reede Stockton, Kiran Machhewar, Santosh Duvvuri, t...@blumauconsulting.com
This is really interesting.  I found the command in the log, tried the sfdx command from the command line, and received the same error.  So I figured I'd uninstall/reinstall sfdx.

After a full uninstall of sfdx as described Salesforce CLI Setup Guide, and a reinstall from the installer, the standalone sfdx command worked fine.  However, the Webstorm/IC steps I outlined still produced the error.

Generate manifest is unchecked and the directory I'm installing into is a repo that includes an existing force-app directory, but nothing else that is either idea or IC related.  Here are the log lines:

2021-08-23 17:29:03,068 [  42336]  DEBUG - atedcloud.util.CommandLineUtil - Running command line: '/usr/local/bin/sfdx force:project:create -d /Users/reede.stockton/code -n ic_test6 -p force-app -t standard --json' from working directory: '/Users/reede.stockton/code/ic_test6'.
2021-08-23 17:29:03,078 [  42346]  DEBUG - .VariableLengthPollingInterval - /usr/local/bin/sfdx force:project:create -d /Users/reede.stockton/code -n ic_test6 -p force-app -t standard --json: Using polling interval 1000 ms for polling iteration 1.
2021-08-23 17:29:04,082 [  43350]  DEBUG - .VariableLengthPollingInterval - /usr/local/bin/sfdx force:project:create -d /Users/reede.stockton/code -n ic_test6 -p force-app -t standard --json: Using polling interval 1000 ms for polling iteration 2.
2021-08-23 17:29:05,083 [  44351]  DEBUG - atedcloud.util.CommandLineUtil - Returning command-line response: CommandLineResponse{exitCode=1, output='{  "status": 1,  "name": "AssertionError",  "message": "A name parameter is required to create a storage",  "exitCode": 1,  "commandName": "Project",  "stack": "AssertionError [ERR_ASSERTION]: A name parameter is required to create a storage\n    at new Storage (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/yeoman-generator/lib/util/storage.js:24:5)\n    at ProjectGenerator._getStorage (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/yeoman-generator/lib/index.js:621:12)\n    at new Generator (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/yeoman-generator/lib/index.js:148:24)\n    at Object.construct (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:196:36)\n    at new SfdxGenerator (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/templates/lib/generators/sfdxGenerator.js:18:9)\n    at new ProjectGenerator (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/templates/lib/generators/projectGenerator.js:44:9)\n    at Environment.instantiate (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/node_modules/yeoman-environment/lib/environment.js:429:12)\n    at Environment.create (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/node_modules/yeoman-environment/lib/environment.js:407:17)\n    at Environment.run (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/node_modules/yeoman-environment/lib/environment.js:464:28)\n    at Project.<anonymous> (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/lib/utils/templateCommand.js:57:38)\nOuter stack:\n    at Function.wrap (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/node_modules/@salesforce/command/node_modules/@salesforce/core/lib/sfdxError.js:171:27)\n    at Project.catch (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/node_modules/@salesforce/command/lib/sfdxCommand.js:255:67)\n    at async Project._run (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@salesforce/plugin-templates/node_modules/@salesforce/command/lib/sfdxCommand.js:95:13)\n    at async Config.runCommand (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@oclif/config/lib/config.js:173:24)\n    at async SfdxMain.run (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@oclif/command/lib/main.js:27:9)\n    at async SfdxMain._run (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/node_modules/@oclif/command/lib/command.js:43:20)\n    at async Object.run (/Users/reede.stockton/.local/share/sfdx/client/7.114.0-5fe2863/dist/cli.js:162:47)",  "warnings": []}', error='', duration=2015}

It turns out that the success/failure of the sfdx command depends on the working directory.  When run from the command line, the sfdx command succeeds if executed from the parent directory, but fails when run from inside the project directory, which is the working directory used by IC.  Is that sfdx's bug??  Anyway, this bug only shows up for me when trying to create a new project from existing sources, which is easy enough to avoid.

An interesting question I have, though, is whether this command should be executed at all since we are creating a project from existing sources.

Honestly, this isn't causing me any trouble at all.  I just open the project directory now.  But if you think it is worthwhile to log something, either here or in the CLI tracker, I'm happy to do that.

Reede

Scott

unread,
Aug 24, 2021, 10:10:00 AM8/24/21
to Illuminated Cloud Q&A, Reede Stockton, Scott, Kiran Machhewar, Santosh Duvvuri, t...@blumauconsulting.com
Oddly I'm still unable to reproduce this behavior even trying to do exactly what Reede has done. I've tried to generalize the following command-line execution:


2021-08-23 17:29:03,068 [  42336]  DEBUG - atedcloud.util.CommandLineUtil - Running command line: '/usr/local/bin/sfdx force:project:create -d /Users/reede.stockton/code -n ic_test6 -p force-app -t standard --json' from working directory: '/Users/reede.stockton/code/ic_test6'.

as:

cd /path/to/existing/project
sfdx force:project:create -d /path/to/existing -n project -p force-app -t standard [--json]

As a result, I've tried the following series of commands without any issues on both Windows and Mac:

cd /path/to/existing
 # Create a project that doesn't already exist
sfdx force:project:create -d . -n project -p force-app -t standard
# Change the working directory to be in the project itself
cd project
# Try to recreate the project using fully-qualified paths which is what failed for Reede
sfdx force:project:create -d /path/to/existing -n project -p force-app -t standard
# Instead I get the following successful output:
target dir = /path/to/existing
identical package.json
identical config/project-scratch-def.json
identical README.md
identical sfdx-project.json
identical .husky/pre-commit
identical .vscode/extensions.json
identical .vscode/launch.json
identical .vscode/settings.json
identical force-app/main/default/lwc/.eslintrc.json
identical force-app/main/default/aura/.eslintrc.json
identical scripts/soql/account.soql
identical scripts/apex/hello.apex
identical .eslintignore
identical .forceignore
identical .gitignore
identical .prettierignore
identical .prettierrc
identical jest.config.js

I'll try to reproduce from inside IC2 just in case there's something different about how it's setting the sub-process' working directory. If that successfully reproduces it, I'll look at setting the working directory to be the parent instead of the existing project directory. Nonetheless, it doesn't seem like the CLI should yield this type of error to me, so I'm leaning toward logging a bug in that issue tracker regardless.

And yes, this isn't the way you'd want to create a project from existing source. Instead you'd want to do the following (from the user guide):


Having said that, this should be a legitimate way to do it, even if you come at it from a different angle (so to speak), so I'll see what I can do to address things...to the extent that they're under my control.

Regards,
Scott

Scott

unread,
Aug 24, 2021, 1:09:12 PM8/24/21
to Illuminated Cloud Q&A, Scott, Reede Stockton, Kiran Machhewar, Santosh Duvvuri, t...@blumauconsulting.com
Well, I'm still unable to reproduce this even from the IDE. I do see that it's using the existing project directory as the process' working directory which seems to be part of why/how the issue occurs, but I'm just not seeing that same error. However, I just implemented a change to how IC2 executes force:project:create that ensures that the working directory is set to the parent directory during creation. Hopefully that will put this issue to rest. If it doesn't, I'll file a support case in the CLI's issue tracker. This change will be in the next IC2 build.

Regards,
Scott Wells

Reply all
Reply to author
Forward
0 new messages