-
Notifications
You must be signed in to change notification settings - Fork 78
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
SFDX Force package version create command doesn't return any output #2092
Comments
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. |
local version where everything works good is 7.194.1 |
sfdx version --verbose --json when I updated sfdx cli locally, issue is not reproduced on local computer |
This also happens about 30% of the time on our CI runs. It started last Friday (4/21) and still persists.
|
for me it happens in 100% on the Github Actions flow, but 0% on the local machine |
Tried to downgrade the sfdx cli version on github actions but this didn't help |
switching runners from runs-on: ubuntu-latest to runs-on: macOS-latest didn't help |
@bdovh - I can't reproduce this locally when running (e.g.) |
@shetzel |
Can you redirect stderr and see if it's going there? Or maybe rather than the echo redirect do: |
@shetzel well, I do have redirect to a file and the file is empty |
how can I redirect strerr? if I can do that for sfdx command run on github actions? |
The default shell for non-Windows GHA runner is bash, so you can try: |
@shetzel When we add the
note: this is on the release candidate version of |
This also just started happening for us in Circle CI today. Same use case as above, CI script creates package version, parses JSON output to save package id. This was on sfdx-cli 7.199.7. We were able to resolve for now by downgrading to 7.198. |
Downgrade didn't help to me
I am going to try both the options sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json $branchSwitch &> out.txt and sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json $branchSwitch > out.txt 2>&1 |
Also I tried to remove --post-install-script PostInstall switch (since I believe I have it duplicated in both sfdx-project.json and here) but that didn't help to resolve the issue |
which exact version of sfdx cli did you use which worked for you? |
2023-05-05T09:02:02.984Z config reading core plugin /usr/local/lib/node_modules/sfdx-cli |
I run all, and received a lot of output but none of it explains why there is no JSON output |
Downgrading to |
sfdx-v7.198.3-1a39201-linux-x64 |
I should add, I also disabled telemetry because of the (likely unrelated) errors in the posted debugs above. But just this alone did not solve the issue when running 7.199.7. To disable, I used The telemetry thing may be a red herring, but I'm not in a position to be messing with my CI and possibly breaking it again right now. May try removing it later. |
There could be multiple bugs. I'm not sure if telemetry is a red herring either. |
|
I just tried to downgrade to 7.182.1 and received an error Error: command package:version:create not found |
even when I reverted to sfdx force:package:version:create, it didn't help |
@bdovh - CLI v7.182.1 did not have the command alias setup yet for using |
This issue has been linked to a new work item: W-13169031 |
maybe there are some additional errors, I don't know. But when I downgrade and use force:package:version:create, I don't receive any debugs, it just fails and drops. |
Just wanted to confirm I am running into the same issue with the current stable version: Thanks for creating the work-item! |
This could be an issue with nodejs versions. I am not able to reproduce it with v18.14.2 but I can with v18.16.0. Can people test this theory by trying different nodejs versions with npm installs of the CLI and retesting? |
FYI I tried to downgrade to sfdx-cli 7.182.1 as suggested and now I get the following error message within a few seconds where it used to hang and return no result with higher versions: I'll try downgrading node and report on that. |
Worked like a charm with node 18.14.2 as suggested @shetzel |
Thanks for that @eschweitzer78! I am getting the same issue as all of you. Adding the config below to the GHA solved the issue for me as you have suggested.
Hopefully this issue will get resolved soon. I have tried almost everything that people have suggested here, like downgrading SFDX, adding a --json, etc. The command works fine locally, but for sure I am not using the latest node version. |
There appears to be a handful of projects having issues with the LTS version of nodejs, 18.16.0. Please refer to this pinned notification: #2125 @bdovh and others experiencing this in CI, note that GitHub Actions is using nodejs v18.16.0 in Ubuntu 20 / 22 (latest) if the Node version is specified just as 18 so you'll need to provide a specific minor version, e.g., 18.15. |
We've got some workarounds and a fixed RC available. I'd love to know that this is working for you. |
Do we even control which nodejs version is used? We just use the script to install sfdx cli and in that script we can select the SFDX CLI version but not the nodejs version
|
how can we check that? |
Tried to amend my current github action setup script
with the following version
However, this didn't help |
Summary
SFDX Force package version create command doesn't return any output.
Steps To Reproduce:
Repository to reproduce: dreamhouse-lwc
NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.
Create github action yaml script to create package version like following:
echo "Creating new version without validation (skipping validation): sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json $branchSwitch"
echo "Running --json command:"
sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json $branchSwitch
echo "Running command without json:"
sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation $branchSwitch
echo "Running > create package version:"
echo $(sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json $branchSwitch) > createPackageVersion.txt
echo "Created package version JSON: $(cat createPackageVersion.txt)"
status=$(cat createPackageVersion.txt | jq '.status' -r )
echo "Status: $status"
message=$(jq '.warnings | join("\r\n")' -r createPackageVersion.txt)$(jq '.result.Error | join("\r\n")' -r createPackageVersion.txt)
echo "Message: $message"
Run manually the github action workflow to build a package version
Creating new version without validation (skipping validation): sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json -b test
Running --json command:
Running command without json:
Version create....
Version create.... ⣾
Version create.... ⣽
Version create.... ⣻
Version create.... ⢿
Version create.... ⡿
Version create.... ⣟
Version create.... ⣯
Version create.... ⣷
Version create.... ⣾
Version create.... ⣽
Version create.... ⣻
Version create.... ⢿
Version create.... done
Running > create package version:
Created package version JSON:
Status:
Message:
Expected result
Describe what should have happened.
I expect non-empty JSON result to be returned, similar to results when run on local machine, either failed one
{ "code": 1, "message": "No package ID was found in Dev Hub for package ID: 0Ho.", "name": "ErrorNoIdInHubError", "status": 1, "stack": "ErrorNoIdInHubError: No package ID was found in Dev Hub for package ID: 0Ho1n000000PAusCAG.
at Messages.createError", "exitCode": 1, "warnings": [] }
or successful
{ "status": 0, "result": { "Id": "08c5Y000000CdUiQAK", "Status": "Success", "Package2Id": "0Ho", "Package2VersionId": "05i", "SubscriberPackageVersionId": "04t", "Tag": null, "Branch": null, "Error": [], "CreatedDate": "2023-04-25 15:29", "HasMetadataRemoved": false, "CreatedBy": "0055Y00000Fse6NQAR" }, "warnings": [] }
Actual result
Describe what actually happened.
Empty json result is returned.
Creating new version without validation (skipping validation): sfdx package version create -d force-app --post-install-script PostInstall -x -w 60 --skip-validation --json -b test
Running --json command:
Running command without json:
Version create....
Version create.... ⣾
Version create.... ⣽
Version create.... ⣻
Version create.... ⢿
Version create.... ⡿
Version create.... ⣟
Version create.... ⣯
Version create.... ⣷
Version create.... ⣾
Version create.... ⣽
Version create.... ⣻
Version create.... ⢿
Version create.... done
Running > create package version:
Created package version JSON:
Status:
Message:
System Information
Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)
If you are using
sfdx
sfdx version --verbose --json
If you are using
sf
sf version --verbose --json
Paste the output here
Version of SFDX CLI is: sfdx-cli/7.197.8 linux-x64 node-v18.16.0
Additional information
Feel free to attach a screenshot.
The text was updated successfully, but these errors were encountered: