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

Error when generating new package version: Could not infer metada type #2541

Closed
yehielz opened this issue Oct 29, 2023 · 4 comments
Closed
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@yehielz
Copy link

yehielz commented Oct 29, 2023

I have the same issue. Trying to create a new version on an existing package will generate this error: Could not infer a metadata type.
I was trying to create a package version but received an error while trying sf package version create --package "***" --installation-key "" --wait 10

And I am receiving this error:
C:\Users*\AppData\Local\Temp*-912e2879161444ba06e8aef5d588e651\md-files\applications******.ap: Could not infer a metadata type

or

C:\Users*\AppData\Local\Temp*-912e2879161444ba06e8aef5d588e651\md-files\applications******.flexipag: Could not infer a metadata type

looking behind the scenes: sf plugin generates md-files in tempapp data, and the metadata type is truncated at the last letter.
flexipag instead of flexipage
ap instead of app
....

below ouput of sf version --verbose --json

{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.14.6",
"nodeVersion": "node-v16.17.1",
"osVersion": "Windows_NT 10.0.22621",
"rootPath": "C:\Users\*****\AppData\Roaming\npm\node_modules\@salesforce\cli",
"shell": "cmd.exe",
"pluginVersions": [
"@oclif/plugin-autocomplete 2.3.10 (core)",
"@oclif/plugin-commands 3.0.3 (core)",
"@oclif/plugin-help 6.0.3 (core)",
"@oclif/plugin-not-found 3.0.2 (core)",
"@oclif/plugin-plugins 3.9.2 (core)",
"@oclif/plugin-search 1.0.3 (core)",
"@oclif/plugin-update 4.1.2 (core)",
"@oclif/plugin-version 2.0.3 (core)",
"@oclif/plugin-warn-if-update-available 3.0.1 (core)",
"@oclif/plugin-which 3.0.5 (core)",
"@salesforce/cli 2.14.6 (core)",
"apex 2.3.20 (core)",
"auth 2.8.22 (core)",
"data 2.5.19 (core)",
"deploy-retrieve 1.19.2 (core)",
"env 2.1.15 (user)",
"info 2.6.49 (core)",
"limits 2.3.39 (core)",
"login 1.2.37 (core)",
"marketplace 0.3.0 (core)",
"org 2.11.4 (core)",
"packaging 1.26.4 (user)",
"schema 2.3.30 (core)",
"settings 1.4.35 (core)",
"sobject 0.2.13 (core)",
"source 2.10.43 (core)",
"telemetry 2.3.6 (core)",
"templates 55.5.14 (core)",
"trust 2.6.20 (core)",
"user 2.3.37 (core)"
]
}

@yehielz yehielz added the investigating We're actively investigating this issue label Oct 29, 2023
@github-actions
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 the validated Version information for this issue has been validated label Oct 29, 2023
@shetzel
Copy link
Contributor

shetzel commented Oct 29, 2023

90% of the time people report this error it's because they are running a command that requires metadata in source format but their metadata is in mdapi format. If the flexipage metadata files in your project have a suffix of (e.g.) Property_Explorer.flexipage versus Property_Explorer.flexipage-meta.xml then your source is in mdapi format and you must first convert it to source format before creating a package version.

@shetzel
Copy link
Contributor

shetzel commented Oct 29, 2023

Also, the nodeVersion reported above from sf version --verbose is 16.17.1, which is no longer supported by node so I would update to the latest LTS. https://endoflife.date/nodejs

@yehielz
Copy link
Author

yehielz commented Oct 30, 2023

Thanks for you help!! Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants