sfcc-ci icon indicating copy to clipboard operation
sfcc-ci copied to clipboard

User Creation Ambiguous options

Open drodriguez-crocs opened this issue 5 years ago • 16 comments

Currently trying to prepare for a mass user migration from SFCC login to Account Manager login, and was given this tool. Currently trying to create test users in both environments to see if this tool will work for our needs.

I am running the following(redacted) for both instance and org, but receiving the same error on both: sfcc-ci-win user:create --instance "development-instance" --login "[email protected]" --user '{"firstName":"Daniel", "lastName":"Testing"}'

sfcc-ci-win user:create --org "org" --login "mylogin" --user '{"email":"[email protected]","first_name":"Daniel", "last_name":"Testing"}'

Error: Error: Ambiguous options. Pass either -o,--org or -i,--instance.

Anyone know what the issue is, or if there is a workaround/fix?

drodriguez-crocs avatar Mar 09 '21 15:03 drodriguez-crocs

Hi, i am facing the same issue. whats the fix please?

suhel1612 avatar Mar 10 '21 14:03 suhel1612

Please note, that there is a difference in the way how the user details are provided (via the JSON). There is a difference in the property naming, depending on whether you create a user in Account Manager (sfcc-ci user:create with --org and without --instance) or you create a user in a B2C Commerce instance (sfcc-ci user:create without --org and with --instance).

The Account Manager user details must be provided with property names in camelCase, whereas for B2C Commerce instance user details must be provided with property names in snake_case).

Eg.

sfcc-ci-win user:create --org "org" --login "mylogin" --user '{"email":"[email protected]","first_name":"Daniel", "last_name":"Testing"}'

is wrong. It must be:

sfcc-ci-win user:create --org "org" --login [email protected] --user '{"firstName":"Daniel", "lastName":"Testing"}'

whereas

sfcc-ci-win user:create --instance "development-instance" --login "[email protected]" --user '{"firstName":"Daniel", "lastName":"Testing"}'

is wrong as well. It must be:

sfcc-ci-win user:create --instance "development-instance" --login "[email protected]" --user '{"first_name":"Daniel", "last_name":"Testing"}'

tobiaslohr avatar May 12 '21 15:05 tobiaslohr

@tobiaslohr Thanks for the clarification, but I am still receiving the 'Error: Ambiguous options. Pass either -o,--org or -i,--instance.' error even with the correct naming formats.

drodriguez-crocs avatar May 17 '21 22:05 drodriguez-crocs

Update for all.. I have gotten this to work on the MacOS version, but not the windows version, so this may be a bug with the windows specific version

drodriguez-crocs avatar May 18 '21 14:05 drodriguez-crocs

Which exact command is not working with the windows version? Can you paste the command here please?

tobiaslohr avatar May 27 '21 10:05 tobiaslohr

Hi Tobias, This issue was resolved. Thanks Regards, Suhel

On Thu, May 27, 2021 at 11:28 AM Tobias Lohr @.***> wrote:

Which exact command is not working with the windows version? Can you paste the command here please?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SalesforceCommerceCloud/sfcc-ci/issues/205#issuecomment-849520932, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4YX5JECFLSVTFYCWFUUC3TPYNDNANCNFSM4Y34ISPQ .

suhel1612 avatar May 27 '21 10:05 suhel1612

HI @suhel1612, thanks and glad you've solved it! For the sake of sharing with other community members, can you let us know, who you've solved the issue finally?

tobiaslohr avatar May 27 '21 10:05 tobiaslohr

Which exact command is not working with the windows version? Can you paste the command here please?

sfcc-ci-win user:create --org org2 -l [email protected] --user '{"firstName":"Daniel", "lastName":"Testing","roles":["bm-user"]}' Error: Ambiguous options. Pass either -o,--org or -i,--instance.

drodriguez-crocs avatar May 27 '21 14:05 drodriguez-crocs

In the On demand sandbox, new users have to be created through the Account Manager.

Regards, SP

On Thu, May 27, 2021 at 3:34 PM drodriguez-crocs @.***> wrote:

Which exact command is not working with the windows version? Can you paste the command here please?

sfcc-ci-win user:create --org org2 -l @.*** --user '{"firstName":"Daniel", "lastName":"Testing","roles":["bm-user"]}' Error: Ambiguous options. Pass either -o,--org or -i,--instance.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SalesforceCommerceCloud/sfcc-ci/issues/205#issuecomment-849686722, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4YX5LMDZJ42Y72IWIU76DTPZJ6PANCNFSM4Y34ISPQ .

suhel1612 avatar May 27 '21 16:05 suhel1612

@drodriguez-crocs The error message Error: Ambiguous options. Pass either -o,--org or -i,--instance. is only printed if:

  • --org AND --instance are not passed or
  • --org AND --instance are passed

as you are passing --org, it may be that --instance (although not being passed explicitly) is being looked up via a configured default instance (from previous commands).

Can you please check if a default instance is set? You can di this by running sfcc-ci instance:list (look for "Default Instance") in the output.

If there is a default instance being set, then we should fix the sfcc-ci user:create command to only accept --instance being passed explicitly.

tobiaslohr avatar May 27 '21 20:05 tobiaslohr

@tobiaslohr It does not appear that there is a default instance set when running instance:list Default Instance │ (not set)

drodriguez-crocs avatar May 27 '21 21:05 drodriguez-crocs

@drodriguez-crocs Thanks for confirming! And just to double check, you are still receiving the same error, when executing:

sfcc-ci-win user:create --org org2 -l [email protected] --user '{"firstName":"Daniel", "lastName":"Testing","roles":["bm-user"]}'

?

tobiaslohr avatar May 28 '21 07:05 tobiaslohr

@tobiaslohr That is correct, I am still receiving the error when running your command with the correct org name and ID.

drodriguez-crocs avatar Jun 01 '21 14:06 drodriguez-crocs

@drodriguez-crocs can you run the command in debug mode and (not put the output here!) check if you see the value for --org being properly passed and processed?

tobiaslohr avatar Jun 01 '21 15:06 tobiaslohr

@drodriguez-crocs is this issue still happening / relevant or can we close it?

tobiaslohr avatar Jan 24 '22 13:01 tobiaslohr

@drodriguez-crocs Quick checkin: were you able to resolve this and can we close this ticket?

tobiaslohr avatar Nov 16 '22 10:11 tobiaslohr