cli icon indicating copy to clipboard operation
cli copied to clipboard

`sf org resume sandbox` command returns error when the target org (user) language is not in English

Open ninoish opened this issue 2 years ago • 12 comments

Summary

sf org resume sandbox command always returns error if the target sandbox language is in Japanese (in non-English languages) regardless of the sandbox status.

Steps To Reproduce

  • Setup DevHub org login user language to Japanese.
  • Run sf command to create a Sandbox : sf org create sandbox -o devhub@username -l Developer -n test202308 --no-prompt --async
  • Then run sf org resume sandbox --name test202308
  • It returns Error (1): The sandbox test202308 cannot resume with status of 処理中..
    • "処理中" is "In Progress" in Japanese
    • It also returns Error (1): The sandbox test202308 cannot resume with status of 有効化中. after a while. "有効化中" is "Activating" in Japanese.
    • It also return Error (1): The sandbox test202308 cannot resume with status of 完了. after a while. "完了" is "Completed" in Japanese.

Expected result

Check the status of a sandbox creation, and log in to it if it's ready without error.

Actual result

Error (1): The sandbox test202308 cannot resume with status of 完了.

System Information

sf version --verbose --json

{
  "cliVersion": "@salesforce/cli/2.5.8",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v18.16.0",
  "osVersion": "Darwin 22.6.0",
  "shell": "zsh",
  "rootPath": "/Users/ninoish/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.6 (core)",
    "@oclif/plugin-commands 2.2.22 (core)",
    "@oclif/plugin-help 5.2.17 (core)",
    "@oclif/plugin-not-found 2.3.37 (core)",
    "@oclif/plugin-plugins 3.2.6 (core)",
    "@oclif/plugin-search 0.0.22 (core)",
    "@oclif/plugin-update 3.1.32 (core)",
    "@oclif/plugin-version 1.3.8 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.48 (core)",
    "@oclif/plugin-which 2.2.30 (core)",
    "@salesforce/cli 2.5.8 (core)",
    "apex 2.3.10 (core)",
    "auth 2.8.12 (core)",
    "data 2.5.6 (core)",
    "deploy-retrieve 1.17.5 (core)",
    "functions 1.21.10 (user)",
    "info 2.6.39 (core)",
    "limits 2.3.30 (core)",
    "login 1.2.26 (core)",
    "org 2.10.0 (core)",
    "schema 2.3.23 (core)",
    "settings 1.4.25 (core)",
    "sobject 0.2.4 (core)",
    "source 2.10.31 (core)",
    "telemetry 2.3.0 (core)",
    "templates 55.5.10 (core)",
    "trust 2.6.1 (core)",
    "user 2.3.28 (core)"
  ]
}

ninoish avatar Aug 25 '23 08:08 ninoish

Hello @ninoish :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

github-actions[bot] avatar Aug 25 '23 08:08 github-actions[bot]

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.

github-actions[bot] avatar Aug 25 '23 08:08 github-actions[bot]

Hello @ninoish :wave: None of the versions of sf you shared match the latest release.

Shared: 2.1.7 Latest: 2.5.8

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

github-actions[bot] avatar Aug 25 '23 08:08 github-actions[bot]

Hello @ninoish :wave: None of the versions of sf you shared match the latest release.

Shared: 2.5.7 Latest: 2.5.8

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

github-actions[bot] avatar Aug 25 '23 08:08 github-actions[bot]

Call saitama

AllanOricil avatar Aug 26 '23 02:08 AllanOricil

Started the creation with english image

then, while the sandbox was beeing created, I changed my user language to Japonese (easter egg) image

and finally tried to get its status again, which gave me the error mentioned above image

then I changed my language to english once again and the issue was gone image

finally I changed it to spanish and verified the same issue happens, proving it is not a problem with japonese, but with all other languages different than english.

image image

This is a problem with the sandbox creation api and not with the cli. The API return responses with i18n (daf) and the CLI expects english only.

I would not fix or improve this because:

1 - it does not break the sandbox creation. image

Screenshot 2023-08-26 at 16 59 40

2 - it would be necessary to invest some effort to enable i18n

  • transform API responses to english after pooling the sandbox creation response
  • or apply i18n to the whole cli

AllanOricil avatar Aug 26 '23 17:08 AllanOricil

@ninoish (saitama) just use english and stop training because you are already too OP

AllanOricil avatar Aug 26 '23 18:08 AllanOricil

Thank you @AllanOricil for kind repro steps! I would go with switching user language before Sandbox creation in my automation process.

To fetch instance url, access token and user id

sfdx force:user:display --json -o SANDBOX_TARGET_ORG

to change use language

curl --location --request PATCH 'https://{INSTANCE_URL}/services/data/v58.0/sobjects/User/{USER_ID}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--data '{
	"LanguageLocaleKey": "en_US"
}'
sf org create sandbox -o SANDBOX_TARGET_ORG -l Developer -n test202308 --no-prompt --async

Then run

sf org resume sandbox --name test202308

Then switch the source org language back.

curl --location --request PATCH 'https://{INSTANCE_URL}/services/data/v58.0/sobjects/User/{USER_ID}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--data '{
	"LanguageLocaleKey": "ja"
}'

Of course Saitama wouldn't take such a workaround, he just smash it for sure.

ninoish avatar Aug 31 '23 06:08 ninoish

@ninoish u are a hero 👏 Saitama would be proud of u

AllanOricil avatar Aug 31 '23 11:08 AllanOricil

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

git2gus[bot] avatar Sep 07 '23 12:09 git2gus[bot]

I'm calling this a bug and am going to ask the Sandbox team to have their API follow the docs and only return the enumerated values for Status which are all in English https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_sandboxprocess.htm

mshanemc avatar Sep 07 '23 12:09 mshanemc

We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.

github-actions[bot] avatar Sep 07 '23 12:09 github-actions[bot]