Skip to content
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

Unable to return list of users after they are created due to ProfileId error #1310

Closed
cloder-upland opened this issue Dec 6, 2021 · 7 comments
Labels
env:windows Labels enviornment-specific issues and pull requests for Windows. investigating We're actively investigating this issue

Comments

@cloder-upland
Copy link

Summary

We can create a scratch org successfully, and then according to the console output we can create a user successfully. But once I create the user and then try to get the list of users, I get thrown the error
"ERROR running force:user:list: Cannot read properties of undefined (reading 'ProfileId')"

Steps To Reproduce:

  1. Authenticate to your dev hub
  2. Run the command sfdx force:org:create edition=Developer -a MyOrg to create a scratch org
  3. Run the command sfdx force:user:list -u MyOrg and see that it returns the list with just the System Admin in it
  4. Run the command to create a user sfdx force:user:create username=[email protected] -u MyOrg
  5. Now rerun the command sfdx force:user:list -u MyOrg and see the error message "ERROR running force:user:list: Cannot read properties of undefined (reading 'ProfileId')"

Expected result

Get the list of users in the org

Actual result

Get the error message "ERROR running force:user:list: Cannot read properties of undefined (reading 'ProfileId')"

System Information

{
"cliVersion": "sfdx-cli/7.129.0",
"architecture": "win32-x64",
"nodeVersion": "node-v16.13.0",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.2.3 (core)",
"@oclif/plugin-not-found 1.2.4 (core)",
"@oclif/plugin-plugins 1.10.1 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.0 (core)",
"@oclif/plugin-which 1.0.3 (core)",
"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
"alias 1.1.22 (core)",
"apex 0.3.0 (core)",
"auth 1.7.6 (core)",
"config 1.2.48 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.5 (core)",
"generator 1.2.1 (core)",
"limits 1.2.3 (core)",
"org 1.9.2 (core)",
"salesforce-alm 53.4.5 (core)",
"schema 1.0.10 (core)",
"sfdx-cli 7.129.0 (core)",
"source 1.5.3 (core)",
"telemetry 1.3.0 (core)",
"templates 52.6.0 (core)",
"trust 1.0.10 (core)",
"user 1.5.3 (core)"
],
"osVersion": "Windows_NT 6.3.9600"
}

Additional information

SFDXError

@cloder-upland cloder-upland added the investigating We're actively investigating this issue label Dec 6, 2021
@github-actions
Copy link

github-actions bot commented Dec 6, 2021

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.

@cloder-upland cloder-upland changed the title Unable to return list of users after they are created dur to ProfileId error Unable to return list of users after they are created due to ProfileId error Dec 6, 2021
@mshanemc
Copy link
Contributor

mshanemc commented Dec 6, 2021

I tried this but couldn't get what you got. Can you take a look at what I did and see if there's anything different that jumps out to you?

➜  eng sfdx force:org:create edition=Developer -a MyOrg 
Successfully created scratch org: 00D1k000000HWfMEAW, username: [email protected]
➜  eng sfdx force:user:list -u MyOrg 
=== Users in org 00D1k000000HWfMEAW
Default  Alias  Username                       Profile Name          User Id
───────  ─────  ─────────────────────────────  ────────────────────  ──────────────────
(A)      MyOrg  [email protected]  System Administrator  0051k000007AMdZAAW
➜  eng sfdx force:user:create -u MyOrg                               
Successfully created user "[email protected]" with ID 0051k000007ANJwAAO for org 00D1k000000HWfMEAW.
You can see more details about this user by running "sfdx force:user:display -u [email protected]".
➜  eng sfdx force:user:list -u MyOrg
=== Users in org 00D1k000000HWfMEAW
Default  Alias  Username                                     Profile Name          User Id
───────  ─────  ───────────────────────────────────────────  ────────────────────  ──────────────────
(A)      MyOrg  [email protected]                System Administrator  0051k000007AMdZAAW
                [email protected]  Standard User         0051k000007ANJwAAO
➜  eng 

and the same with a custom username

