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

sf project generate manifest --from-org failing #2841

Closed
KevinGossentCap opened this issue Apr 23, 2024 · 13 comments
Closed

sf project generate manifest --from-org failing #2841

KevinGossentCap opened this issue Apr 23, 2024 · 13 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@KevinGossentCap
Copy link

KevinGossentCap commented Apr 23, 2024

Note
Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

In most of my Salesforce environments, the un restricted sf project generate manifest --from-org does fail with a pretty standard message
Error (1): _Default: Could not infer a metadata type

Try this:

Additional suggestions:
Confirm the file name, extension, and directory names are correct. Validate against the registry at:
https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json

If the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:
https://developer.salesforce.com/docs/metadata-coverage

If the type is available via Metadata API but not in the registry

I played with CLI sources to try to find what it was and not a better thing as I get this in the listing

{
    "createdById": "{My own ID}",
    "createdByName": "{My own full name}",
    "createdDate": "1970-01-01T00:00:00.000Z",
    "fileName": "",
    "fullName": "_Default",
    "id": "",
    "lastModifiedById": "{My own ID}",
    "lastModifiedByName": "{My own full name}",
    "lastModifiedDate": "1970-01-01T00:00:00.000Z",
    "namespacePrefix": "",
    "type": ""
},

Steps To Reproduce

IMPORTANT
Provide a repository that's configured to reproduce the issue. If you are unable to provide a repo, please explain why not. The more info we have from the start, the faster we can resolve your issue.
We may close your issue if you don't include proper instructions.

  • Generate a project with sf project generate or fork dreamhouse-lwc.
  • Provide detailed step-by-step instructions on how to reproduce the issue.

Can't find what's this _Default component but since I have it, everything just crashes

Expected result

No crashing !
For element/type not yet supported/described, more information so that we could give it/implement with a PR

Actual result

Crashes and no package xml produced

System Information

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.38.7",
  "nodeVersion": "node-v20.12.2",
  "osVersion": "Windows_NT 10.0.19045",
  "rootPath": "C:\\Users\\wh6533\\AppData\\Local\\Programs\\node-v20.12.0-win-x64\\node_modules\\@salesforce\\cli",
  "shell": "cmd.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.15 (core)",
    "@oclif/plugin-commands 3.3.1 (core)",
    "@oclif/plugin-help 6.0.21 (core)",
    "@oclif/plugin-not-found 3.1.4 (core)",
    "@oclif/plugin-plugins 5.0.10 (core)",
    "@oclif/plugin-search 1.0.22 (core)",
    "@oclif/plugin-update 4.2.6 (core)",
    "@oclif/plugin-version 2.0.17 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.15 (core)",
    "@oclif/plugin-which 3.1.7 (core)",
    "@salesforce/cli 2.38.7 (core)",
    "apex 3.1.5 (core)",
    "auth 3.6.1 (core)",
    "data 3.3.1 (core)",
    "deploy-retrieve 3.6.3 (core)",
    "info 3.2.1 (core)",
    "limits 3.3.3 (core)",
    "marketplace 1.2.1 (core)",
    "org 4.1.1 (core)",
    "packaging 2.4.0 (core)",
    "schema 3.3.3 (core)",
    "settings 2.2.1 (core)",
    "sobject 1.3.3 (core)",
    "source 3.3.1 (core)",
    "telemetry 3.3.2 (core)",
    "templates 56.2.2 (core)",
    "trust 3.6.3 (core)",
    "user 3.5.2 (core)",
    "@salesforce/sfdx-scanner 4.0.0 (user)",
    "sfdx-kgo-plugin 1.4.8 (user)"
  ]
}

Additional information

@KevinGossentCap KevinGossentCap added the investigating We're actively investigating this issue label Apr 23, 2024
Copy link

Hello @KevinGossentCap 👋 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!

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.

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer investigating We're actively investigating this issue validated Version information for this issue has been validated and removed investigating We're actively investigating this issue more information required Issue requires more information or a response from the customer labels Apr 23, 2024
@mshanemc
Copy link
Contributor

Well, the metadata API giving back metadata without a type is definitely going to cause problems for consumers like the CLI.

I'm really glad you found that...do you have any idea what that type is for ? "fullName": "_Default",

Are you getting back that response from the metadata describe?

Is there a way to construct a scratch org that has that in its mdapi responses so I can see it?

@mshanemc
Copy link
Contributor

Not sure if you searched issues, but you might want to look at #2229 (comment)

@KevinGossentCap
Copy link
Author

KevinGossentCap commented Apr 23, 2024

Hi @mshanemc , I did not find any way to find what this ocmponent is as of now.
I did look into the tagged issue but didn't see any way to really change that.
By the way this _Default is between type StaticResource and type TimelineObjectDefinition

I tried to add _Default to .forceignore but it did not change a thing
I tried to look of any way to change the dictionnary used, but couldn't find any through UI. By the way, I have that issue in all sandbox (only prod is not affected 😢 even though it has the same elements with the same dictionnary)

@aheber
Copy link

aheber commented Apr 23, 2024

Sounds like a SynonymDictionary

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_synonymdictionary.htm

They _Default can get broken. I've found sometimes I need to recreate it as a different name and delete the original to get it represented correctly.

I think there are probably a couple other open issues on this repo for the same problem.

@KevinGossentCap
Copy link
Author

Sounds like a SynonymDictionary

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_synonymdictionary.htm

They _Default can get broken. I've found sometimes I need to recreate it as a different name and delete the original to get it represented correctly.

I think there are probably a couple other open issues on this repo for the same problem.

I played with CLI commands and duplicating/deleting through CLI makes things work afterwards.
As I don't personally know how to test if there is any impact of changing the name of a dictionary I'll have to see further on that before propagating everywhere (as it's really handicapping to not being able to produce a manifest from environment for some use-case like initiating a code builder env for example)

@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label Apr 23, 2024
Copy link

git2gus bot commented Apr 23, 2024

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

@mshanemc
Copy link
Contributor

marking this as a bug so we can make the CLI more resilient to bad behavior like this.

@KevinGossentCap
Copy link
Author

@mshanemc the quickest idea would be to

@KevinGossentCap
Copy link
Author

I saw your PR and refactor afterwards, pretty clean 😄

@mshanemc
Copy link
Contributor

@KevinGossentCap it's in nightly now and will be RC later today if you want to confirm with your weird org that it's solving it. I think Willie was able to create a bad _Default SynonynDictionary while QAing.

@jshackell-sfdc
Copy link
Collaborator

This issue is fixed in version 2.39.6 of Salesforce CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

4 participants