Cli: Unable to perform any action with SFDX CLI

Created on 24 Jul 2020  Â·  19Comments  Â·  Source: forcedotcom/cli

Summary

_Unable to perform any operations from SFDX CLI. It was working fine and after some time stopped suddently. Even after update of SFDX CLI and its plugins its not working._.

Steps To Reproduce:

  1. sfdx force:org:open - Not opening
  2. sfdx force:source:push - Not opening. Keep on showing same message some value is missing.
  3. Tried through VS Code extension, - Not luck

Expected result

Intended operation should perform with Salesforce SFDX cli. Basic operations like opening org/pushing code to org/pulling code to org/packaging etc.

Actual result

Following message is coming with all commands.

path$>sfdx force:source:push --loglevel=DEBUG
(node:95476) UnexpectedValueTypeError Plugin: sfdx-cli: Value is not defined
module: @oclif/[email protected]
task: runHook prerun
plugin: sfdx-cli
root: C:\Users\q1058281\AppData\Local\sfdx\client\7.66.2-4f159a1d07
See more details with DEBUG=*
ERROR running force:source:push:  Value is not defined

Additional information

_Feel free to attach a screenshot_.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

sfdx-cli/7.66.2-4f159a1d07 win32-x64 node-v12.13.0

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

PS C:\Users\UserName\Documents\VS Code\Dev\Folder\ProjectFolder> sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 49.2.3 (core)
├─ salesforcedx-templates 48.32.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ salesforce-alm 49.3.0 (core)
└─ custom-metadata 1.0.7 (core)
sfdx-cli 7.66.2 (core)
texei-sfdx-plugin 1.6.2
(node:92404) UnexpectedValueTypeError Plugin: sfdx-cli: Value is not defined
module: @oclif/[email protected]
task: runHook prerun
plugin: sfdx-cli
root: C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07
See more details with DEBUG=*

OS and version:
Windows OS 10

bug

Most helpful comment

The "features": ["DefaultWorkflowUser"] value isn't a valid config value. If you manually remove that from the file does that fix the problem?

I'm pretty sure the problem is in the ensure on Config.propertyConfigMap[key]. Since it isn't a valid key, that throws an error because it is undefined. How did you set features in your config file anyways?

image

With that said, I don't think we should fail all CLI commands when this happens. At most, it should display a warning to the user and continue on. I'll file a bug to resolve that.

All 19 comments

@yasarshaikh could you paste the stack trace?

@yasarshaikh could you paste the stack trace?

@AllanOricil - which stack trace shall be pasted here. Can you pls let me know how I shall get stack trace for this command.

@yasarshaikh could you paste the stack trace?

@AllanOricil - which stack trace shall be pasted here. Can you pls let me know how I shall get stack trace for this command.

I think I understood your problem now. It would not display one because it is a type check error. Maybe you can try to install everything again and see if it will work. I updated my sfdx too and it is working fine.

@yasarshaikh could you paste the stack trace?

@AllanOricil - which stack trace shall be pasted here. Can you pls let me know how I shall get stack trace for this command.

I think I understood your problem now. It would not display one because it is a type check error. Maybe you can try to install everything again and see if it will work. I updated my sfdx too and it is working fine.

I am using office laptop, needs to submit ticket for uninstall and install(which takes time bcz of current pandemic). Will check till monday, if nothing works then will try with re-install.

The stacktrace should be in the ~/.sfdx/sfdx.log file. If it is not, set the environment variable SFDX_ENV=development. That should force a stacktrace to the terminal. Setting --dev-debug will also give a lot more information.

I also want to highlight the wording on the README to set expectations.

NOTICE: GitHub is not a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, please use official support channels.

We are happy to take a look when we can but using the word urgent will not enable us to get to this any sooner. Sorry for any inconvenience.

log.txt

@amphro - Thanks for the reply. I understand this is not the SLA based support and that is the reason, I added URGENT keyword, so that it'll fetch attention of team. I uploaded log file(log.txt in top), pls check once you get time and try to update with workaround/solution.

log.txt

@amphro - Thanks for the reply. I understand this is not the SLA based support and that is the reason, I added URGENT keyword, so that it'll fetch attention of team. I uploaded log file(log.txt in top), pls check once you get time and try to update with workaround/solution.

