SFDX: Authorize Errorのまとめ

+ [LWC エラーの対処方法](https://qiita.com/Keiji_otsubo/items/480135e98f6b0144ee63)
+ [LWC エラーの対処方法2](https://qiita.com/Keiji_otsubo/items/54983dba4eb802686a12)
+ [Deploy Source to Org failed to run](https://qiita.com/Keiji_otsubo/items/0185c057c392f10cc0ea)

# SFDX: Authorize an Org failed to run

+ [Getting this error in Vscode couldn't get the answer trying for 3 days](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000074VBwc)

:::note
You can solve it with this video was the only way:

https://www.google.com/search?tbm=vid&q=java%20setup%20salesforce#fpstate=ive&vld=cid:bb59f45a,vid:U5zLx6rX2oI

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000PexdK
:::

+ [Can Someone Help me with this step Open the Command Palette again and enter SFDX: Authorize an Org. Choose Production in the next screen and then provide the org alias as myDevOrg. Your browser opens a Salesforce login page. Enter your credentials for you](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007FQuig)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/258f31f5-993c-9482-9c03-200f96d5a18c.png)


:::note
 I found out that it was an issue with my DNS i flushed it out and it worked
:::

# SFDX: Authorize an Org does not open browser

+ [SFDX: Authorize an Org does not open browser](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000NRDgn)

最終的にはPCに管理者権限がなかったみたい。

:::note
My laptop is work laptop and IT policy doesn't allow user to be admin. I reached out to IT and asked for admin rights temporarily. Once they assigned me, I started VS Code as Admin. 

And now when I authorize org or open org, Chrome browser opens and works as expected.

私のラップトップは仕事用のラップトップであり、IT ポリシーではユーザーが管理者になることを許可していません。 IT 部門に連絡を取り、一時的に管理者権限を求めました。彼らが私を割り当てた後、私は VS Code を管理者として開始しました。

そして、組織を承認するか、組織を開くと、Chrome ブラウザーが開き、期待どおりに動作するようになりました
:::

他には

:::note
I have the same issue. Seems like VS Code is not able to open chrome when it's set as default. May be version incompatibility.
Anyways I solved it by making Microsoft Edge my default browser. Windows 10 ->Search-> Default Apps -> Web Browser -> Microsoft Edge.
I am yet to try if other DX commands work after the initial step of web:auth

https://github.com/forcedotcom/cli/issues/371
:::

:::note
It looks to be resolvable by manually either uninstalling or installing the standalone auth plugin, I think.

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8b0DSAR
:::

# SFDX: Authorize an Org failed to run

+ [Help please! Prepare to develop](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000PexdK)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/7d7821fe-77a0-ed00-cfbb-981beee0e506.png)

:::note
You can solve it with this video was the only way:

https://www.google.com/search?tbm=vid&q=java%20setup%20salesforce#fpstate=ive&vld=cid:bb59f45a,vid:U5zLx6rX2oI
:::

+ [I am getting "Authorize an org error in vs code" . Can anyone help me with this. I have re installed vs code java and cli too this afternoon.](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007eqJJ9SAM)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/8197d779-0c06-1bc1-66fe-2263f50cc2f1.png)

:::note
1. Verify if Salesforce CLI is installed successfully or not.
2. Add the path of the Salesforce CLI to the environmental variables.


Please follow the below article to install and set the path for the Salesforce CLI.

+ [Salesforce CLI Installation steps](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm)
+ [steps for setting up VSCODE](https://salesforcediaries.com/2019/02/21/setup-your-developer-environment-for-lightning-web-comp/)
:::


# Getting error while authorizing org through VS code

+ [login.salesforce.com or test.salesforce.comは使えない](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000HE8BK)

# パスワード

+ [正しいパスワードを使用して Visual Studio Code から Trailhead Playground を認証できません](https://trailhead.salesforce.com/ja/trailblazer-community/feed/0D54S00000HEGi2)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/5a680bd3-545b-bda3-ae41-5e6c21ac5102.png)

:::note
Got past error by using steps mentioned here to authenticate a playground.

Authenticate Playground Section 

https://trailhead.salesforce.com/en/content/learn/projects/quickstart-vscode-salesforce/use-vscode-for-salesforce

Deployed using Terminal to the connected playground
sfdx force:source:deploy -p force-app/main/default
:::

# Warning: Ignoring extra certs from `null`, load failed: error:80000002:system library::No such file or directory

+ [SFDX: Open Default Org.](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007Vg8JDSAZ)

:::note alert
Starting SFDX: Authorize an Org

 14:21:00.710 sfdx org:login:web --alias vscodeOrg --instance-url https://login.salesforce.com --set-default

Warning: Ignoring extra certs from `null`, load failed: error:80000002:system library::No such file or directory

You acknowledge and agree that the CLI tool may collect usage information, user environment, and crash reports for the purposes of providing services or functions that are relevant to use of the CLI tool and product improvements.

Successfully authorized erdem.fatih.ib@erdem.fatih.ib with org ID 00DWT000000IXjt2AG

14:21:26.718 sfdx org:login:web --alias vscodeOrg --instance-url https://login.salesforce.com --set-default

 ended with exit code 0
:::

 :::note
 After trying many ways, I've solved the issue! The last method I did: First, I added the Salesforce CLI to the Windows %PATH, and then I also added it to the path of the Salesforce extension in Visual Studio Code. However, it still couldn't find the certificates. Later on, I downloaded them through the terminal command, not from Salesforce's official website (this might be a different approach due to setup). After adding them to %PATH again and integrating them into the Visual Studio Code extension, it worked! I'll post a proper update soon.

 いろいろ試した結果、問題が解決しました！最後に行った方法: まず、Salesforce CLI を Windows %PATH に追加し、次にそれを Visual Studio Code の Salesforce 拡張機能のパスにも追加しました。ただし、それでも証明書は見つかりませんでした。その後、Salesforce の公式 Web サイトからではなく、ターミナル コマンドを使用してこれらをダウンロードしました (これはセットアップにより異なるアプローチになる可能性があります)。これらを再度 %PATH に追加し、Visual Studio Code 拡張機能に統合すると、機能しました。すぐに適切なアップデートを投稿します。
:::

+ [SFDX: Authorize an Org failed to run](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007cmN64SAE)

:::note
I found out what is the issue. The Rav protector installed on my laptop was making the issue. Now I uninstalled everything looks good so far

何が問題なのか分かりました。私のラップトップにインストールされている Rav プロテクターが問題を引き起こしていました。今のところすべてをアンインストールしましたが、これまでのところ問題はないようです
:::