➜  eng sfdx force:org:create edition=Developer -a MyOrg     
Successfully created scratch org: 00D21000000MCX2EAO, username: [email protected]
➜  eng sfdx force:user:create -u MyOrg [email protected]
Successfully created user "[email protected]" with ID 00521000008pfODAAY for org 00D21000000MCX2EAO.
You can see more details about this user by running "sfdx force:user:display -u [email protected]".
➜  eng sfdx force:user:list -u MyOrg                            
=== Users in org 00D21000000MCX2EAO
Default  Alias  Username                       Profile Name          User Id
───────  ─────  ─────────────────────────────  ────────────────────  ──────────────────
(A)      MyOrg  [email protected]  System Administrator  00521000008pefAAAQ
                [email protected]               Standard User         00521000008pfODAAY

If it seems right, maybe I'll have to fire up the old windows box and see if it's some OS problem.

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Dec 6, 2021
@cloder-upland
Copy link
Author

Your steps look the same as the ones I made. Unfortunately I don't have a Mac handy to try it here myself. While you boot up your windows box, I will ask my team to see if anyone has a Mac to try it here.

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Dec 7, 2021
@mshanemc
Copy link
Contributor

mshanemc commented Dec 9, 2021

This worked fine on windows, too (powershellm win10).

"osVersion": "Windows_NT 6.3.9600"
I'm going to guess this is due to the really old version of windows but can't say without being able to repro.

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Dec 9, 2021
@cloder-upland
Copy link
Author

I did these steps in Powershell on my machine and it works perfectly. So it looks to be related to running it from a command line.

I created several orgs and added users to them all and when I ran force:user:list to list the users, there were no errors. One thing to note, that when I call the force:user:list in powershell on an org/user that was created in my command window, I still get the ProfileId error. So, once it is messed up in dos, it stays messed up.

Powershell1

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Dec 13, 2021
@mshanemc mshanemc added the env:windows Labels enviornment-specific issues and pull requests for Windows. label Jan 3, 2022
@iampatrickbrinksma
Copy link

Hi, I am getting the same error on a Mac. MacOS Ventura 13.1.
I tried it both from within VSCode (terminal) and the terminal directly.

I tested both with zsh and bash shell, but no difference, the outcome is:

$ sfdx force:user:list -u SFSOrg1
WARNING: The --targetdevhubusername flag is deprecated and will be removed in v57 or later.
ERROR running force:user:list:  Cannot read properties of undefined (reading 'ProfileId')

System information:

{
"cliVersion": "sfdx-cli/7.185.0",
"architecture": "darwin-x64",
"nodeVersion": "node-v18.12.1",
"pluginVersions": [
"@oclif/plugin-autocomplete 1.3.10 (core)",
"@oclif/plugin-commands 2.2.2 (core)",
"@oclif/plugin-help 5.1.22 (core)",
"@oclif/plugin-not-found 2.3.13 (core)",
"@oclif/plugin-plugins 2.1.8 (core)",
"@oclif/plugin-search 0.0.8 (core)",
"@oclif/plugin-update 3.0.9 (core)",
"@oclif/plugin-version 1.1.4 (core)",
"@oclif/plugin-warn-if-update-available 2.0.19 (core)",
"@oclif/plugin-which 2.2.6 (core)",
"alias 2.1.18 (core)",
"apex 1.4.2 (core)",
"auth 2.3.12 (core)",
"community 2.1.3 (core)",
"config 1.4.23 (core)",
"custom-metadata 2.0.11 (core)",
"data 2.1.22 (core)",
"generator 2.0.16 (core)",
"info 2.3.3 (core)",
"limits 2.2.3 (core)",
"org 2.2.22 (core)",
"packaging 1.12.3 (core)",
"schema 2.2.2 (core)",
"signups 1.2.12 (core)",
"source 2.3.15 (core)",
"telemetry 2.0.5 (core)",
"templates 55.2.1 (core)",
"trust 2.2.8 (core)",
"user 2.1.25 (core)",
"@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
"salesforce-alm 54.8.5 (core)"
],
"osVersion": "Darwin 22.2.0",
"shell": "zsh",
"rootPath": "/Users/pbrinksma/.local/share/sfdx/client/7.185.0-9390167"
}

@mshanemc
Copy link
Contributor

mshanemc commented Nov 7, 2023

I could never replicate this, but I'm pretty sure it was fixed by salesforcecli/plugin-user#617

If you've got a replication on a current CLI/plugin, please open a new issue.

@mshanemc mshanemc closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env:windows Labels enviornment-specific issues and pull requests for Windows. investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

3 participants