When you ran force:org:open, did you pass the org alias that you wanted to open?
By reading your logs it says it is an exception when it fails to validate a given type. It is called UnexpectedValueTypeError. And this exception is thrown by this script
Maybe your "defaultusername" config is null

@AllanOricil - It is not working with any sfdx commands. I tried with -
set default org - sfdx force:config:set defaultusername=AliasName
push to org - sfdx force:source:push
open default org - sfdx force:org:open

Each time, it's showing same error message. Weird thing is, I was executing normal commands and it stopped working at next command(not refresh/not reopening the VS Code/not restarting the system).

I got a VM, in that it is working fine. Not sure, what's the glitch is.

I got a VM, in that it is working fine. Not sure, what's the glitch is.

you have no lucky haha

Your exception happens in this code:

async cryptProperties(encrypt) { const hasEncryptedProperties = this.entries().some(([key]) => { return !!ts_types_1.ensure(Config.propertyConfigMap[key]).encrypted; }); if (hasEncryptedProperties) { await this.initCrypto(); const crypto = ts_types_1.ensure(this.crypto); this.forEach((key, value) => { if (this.getPropertyConfig(key).encrypted && ts_types_1.isString(value)) { this.set(key, ts_types_1.ensure(encrypt ? crypto.encrypt(value) : crypto.decrypt(value))); } }); } }

For some reason Config.propertyConfigMap[key] is not a String or it is Null and this throws the exception you are seeing.
I will try to understand how this map is made. Maybe your computer deleted the file it uses.

@yasarshaikh could you copy and paste the content of this file here C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx\sfdx-config.json

It seems it might have been deleted or not configured well.

This is an example
{ "defaultusername": "aoricil_so_1" }

@yasarshaikh could you copy and paste the content of this file here C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx\sfdx-config.json

It seems it might have been deleted or not configured well.

This is an example

{
    "defaultusername": "aoricil_so_1"
} 
{
    "defaultdevhubusername": "scratchorg.integration@company_name.com",
    "defaultusername": "Sp7",
    "features": ["DefaultWorkflowUser"] 
}

@yasarshaikh could you copy and paste the content of this file here C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx\sfdx-config.json
It seems it might have been deleted or not configured well.
This is an example

{
    "defaultusername": "aoricil_so_1"
} 
{
    "defaultdevhubusername": "scratchorg.integration@company_name.com",
    "defaultusername": "Sp7",
    "features": ["DefaultWorkflowUser"] 
}

Could you ran the command again with --dev-debug to see if more logs appear. The only thing I'm sure is that this object Config.propertyConfigMap[key] is null for a given key, because the cryptProperties method calls the code below passing the propertyConfigMap value which throws the exception with the message you are seeing.

function ensure(value, message) { if (value == null) { throw new errors_1.UnexpectedValueTypeError(message || 'Value is undefined'); } return value; }

But I could not reproduce it. I deleted my global configs and my local configs and the error was not the same :/

I executed this command - sfdx force:config:set defaultusername=Sp7 --dev-debug

C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx>sfdx force:config:set defaultusername=Sp7 --dev-debug
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07 +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\package.json +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\oclif.manifest.json +6ms  @oclif/config:sfdx-cli using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\oclif.manifest.json +0ms
  @oclif/config reading user plugins pjson C:\Users\UserName\AppData\Local\sfdx\package.json +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\package.json +6ms
  @oclif/config loading plugins [ { name: 'texei-sfdx-plugin', tag: 'latest', type: 'user' } ] +4ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\package.json\package.json +6ms
  @oclif/config reading user plugin C:\Users\UserName\AppData\Local\sfdx\node_modules\texei-sfdx-plugin +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\node_modules\texei-sfdx-plugin\package.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\node_modules\texei-sfdx-plugin\oclif.manifest.json +5ms
  @oclif/config:texei-sfdx-plugin using manifest from C:\Users\UserName\AppData\Local\sfdx\node_modules\texei-sfdx-plugin\oclif.manifest.json +0ms
  @oclif/config loading plugins [
  '@oclif/plugin-autocomplete',
  '@oclif/plugin-commands',
  '@oclif/plugin-help',
  '@oclif/plugin-not-found',
  '@oclif/plugin-plugins',
  '@oclif/plugin-update',
  '@oclif/plugin-warn-if-update-available',
  '@oclif/plugin-which',
  '@salesforce/plugin-generator',
  '@salesforce/plugin-analytics',
  '@salesforce/sfdx-trust',
  'salesforcedx'
] +12ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-autocomplete +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-autocomplete\package.json +14ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-commands +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-commands\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-help +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-help\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found\package.json +2ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-plugins +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-plugins\package.json +2ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-update +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-update\package.json +0ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-which +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-which\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics\package.json +0ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-trust +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-trust\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\package.json +1ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-autocomplete\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-commands\oclif.manifest.json +4ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-help\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-update\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-plugins\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\oclif.manifest.json +3ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-which\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics\oclif.manifest.json +3ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-trust\oclif.manifest.json +3ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\.oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-autocomplete using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-autocomplete\oclif.manifest.json +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\oclif.manifest.json +3ms
  @oclif/config:@oclif/plugin-not-found using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-commands using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-commands\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-update using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-update\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-help using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-help\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-plugins using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-plugins\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-which using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-which\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-warn-if-update-available using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\oclif.manifest.json +0ms
  @oclif/config:@salesforce/plugin-analytics using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics\oclif.manifest.json +0ms
  @oclif/config:@salesforce/sfdx-trust using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-trust\oclif.manifest.json +0ms
  @oclif/config:@salesforce/plugin-generator using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\.oclif.manifest.json +0ms
  @oclif/config loading plugins [
  '@oclif/plugin-help',
  '@oclif/plugin-warn-if-update-available',
  '@oclif/plugin-not-found'
] +64ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\package.json +12ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\node_modules\@oclif\plugin-help +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\node_modules\@oclif\plugin-help\package.json +1ms
  @oclif/config:salesforcedx using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\oclif.manifest.json +0ms
  @oclif/config loading plugins [
  'salesforce-alm',
  'salesforcedx-templates',
  '@salesforce/sfdx-plugin-lwc-test',
  '@salesforce/plugin-custom-metadata'
] +5ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\package.json +3ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\package.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\package.json +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx\package.json +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\node_modules\@oclif\plugin-help\oclif.manifest.json +3ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\package.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\package.json +1ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\package.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\package.json +1ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\package.json +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\package.json +1ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\package.json +0ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx-templates +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx-templates\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-plugin-lwc-test +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-plugin-lwc-test\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\package.json +1ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found\package.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\package.json +4ms
  @oclif/config:@oclif/plugin-help using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-generator\node_modules\@oclif\plugin-help\oclif.manifest.json +0ms
  @oclif/config reading core plugin C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-custom-metadata +0ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-custom-metadata\package.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\oclif.manifest.json +1ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\oclif.manifest.json +4ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx-templates\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-plugin-lwc-test\oclif.manifest.json +2ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found\oclif.manifest.json +1ms
  @oclif/config loadJSON C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-custom-metadata\oclif.manifest.json +2ms
  @oclif/config:salesforcedx-templates using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforcedx-templates\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-warn-if-update-available using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\oclif.manifest.json +0ms
  @oclif/config:salesforce-alm using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\oclif.manifest.json +0ms
  @oclif/config:@salesforce/sfdx-plugin-lwc-test using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\sfdx-plugin-lwc-test\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-not-found using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-not-found\oclif.manifest.json +0ms
  @oclif/config:@salesforce/plugin-custom-metadata using manifest from C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-custom-metadata\oclif.manifest.json +0ms
  @oclif/config config done +45ms
  sfdx                        OS: +0ms
  sfdx                  platform: win32 +1ms
  sfdx              architecture: x64 +0ms
  sfdx                   release: 10.0.17763 +1ms
  sfdx                     shell: cmd.exe +0ms
  sfdx                      NODE: +0ms
  sfdx                   version: 12.13.0 +1ms
  sfdx                       CLI: +0ms
  sfdx                   version: 7.66.2-4f159a1d07 +1ms
  sfdx                   channel: stable +0ms
  sfdx                       bin: sfdx +1ms
  sfdx                      data: C:\Users\UserName\AppData\Local\sfdx +1ms
  sfdx                     cache: C:\Users\UserName\AppData\Local\sfdx +0ms
  sfdx                    config: C:\Users\UserName\AppData\Local\sfdx +1ms
  sfdx                       ENV: +0ms
  sfdx              NODE_OPTIONS: <not set> +0ms
  sfdx   SFDX_AUTOUPDATE_DISABLE: <not set> +0ms
  sfdx              SFDX_BINPATH: "C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\bin\sfdx.cmd"
