LoginSignup
0
0

sf でのエラーのまとめ

Last updated at Posted at 2023-11-02

sfへの移行が推奨されているので、sfと明らかにわかるエラーを別途分けて管理します。

sfdx (v7)からsf (v2)への移行

現在使用している場合SFDX(v7) に移行することを強くお勧めします。SF(v2)。移行は簡単です。まずアンインストールします。SFDX(v7) をインストールしてから、SF(v2)。移動後も、ターミナルで実行していた CLI コマンドや継続的インテグレーション (CI) スクリプトは、引き続き以前と同様に機能します。

'sf' is not recognized as an internal or external command

Upgrade: 'sf' is not recognized as an internal or external command

I had to reinstall it worked.

Run a Validate-Only Deployment option is not available

image.png

Validate-only promotion works only for versioned promotions, which are promotions of bundles.

In your case UAT is the bundling stage so the bundle is created after you promote to PROD, it doesn't exist before that and that is why the validate-only doesn't work, you don't have a bundle to validate yet.

検証のみのプロモーションは、バンドルのプロモーションであるバージョン付きプロモーションに対してのみ機能します。

あなたの場合、UAT はバンドル段階であるため、PROD に昇格した後にバンドルが作成されます。その前には存在しないため、検証のみが機能しません。まだ検証するバンドルがありません。

sfのアンインストール

これが表示される場合はコマンドのパラメータが存在していない

image.png

image.png

To uninstall sf (v1 or v2), run this command:

npm uninstall @salesforce/cli --global

https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_uninstall.htm

ERROR running force:apex:test:run: Invalid time value

sf apex run test --wait 300 --test-level RunLocalTests --code-coverage --result-format json

Error (10): Metadata API request failed: Cannot read properties of null (reading 'split')

The challenge was not in VSCode Salesforce plugins nor the 2.28.6 cli. The solution: I removed the .sf and .sfdx hidden folders from my project (if you look inside there's a ton of metadata + tools, etc...) Then, I ran sf config:set target-org=myorg. I was able to deploy successfully.

From what I can tell the metadata that's cached in those directories was not compatible with the new version of the cli. And issuing the set defaultusername command generated the .sf and .sfdx directories with the supported metadata for the cli. Looking at our .gitignore, there's a good reason why we don't version control those directories.

課題は VSCode Salesforce プラグインにも 2.28.6 cli にもありませんでした。解決策: プロジェクトから .sf と .sfdx の隠しフォルダーを削除しました (中身を見ると大量のメタデータとツールなどが存在します...) それから、 sf config:set target-org=myorg を実行しました。無事にデプロイできました。

私の知る限り、これらのディレクトリにキャッシュされているメタデータは cli の新しいバージョンと互換性がありませんでした。setdefaultusername コマンドを発行すると、cli でサポートされているメタデータを含む .sf ディレクトリと .sfdx ディレクトリが生成されました。.gitignore を見ると、これらのディレクトリをバージョン管理しないのには十分な理由があります。

sf:INSUFFICIENT_ACCESS: INSUFFICIENT_ACCESS: use of the Metadata API requires a user with the ModifyAllData or ModifyMetadata permissions.

プロファイルのメタデータ タイプにアクセスできる必要があります

スクリーンショットを確認して、プロファイルがこれらのメタデータ タイプにアクセスできるかどうかを確認してください。

you need to have access to metadata type for your profile

pls check the screenshot and see if your profile has access to those metadata types

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0