forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
493 stars 78 forks source link

Empty Static Resource files can't be included in a sf package version #2973

Open mekadigital opened 3 months ago

mekadigital commented 3 months ago

Summary

Running sf package version create with a Static Resource that is empty will error.

Steps To Reproduce

Sample repo is available here: https://github.com/mekadigital/md-package-tests-empty-resource Clone repo and run

% sf package version create --path force-app --wait 1000 --code-coverage -x Warning: Record types defined in the scratch org definition file will stop being capitalized by default in a future release. Set the org-capitalize-record-types config var to true to enforce capitalization. Version create.... Create version status: Error Error (MultipleErrorsError): Multiple errors occurred: (1) An unexpected error occurred. Please contact Salesforce Support and provide the following error code: 1057494537-1609187 (-852365351)

Adding a whitespace character to the staticresource solves the issue.

Expected result

Package created

Actual result

Package can't be created.

(I've already worked around this by removing the resource, but it took so long to work out why it wasn't working I raised the issue)

System Information

zsh

{
  "architecture": "darwin-x64",
  "cliVersion": "@salesforce/cli/2.51.6",
  "nodeVersion": "node-v20.15.0",
  "osVersion": "Darwin 22.6.0",
  "rootPath": "/Users/nich/.local/share/sf/client/2.51.6-e49d0be",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.7 (core)",
    "@oclif/plugin-commands 4.0.7 (core)",
    "@oclif/plugin-help 6.2.6 (core)",
    "@oclif/plugin-not-found 3.2.11 (core)",
    "@oclif/plugin-plugins 5.3.7 (core)",
    "@oclif/plugin-search 1.2.3 (core)",
    "@oclif/plugin-update 4.4.9 (core)",
    "@oclif/plugin-version 2.2.8 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.9 (core)",
    "@oclif/plugin-which 3.2.8 (core)",
    "@salesforce/cli 2.51.6 (core)",
    "apex 3.2.5 (core)",
    "auth 3.6.36 (core)",
    "data 3.5.5 (core)",
    "deploy-retrieve 3.9.17 (core)",
    "info 3.3.18 (core)",
    "limits 3.3.18 (core)",
    "marketplace 1.2.18 (core)",
    "org 4.3.5 (core)",
    "packaging 2.7.1 (core)",
    "schema 3.3.19 (core)",
    "settings 2.3.8 (core)",
    "sobject 1.4.19 (core)",
    "source 3.5.5 (core)",
    "telemetry 3.6.2 (core)",
    "templates 56.3.3 (core)",
    "trust 3.7.13 (core)",
    "user 3.5.18 (core)"
  ]
}

Additional information

github-actions[bot] commented 3 months ago

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.

mdonnalley commented 3 months ago

@mekadigital Thanks for taking the time to provide a repo that replicates the issue 🏆

I'm able to successfully do a sf project convert source and sf project deploy start on your repo, which indicates to me that this an issue for the packaging team. I'll send this over to them to take a look

github-actions[bot] commented 3 months ago

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.

sethmuss commented 3 months ago

Hello @mekadigital , sorry you've run into this I'm sure it was annoying to track down. Thank you for the report and the reproduction repo, I've created an internal bug and we'll get to it when we can.

Seth

rnavroze commented 2 months ago

I received the exact same error message and trace code while creating a package version. In my case, it was an empty CSS file in an LWC. So I believe the more appropriate header would be - "Empty files can't be included in an sf package version"