+1ms
  sfdx        SFDX_COMPILE_CACHE: <not set> +0ms
  sfdx   SFDX_DISABLE_AUTOUPDATE: <not set> +0ms
  sfdx                  SFDX_ENV: development +0ms
  sfdx            SFDX_INSTALLER: true +0ms
  sfdx    SFDX_LAZY_LOAD_MODULES: true +1ms
  sfdx         SFDX_NPM_REGISTRY: <not set> +0ms
  sfdx           SFDX_REDIRECTED: 1 +0ms
  sfdx              SFDX_S3_HOST: <not set> +0ms
  sfdx  SFDX_UPDATE_INSTRUCTIONS: <not set> +0ms
  sfdx                      ARGS: +1ms
  sfdx                         0: C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\bin\node.exe +0ms
  sfdx                         1: C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\bin\sfdx.js +3ms
  sfdx                         2: force:config:set +1ms
  sfdx                         3: defaultusername=Sp7 +0ms
  lazy-require loading type cache from C:\Users\UserName\AppData\Local\sfdx\module-types.json +0ms
  lazy-require loaded type cache +1ms
  lazy-require parsing type cache +1ms
  lazy-require parsed type cache +4ms
  lazy-require enabled +1ms
  @oclif/config start init hook +26ms
  sfdx:@oclif/plugin-update:hooks:init start C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-update\lib\hooks\init +0ms
  sfdx:@oclif/plugin-warn-if-update-available:hooks:init start C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\plugin-warn-if-update-available\lib\hooks\init\check-update +0ms
  sfdx:@salesforce/plugin-analytics:hooks:init start C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics\lib\hooks\analyticsInit.js +0ms
  sfdx:@salesforce/plugin-analytics:hooks:init done +2ms
  sfdx:@oclif/plugin-warn-if-update-available:hooks:init done +24ms
  sfdx:@oclif/plugin-update:hooks:init done +149ms
  @oclif/config init hook done +155ms
  sfdx init version: @oclif/[email protected] argv: [ 'force:config:set', 'defaultusername=Sp7' ] +0ms
  @oclif/config runCommand force:config:set [ 'defaultusername=Sp7' ] +34ms
  @oclif/config:salesforce-alm require C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\dist\commands\force\config\set.js +227ms
  @oclif/config start prerun hook +921ms
  sfdx:@salesforce/plugin-analytics:hooks:prerun start C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics\lib\hooks\analyticsPrerun.js +0ms
  sfdx:core TRACE Setup child 'Config' logger instance +0ms
  sfdx:Config INFO Reading config file: C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx\sfdx-config.json
+0ms
  @oclif/config prerun hook done +237ms
  sfdx:core TRACE Setup child 'ConfigSetCommand' logger instance +31ms
  sfdx:force:config:set init version: @oclif/[email protected] argv: [ 'defaultusername=Sp7' ] +0ms
  sfdx:ConfigSetCommand INFO Running command [ConfigSetCommand] with flags [{"loglevel":"warn"}] and args [{}]
+0ms
  sfdx:core TRACE Setup child 'Config' logger instance +72ms
(node:45852) UnexpectedValueTypeError Plugin: sfdx-cli: Value is not defined
module: @oclif/[email protected]
task: runHook prerun
plugin: sfdx-cli
root: C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07
See more details with DEBUG=*
UnexpectedValueTypeError Plugin: sfdx-cli: Value is not defined
    at Object.ensure (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\node_modules\@salesforce\ts-types\lib\narrowing\ensure.js:29:15)
    at C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:229:33
    at Array.some (<anonymous>)
    at Config.cryptProperties (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:228:55)
    at Config.read (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:97:24)
    at async Config.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\configFile.js:218:9)
    at async Config.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:193:9)
    at async Function.create (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\kit\lib\creatable.js:20:9)
    at async ConfigAggregator.loadProperties (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\configAggregator.js:176:33)
    at async ConfigAggregator.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\configAggregator.js:41:9)
    at async Function.create (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\kit\lib\creatable.js:43:9)
    at async Function.determineSfdxTelemetryEnabled (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\telemetry\lib\telemetryReporter.js:21:40)
    at async Object.hook (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\plugin-analytics\lib\hooks\analyticsPrerun.js:23:30)
    at async C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\config\lib\config.js:150:21
    at async Promise.all (index 0)
    at async Promise.all (index 10)
module: @oclif/[email protected]
task: runHook prerun
plugin: sfdx-cli
root: C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07
See more details with DEBUG=*
  sfdx:Config INFO Reading config file: C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx\sfdx-config.json
+105ms
  sfdx:core TRACE Setup child 'SfdxProjectJson' logger instance +12ms
  sfdx:SfdxProjectJson INFO Reading config file: C:\Users\UserName\.sfdx\sfdx-project.json +0ms
  sfdx:SfdxProjectJson TRACE Setup child 'SchemaValidator' logger instance +5ms
  sfdx:SchemaValidator DEBUG Schema loaded for C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\schemas\sfdx-project.schema.json +0ms
  sfdx:SfdxProjectJson WARN The config file: C:\Users\UserName\.sfdx\sfdx-project.json is not schema valid
  sfdx:SfdxProjectJson Due to: Validation errors:
  sfdx:SfdxProjectJson should have required property 'packageDirectories' +31ms
  sfdx:core TRACE Setup child 'SfdxProjectJson' logger instance +39ms
  sfdx:SfdxProjectJson INFO Reading config file: C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\sfdx-project.json +3ms
  sfdx:SfdxProjectJson TRACE Setup child 'SchemaValidator' logger instance +3ms
  sfdx:SchemaValidator DEBUG Schema loaded for C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\schemas\sfdx-project.schema.json +36ms
  sfdx:SfdxProjectJson INFO Reading config file: C:\Users\UserName\.sfdx\sfdx-project.json +9ms
  sfdx:SfdxProjectJson TRACE Setup child 'SchemaValidator' logger instance +2ms
  sfdx:SchemaValidator DEBUG Schema loaded for C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\schemas\sfdx-project.schema.json +12ms
  sfdx:SfdxProjectJson WARN The config file: C:\Users\UserName\.sfdx\sfdx-project.json is not schema valid
  sfdx:SfdxProjectJson Due to: Validation errors:
  sfdx:SfdxProjectJson should have required property 'packageDirectories' +7ms
  sfdx:SfdxProjectJson INFO Reading config file: C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\sfdx-project.json +1ms
  sfdx:SfdxProjectJson TRACE Setup child 'SchemaValidator' logger instance +3ms
  sfdx:SchemaValidator DEBUG Schema loaded for C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\schemas\sfdx-project.schema.json +12ms
  sfdx:core TRACE Setup child 'Config' logger instance +35ms
  sfdx:Config INFO Reading config file: C:\Users\UserName\Documents\VS Code\Dev\Sp7\Sp7\.sfdx\sfdx-config.json
+81ms
ERROR running force:config:set:  Value is not defined
*** Internal Diagnostic ***

UnexpectedValueTypeError: Value is not defined
    at Object.ensure (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\node_modules\@salesforce\ts-types\lib\narrowing\ensure.js:29:15)
    at C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:229:33
    at Array.some (<anonymous>)
    at Config.cryptProperties (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:228:55)
    at Config.read (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:97:24)
    at async Config.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\configFile.js:218:9)
    at async Config.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js:193:9)
    at async Function.create (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\kit\lib\creatable.js:20:9)
    at async ConfigAggregator.loadProperties (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\configAggregator.js:176:33)
    at async ConfigAggregator.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\configAggregator.js:41:9)
    at async Function.create (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\kit\lib\creatable.js:43:9)
    at async ConfigSetCommand.init (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\node_modules\@salesforce\command\lib\sfdxCommand.js:228:33)
    at async ConfigSetCommand._run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\node_modules\@salesforce\command\lib\sfdxCommand.js:92:13)
    at async Config.runCommand (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\config\lib\config.js:172:9)
    at async Main.run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\command\lib\main.js:22:9)
    at async Main._run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\command\lib\command.js:43:20)
Outer stack:
    at Function.wrap (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\sfdxError.js:151:27)
    at ConfigSetCommand.catch (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\dist\ToolbeltCommand.js:247:46)
    at async ConfigSetCommand._run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\salesforce-alm\node_modules\@salesforce\command\lib\sfdxCommand.js:97:13)
    at async Config.runCommand (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\config\lib\config.js:172:9)
    at async Main.run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\command\lib\main.js:22:9)
    at async Main._run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@oclif\command\lib\command.js:43:20)
    at async Object.run (C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\dist\cli.js:32:20)
******

  sfdx:ConfigSetCommand ERROR [
  sfdx:ConfigSetCommand   '\u001b[1mERROR running force:config:set: \u001b[22m',
  sfdx:ConfigSetCommand   '\u001b[31mValue is not defined\u001b[39m',
  sfdx:ConfigSetCommand   '\u001b[31m\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m*** Internal Diagnostic ***\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31mUnexpectedValueTypeError: Value is not defined\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at Object.ensure (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\node_modules\\@salesforce\\ts-types\\lib\\narrowing\\ensure.js:29:15)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\config.js:229:33\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at Array.some (<anonymous>)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at Config.cryptProperties (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\config.js:228:55)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at Config.read (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\config.js:97:24)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Config.init (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\configFile.js:218:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Config.init (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\config.js:193:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Function.create (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\kit\\lib\\creatable.js:20:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async ConfigAggregator.loadProperties (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\configAggregator.js:176:33)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async ConfigAggregator.init (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\config\\configAggregator.js:41:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Function.create (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\kit\\lib\\creatable.js:43:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async ConfigSetCommand.init (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:228:33)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async ConfigSetCommand._run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:92:13)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Config.runCommand (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@oclif\\config\\lib\\config.js:172:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Main.run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@oclif\\command\\lib\\main.js:22:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Main._run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31mOuter stack:\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at Function.wrap (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:151:27)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at ConfigSetCommand.catch (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:247:46)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async ConfigSetCommand._run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:97:13)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Config.runCommand (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@oclif\\config\\lib\\config.js:172:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Main.run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@oclif\\command\\lib\\main.js:22:9)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Main._run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m    at async Object.run (C:\\Users\\UserName\\AppData\\Local\\sfdx\\client\\7.66.2-4f159a1d07\\dist\\cli.js:32:20)\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m******\u001b[39m\n' +
  sfdx:ConfigSetCommand     '\u001b[31m\u001b[39m'
  sfdx:ConfigSetCommand ] +103ms
  lazy-require saving type cache to C:\Users\UserName\AppData\Local\sfdx\module-types.json +2s
  lazy-require no changes to save +1ms
SFDX_UPDATE_INSTRUCTIONS

The logs did not help :/

Could you update this file C:\Users\UserName\AppData\Local\sfdx\client\7.66.2-4f159a1d07\node_modules\@salesforce\core\lib\config\config.js with the code below. Copy and paste everything there. Then run the command again and paste the logs here.

I just added the Logger to print the keys. So we will be able to see which value in the map for a given key is NULL when you execute the command.

````js
"use strict";
/*

  • Copyright (c) 2018, salesforce.com, inc.
  • All rights reserved.
  • SPDX-License-Identifier: BSD-3-Clause
  • For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
    /
    Object.defineProperty(exports, "__esModule", { value: true });
    const kit_1 = require("@salesforce/kit");
    const ts_types_1 = require("@salesforce/ts-types");
    const crypto_1 = require("../crypto");
    const messages_1 = require("../messages");
    const sfdxError_1 = require("../sfdxError");
    const logger_1 = require("../logger");
    const sfdc_1 = require("../util/sfdc");
    const configFile_1 = require("./configFile");
    const SFDX_CONFIG_FILE_NAME = 'sfdx-config.json';
    /
    *
  • The files where sfdx config values are stored for projects and the global space.
    *
  • Note: It is not recommended to instantiate this object directly when resolving
  • config values. Instead use {@link ConfigAggregator}
    *
  • ```
  • const localConfig = await Config.create({});
  • localConfig.set('defaultusername', '[email protected]');
  • await localConfig.write();
  • ```
  • https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_config_values.htm
    /
    class Config extends configFile_1.ConfigFile {
    constructor(options) {
    super(options || Config.getDefaultOptions(false));
    }
    /
    *

    • Returns the default file name for a config file.


    • See {@link SFDX_CONFIG_FILE_NAME}

      /

      static getFileName() {

      return SFDX_CONFIG_FILE_NAME;

      }

      /

    • Returns an object representing the supported allowed properties.

      /

      static getAllowedProperties() {

      if (!Config.allowedProperties) {

      throw new sfdxError_1.SfdxError('Config meta information has not been initialized. Use Config.create()');

      }

      return Config.allowedProperties;

      }

      /

    • Gets default options.

    • @param isGlobal Make the config global.

    • @param filename Override the default file. {@link Config.getFileName}

      /

      static getDefaultOptions(isGlobal = false, filename) {

      return {

      isGlobal,

      isState: true,

      filename: filename || this.getFileName()

      };

      }

      /

    • The value of a supported config property.

    • @param isGlobal True for a global config. False for a local config.

    • @param propertyName The name of the property to set.

    • @param value The property value.

      /

      static async update(isGlobal, propertyName, value) {

      const config = await Config.create(Config.getDefaultOptions(isGlobal));

      const content = await config.read();

      if (value == null) {

      delete content[propertyName];

      }

      else {

      kit_1.set(content, propertyName, value);

      }

      return config.write(content);

      }

      /

    • Clear all the configured properties both local and global.

      /

      static async clear() {

      let config = await Config.create(Config.getDefaultOptions(true));

      config.clear();

      await config.write();

      config = await Config.create(Config.getDefaultOptions(false));

      config.clear();

      await config.write();

      }

      /

    • Read, assign, and return the config contents.

      /

      async read() {

      try {

      await super.read();

      await this.cryptProperties(false);

      return this.getContents();

      }

      finally {

      await this.clearCrypto();

      }

      }

      /

    • Writes Config properties taking into account encrypted properties.

    • @param newContents The new Config value to persist.

      /

      async write(newContents) {

      if (newContents != null) {

      this.setContents(newContents);

      }

      await this.cryptProperties(true);

      await super.write();

      await this.cryptProperties(false);

      return this.getContents();

      }

      /

    • Sets a value for a property.


    • Throws {@link SfdxError}{ name: 'InvalidConfigValue' } If the input validator fails.

    • @param key The property to set.

    • @param value The value of the property.

      /

      set(key, value) {

      const property = Config.allowedProperties.find(allowedProp => allowedProp.key === key);

      if (!property) {

      throw sfdxError_1.SfdxError.create('@salesforce/core', 'config', 'UnknownConfigKey', [key]);

      }

      if (property.input) {

      if (property.input && property.input.validator(value)) {

      super.set(property.key, value);

      }

      else {

      throw sfdxError_1.SfdxError.create('@salesforce/core', 'config', 'InvalidConfigValue', [property.input.failedMessage]);

      }

      }

      else {

      super.set(property.key, value);

      }

      return this.getContents();

      }

      /

    • Initializer for supported config types.

      /

      async init() {

      this.logger = await logger_1.Logger.child(this.constructor.name);

      if (!Config.messages) {

      Config.messages = messages_1.Messages.loadMessages('@salesforce/core', 'config');

      }

      if (!Config.allowedProperties) {

      Config.allowedProperties = [

      {

      key: 'instanceUrl',

      input: {

      // If a value is provided validate it otherwise no value is unset.

      validator: value => value == null || (ts_types_1.isString(value) && sfdc_1.sfdc.isSalesforceDomain(value)),

      failedMessage: Config.messages.getMessage('InvalidInstanceUrl')

      }

      },

      {

      key: Config.API_VERSION,

      hidden: true,

      input: {

      // If a value is provided validate it otherwise no value is unset.

      validator: value => ts_types_1.isString(value) && sfdc_1.sfdc.validateApiVersion(value),

      failedMessage: Config.messages.getMessage('InvalidApiVersion')

      }

      },

      { key: Config.DEFAULT_DEV_HUB_USERNAME },

      { key: Config.DEFAULT_USERNAME },

      { key: Config.ISV_DEBUGGER_SID, encrypted: true },

      { key: Config.ISV_DEBUGGER_URL },

      {

      key: Config.DISABLE_TELEMETRY,

      input: {

      validator: value => value == null || ['true', 'false'].includes(value.toString()),

      failedMessage: Config.messages.getMessage('InvalidBooleanConfigValue')

      }

      },

      // This should be brought in by a plugin, but there isn't a way to do that right now.

      {

      key: 'restDeploy',

      hidden: true,

      input: {

      validator: value => value != null && ['true', 'false'].includes(value.toString()),

      failedMessage: Config.messages.getMessage('InvalidBooleanConfigValue')

      }

      }

      ];

      }

      Config.propertyConfigMap = kit_1.keyBy(Config.allowedProperties, 'key');

      // Super ConfigFile calls read, which has a dependecy on crypto, which finally has a dependency on

      // Config.propertyConfigMap being set. This is why init is called after the setup.

      await super.init();

      }

      /

    • Initialize the crypto dependency.

      /

      async initCrypto() {

      if (!this.crypto) {

      this.crypto = await crypto_1.Crypto.create();

      }

      }

      /

    • Closes the crypto dependency. Crypto should be close after it's used and no longer needed.

      /

      async clearCrypto() {

      if (this.crypto) {

      this.crypto.close();

      delete this.crypto;

      }

      }

      /

    • Get an individual property config.

    • @param propertyName The name of the property.

      /

      getPropertyConfig(propertyName) {

      const prop = Config.propertyConfigMap[propertyName];

      if (!prop) {

      throw sfdxError_1.SfdxError.create('@salesforce/core', 'config', 'UnknownConfigKey', [propertyName]);

      }

      return prop;

      }

      /

    • Encrypts and content properties that have a encryption attribute.

    • @param encrypt true to encrypt.

      /

      async cryptProperties(encrypt) {

      const hasEncryptedProperties = this.entries().some(([key]) => {

      this.logger.info(EXAMINING KEY ${key});

      return !!ts_types_1.ensure(Config.propertyConfigMap[key]).encrypted;

      });

      if (hasEncryptedProperties) {

      await this.initCrypto();

      const crypto = ts_types_1.ensure(this.crypto);

      this.forEach((key, value) => {

      if (this.getPropertyConfig(key).encrypted && ts_types_1.isString(value)) {

      this.set(key, ts_types_1.ensure(encrypt ? crypto.encrypt(value) : crypto.decrypt(value)));

      }

      });

      }

      }

      }

      /
      *

  • Username associated with the default dev hub org.
    /
    Config.DEFAULT_DEV_HUB_USERNAME = 'defaultdevhubusername';
    /
    *
  • Username associate with the default org.
    /
    Config.DEFAULT_USERNAME = 'defaultusername';
    /
    *
  • The sid for the debugger configuration.
    /
    Config.ISV_DEBUGGER_SID = 'isvDebuggerSid';
    /
    *
  • The url for the debugger configuration.
    /
    Config.ISV_DEBUGGER_URL = 'isvDebuggerUrl';
    /
    *
  • The api version
    /
    Config.API_VERSION = 'apiVersion';
    /
    *
  • Disables telemetry reporting
    */
    Config.DISABLE_TELEMETRY = 'disableTelemetry';
    exports.Config = Config;
    //# sourceMappingURL=config.js.map
    ````

The "features": ["DefaultWorkflowUser"] value isn't a valid config value. If you manually remove that from the file does that fix the problem?

I'm pretty sure the problem is in the ensure on Config.propertyConfigMap[key]. Since it isn't a valid key, that throws an error because it is undefined. How did you set features in your config file anyways?

image

With that said, I don't think we should fail all CLI commands when this happens. At most, it should display a warning to the user and continue on. I'll file a bug to resolve that.

The "features": ["DefaultWorkflowUser"] value isn't a valid config value. If you manually remove that from the file does that fix the problem?

I'm pretty sure the problem is in the ensure on Config.propertyConfigMap[key]. Since it isn't a valid key, that throws an error because it is undefined. How did you set features in your config file anyways?

image

With that said, I don't think we should fail all CLI commands when this happens. At most, it should display a warning to the user and continue on. I'll file a bug to resolve that.

I was able to reproduce his error. You are right @amphro, the features key is not valid

image

I think it should be added a new Exception message, like This ${key} is not valid to make it easier for people to understand the error. Or when reading the config file, ignore invalid keys.

Thank you @amphro and @AllanOricil ! I somehow mistakenly modified sfdx-config.json instead of project-scratch-def.json .

I removed the same and it is working fine post that! I'd really appreciate if error message is more user friendly. :)

Was this page helpful?
0 / 5 - 0 ratings