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

force:user:permset:assign fails on 7.84.2 #802

Closed
jcory opened this issue Jan 14, 2021 · 9 comments
Closed

force:user:permset:assign fails on 7.84.2 #802

jcory opened this issue Jan 14, 2021 · 9 comments
Assignees
Labels
regression Issue that regresses existing functionality

Comments

@jcory
Copy link

jcory commented Jan 14, 2021

Summary

The permission set assignment command fails on the latest version of the CLI.

Steps To Reproduce:

Repository to reproduce: dreamhouse-lwc

  1. Follow the "Installing Dreamhouse using a Scratch Org" steps (outlined here)
  2. After successfully pushing the source code, run the following command: sfdx force:user:permset:assign -n dreamhouse

Expected result

The permission set is assigned to the default user.

Actual result

The command fails with the error Permission set "d" not found in target org. Do you need to push source?

Additional information

image

I noticed this in a separate repository, and used Dreamhouse for simplicity/replication's sake.

SFDX CLI Version:
sfdx-cli/7.84.2-a2868a68d5 darwin-x64 node-v12.18.3

SFDX plugin Version:
7.84.2

OS and version:
macOS Big Sur (v11.1)

Tracked under @W-8716914@

@jcory jcory added the investigating We're actively investigating this issue label Jan 14, 2021
@github-actions
Copy link

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.

@amphro amphro self-assigned this Jan 14, 2021
@amphro
Copy link
Contributor

amphro commented Jan 14, 2021

@jcory we are trying to identify why the core plugin did not get updated. Until we are able to patch, you can run sfdx plugins:install user to fix the issue.

@mhail
Copy link

mhail commented Jan 15, 2021

Another related issue I have seen with force:user:permset:assign is using the --onbehalfof switch causes error running force:user:permset:assign: No AuthInfo found for name + the username specified.

Same version. 7.84.2

EX:

sfdx force:user:permset:assign -n B2B_Commerce_User --onbehalfof [email protected]
ERROR running force:user:permset:assign:  No AuthInfo found for name [email protected]

I switched back to 7.82.1-0 via NPM (npm install [email protected] --global). until a fix is in for 7.84.x

@amphro amphro added regression Issue that regresses existing functionality and removed investigating We're actively investigating this issue labels Jan 15, 2021
@git2gus
Copy link

git2gus bot commented Jan 15, 2021

This issue has been linked to a new work item: W-8730330

@amphro
Copy link
Contributor

amphro commented Jan 15, 2021

It should be tracked under @W-8716914@

@amphro
Copy link
Contributor

amphro commented Jan 16, 2021

Please see #811 - we will make sure this is addressed in the next release.

@bdovh
Copy link

bdovh commented Jan 21, 2021

I think we can use another workaround without having to install any plugin.

Just create a file scripts/apex/assignCurrentUser.apex with a code

PermissionSet ps = [SELECT Id FROM PermissionSet WHERE Name = 'PermName'];
List psas = new List();

for (Id uid: new List{UserInfo.getUserId()}) {
psas.add(new PermissionSetAssignment(AssigneeId = uid, PermissionSetId = ps.Id));
}
insert psas;
and the bash file assignCurrentUser.sh

code=$(cat scripts/apex/assignCurrentUser.apex)
echo "${code/PermName/$1}" > temp.apex
sfdx force:apex:execute -f temp.apex
rm temp.apex
and then just execute it

./assignCurrentUser.sh PermissionSetName

@mohametso
Copy link

Hi this is really blocking however the workaround works well @bdovh thanks

@WillieRuemmele
Copy link
Member

this is fixed in the latest-rc release of the cli or v1.0.9 of plugin-user
npm install sfdx-cli@latest-rc --global or sfdx plugins:install user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue that regresses existing functionality
Projects
None yet
Development

No branches or pull requests

6 participants