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 package commands sometimes does not display error messages when operations fail #2434

Closed
andrewslater opened this issue Aug 29, 2023 · 8 comments
Labels
area:packaging 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

@andrewslater
Copy link

Summary

Sometimes when sf package commands fail they do not display an error to the user.

Steps To Reproduce

  • Generate a project with sf project generate
  • Create a new devhub org, developer org w/ namespace, and link the dev org namespace to the devhub
  • Generate new 2gp package with sf package create -n MyPackage -t Managed -r force-app

Expected result

Package version creation fails because there is no metadata in the force-app directory and an appropriate error message is displayed.

Actual result

% sf package version create -p MyPackage -w 10 -x
Version create.... ⣾
Version create.... done

As a workaround customers can use the --verbose flag but many people are not aware of this:

% sf package version create -p Native2gp6 -w 10 -x --verbose
Version create...
Error (1): No matching source was found within the package root directory: force-app

I suspect this may have something to do with the ncurses(?) progress display that is used when --verbose is not used. We have also seen this problem with other "package" commands such as sf package convert but the reproduction steps are much more involved (and unfortunately sf package convert does not yet support a --verbose option)

System Information

  • zsh
{
  "cliVersion": "@salesforce/cli/2.0.0-beta.74",
  "architecture": "darwin-arm64",
  "nodeVersion": "node-v20.5.1",
  "osVersion": "Darwin 22.6.0",
  "shell": "zsh",
  "rootPath": "/Users/andrew.slater/.nvm/versions/node/v18.12.1/lib/node_modules/@salesforce/cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.1 (core)",
    "@oclif/plugin-commands 2.2.17 (core)",
    "@oclif/plugin-help 5.2.11 (core)",
    "@oclif/plugin-not-found 2.3.26 (core)",
    "@oclif/plugin-plugins 3.1.6 (core)",
    "@oclif/plugin-search 0.0.18 (core)",
    "@oclif/plugin-update 3.1.22 (core)",
    "@oclif/plugin-version 1.3.6 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.41 (core)",
    "@oclif/plugin-which 2.2.22 (core)",
    "@salesforce/cli 2.0.0-beta.74 (core)",
    "apex 2.3.4 (core)",
    "auth 2.8.4 (core)",
    "data 2.4.5 (core)",
    "deploy-retrieve 1.14.0 (core)",
    "info 2.6.25 (core)",
    "limits 2.3.23 (core)",
    "login 1.2.15 (core)",
    "org 2.9.19 (core)",
    "packaging 1.20.1 (user)",
    "schema 2.3.17 (core)",
    "settings 1.4.17 (core)",
    "sobject 0.1.32 (core)",
    "source 2.10.22 (core)",
    "telemetry 2.2.1 (core)",
    "templates 55.5.2 (core)",
    "trust 2.4.27 (core)",
    "user 2.3.20 (core)"
  ]
}```
### Additional information
<!-- Feel free to attach a screenshot -->
@andrewslater andrewslater added the investigating We're actively investigating this issue label Aug 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
Copy link

Hello @andrewslater 👋 None of the versions of sf you shared match the latest release.

Shared: 2.0.0-beta.74
Latest: 2.5.8

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Aug 29, 2023
@andrewslater
Copy link
Author

Regarding the comment about not using the latest sf version. I noticed it didn't look like I was using the latest version but when I try to update I see this:

% sf update
@salesforce/cli: Updating CLI...
@salesforce/cli: Updating CLI... not updatable

I uninstalled sf entirely, re-installed using these instructions but I still get the old version and the "not updatable" message when I try to update.

@andrewslater
Copy link
Author

I tested with the latest sf version and the problem still exists:

{
  "cliVersion": "@salesforce/cli/2.5.8",
  "architecture": "darwin-arm64",
  "nodeVersion": "node-v18.15.0",
  "osVersion": "Darwin 22.6.0",
  "shell": "zsh",
  "rootPath": "/usr/local/lib/sf",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.6 (core)",
    "@oclif/plugin-commands 2.2.22 (core)",
    "@oclif/plugin-help 5.2.17 (core)",
    "@oclif/plugin-not-found 2.3.37 (core)",
    "@oclif/plugin-plugins 3.2.6 (core)",
    "@oclif/plugin-search 0.0.22 (core)",
    "@oclif/plugin-update 3.1.32 (core)",
    "@oclif/plugin-version 1.3.8 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.48 (core)",
    "@oclif/plugin-which 2.2.30 (core)",
    "@salesforce/cli 2.5.8 (core)",
    "apex 2.3.10 (core)",
    "auth 2.8.12 (core)",
    "data 2.5.6 (core)",
    "deploy-retrieve 1.17.5 (core)",
    "info 2.6.39 (core)",
    "limits 2.3.30 (core)",
    "login 1.2.26 (core)",
    "org 2.10.0 (core)",
    "packaging 1.20.1 (user)",
    "schema 2.3.23 (core)",
    "settings 1.4.25 (core)",
    "sobject 0.2.4 (core)",
    "source 2.10.31 (core)",
    "telemetry 2.3.0 (core)",
    "templates 55.5.10 (core)",
    "trust 2.6.1 (core)",
    "user 2.3.28 (core)"
  ]
}

@github-actions github-actions bot added investigating We're actively investigating this issue validated Version information for this issue has been validated and removed more information required Issue requires more information or a response from the customer labels Aug 29, 2023
@andrewslater
Copy link
Author

Here's another clue about this issue. I found that redirecting the output to a file was a no-op:

% sfdx force:package:convert -x -w 10 -p 033xx0000004HGv > /tmp/output.log
Converting Package... Initializing
Converting Package... ⣾ Converting Package
Converting Package... done

So I thought maybe it's outputting to stderr by default. Sure enough if I do this I can see the full output (with some control characters) in my output file:

% sfdx force:package:convert -x -w 10 -p 033xx0000004HGv 2> /tmp/output.log

/tmp/output.log contents:

Converting Package... Initializing
(node:83801) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
^[[G^[[1A^[[JConverting Package... ^[[38;5;104m⣾^[[0m Converting Package
^[[1m^[[31mError (1):^[[39m^[[22m The specified namespace is not owned by the dev hub.
^[[G^[[1A^[[JConverting Package... done

BUT if you cat /tmp/output.log you see exactly what you see on the cmd line when you execute the command without output redirection:

% cat /tmp/output.log
Converting Package... Initializing
Converting Package... ⣾ Converting Package
Converting Package... done

So it seems like those control characters are deleting the line with the error message in them. And it seems like everything is output to sderr which is.....weird.

@olektymchenko
Copy link

I have the same issue for ex. when package 2 limit creation is exceed, instead of error I receive
Version create.... ⣾
Version create.... done

@jeromegv
Copy link

My friend Rai has the same issue

[17:07:00] raimotor .../Motor/MotorCampaigns$ sfdx package install --package MotorCampaigns@1.0.0-1 -o motor_dev -w 10 --publish-wait 10
10 minutes remaining until timeout. Publish status: Querying Status...
10 minutes remaining until timeout. Publish status: Querying Status... done

in this case he had forgotten the --installation-key param but there were no error messages

@mshanemc mshanemc added area:packaging bug Issue or pull request that identifies or fixes a bug labels Sep 8, 2023
@git2gus
Copy link

git2gus bot commented Sep 8, 2023

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

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