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

(7.163.0) sfdx force:source:deploy throwing UNKNOWN_EXCEPTION #1673

Closed
Renan-Mastropaolo opened this issue Aug 16, 2022 · 35 comments
Closed
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@Renan-Mastropaolo
Copy link

Summary

When trying to deploy our source metadata using sfdx force:source:deploy it throws UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1556838228-417394 (-1488516052).
Full command is sfdx force:source:deploy -p "/builds/services/dcms/financialforce/thunder/force-app/" -w 0 -u TARGET_ORG -l NoTestRun --json | ConvertFrom-Json
It is erroring in v7.164.1 as well.
No error on v7.162.0

Steps To Reproduce:

Run sfdx force:source:deploy -p "/builds/services/dcms/financialforce/thunder/force-app/" -w 0 -u TARGET_ORG -l NoTestRun --json | ConvertFrom-Json

Expected result

Create a deploy on TARGET_ORG

Actual result

No deploy created and sfdx command returns UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1556838228-417394 (-1488516052)

System Information

  • Tested on cmd and powershell on docker
    CMD:
    {
    "cliVersion": "sfdx-cli/7.162.0",
    "architecture": "win32-x64",
    "nodeVersion": "node-v16.17.0",
    "pluginVersions": [
    "@oclif/plugin-autocomplete 0.3.0 (core)",
    "@oclif/plugin-commands 1.3.0 (core)",
    "@oclif/plugin-help 3.3.1 (core)",
    "@oclif/plugin-not-found 1.2.6 (core)",
    "@oclif/plugin-plugins 1.10.11 (core)",
    "@oclif/plugin-update 1.5.0 (core)",
    "@oclif/plugin-warn-if-update-available 1.7.3 (core)",
    "@oclif/plugin-which 1.0.4 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.0 (core)",
    "alias 2.1.0 (core)",
    "apex 1.1.0 (core)",
    "auth 2.2.3 (core)",
    "community 2.0.0 (core)",
    "config 1.4.14 (core)",
    "custom-metadata 2.0.0 (core)",
    "data 2.1.1 (core)",
    "generator 2.0.2 (core)",
    "info 2.0.1 (core)",
    "limits 2.0.1 (core)",
    "org 2.0.7 (core)",
    "salesforce-alm 54.6.4 (core)",
    "schema 2.1.1 (core)",
    "sfdx-cli 7.162.0 (core)",
    "signups 1.2.0 (core)",
    "source 2.0.11 (core)",
    "telemetry 2.0.0 (core)",
    "templates 55.0.0 (core)",
    "trust 2.0.3 (core)",
    "user 2.1.0 (core)"
    ],
    "osVersion": "Windows_NT 10.0.19042"
    }

Docker:
{
"cliVersion": "sfdx-cli/7.160.0",
"architecture": "linux-x64",
"nodeVersion": "node-v14.20.0",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.3.1 (core)",
"@oclif/plugin-not-found 1.2.6 (core)",
"@oclif/plugin-plugins 1.10.11 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.3 (core)",
"@oclif/plugin-which 1.0.4 (core)",
"@salesforce/sfdx-plugin-lwc-test 1.0.0 (core)",
"alias 2.1.0 (core)",
"apex 1.1.0 (core)",
"auth 2.2.2 (core)",
"community 2.0.0 (core)",
"config 1.4.14 (core)",
"custom-metadata 2.0.0 (core)",
"data 2.0.4 (core)",
"generator 2.0.2 (core)",
"info 2.0.1 (core)",
"limits 2.0.1 (core)",
"org 2.0.3 (core)",
"salesforce-alm 54.6.2 (core)",
"schema 2.1.1 (core)",
"sfdx-cli 7.160.0 (core)",
"signups 1.2.0 (core)",
"source 2.0.7 (core)",
"telemetry 2.0.0 (core)",
"templates 55.0.0 (core)",
"trust 2.0.1 (core)",
"user 2.1.0 (core)"
],
"osVersion": "Linux 5.4.0-1085-azure"
}

Additional information

Feel free to attach a screenshot.

@Renan-Mastropaolo Renan-Mastropaolo added the investigating We're actively investigating this issue label Aug 16, 2022
@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.

@mdonnalley
Copy link
Contributor

@Renan-Mastropaolo are you able to provide a project that replicates the issue? Thanks!

@Renan-Mastropaolo
Copy link
Author

Hello @mdonnalley ,
Sorry but I can not provide you the project our company uses, it is private.
But I can perform tests myself and report you the results.
I will start by cleaning up the project and adding one metadata type at a time to see if I found anything, if you have any other test in mind please let me know so I try it as well.
Thanks.

@Renan-Mastropaolo
Copy link
Author

I have just found one thing, both my test were done using sfdx installed using npm install -g sfdx-cli@latest command. On my Windows machine, I uninstalled sfdx using npm uninstall -g sfdx-cli and installed using the EXE file on official website and it is now deploying with the same command, maybe it is something related to that?

@mdonnalley
Copy link
Contributor

@Renan-Mastropaolo Thanks for the update. You should be getting the same version regardless of if you're installing from npm or using the installer. The only difference between the two is that the installer has locked dependencies whereas the npm one doesn't.

I wonder if the issue would come back if you tried reinstalling with npm? If not, that would indicate that there was something off in your original npm installation

@Renan-Mastropaolo
Copy link
Author

I do not think that's the case, during my tests I've been uninstalling and reinstalling the same version and other versions multiple times with the same behavior all the time.
And on the docker side, every time we run a deploy a new docker instance is created, uninstalling and installing v7.163.0 version all the time.
Anyway, I will uninstall the standalone version and reinstall the npm one right now, just give me a sec.
Thanks

@Renan-Mastropaolo
Copy link
Author

@mdonnalley Same issue after uninstalling EXE version and installing npm again

@mdonnalley
Copy link
Contributor

@Renan-Mastropaolo thanks for testing that out for me. At this point I'll need to investigate that error id you provided in the original description to see if there are any clues there. I'll let you know if I learn anything

@Renan-Mastropaolo
Copy link
Author

Renan-Mastropaolo commented Aug 17, 2022 via email

@Renan-Mastropaolo
Copy link
Author

Hey @mdonnalley, On our docker image, I've uninstalled the npm version and used the one on this tutorial (https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_linux) using the .tar.xz file and it worked as well.
Looks like it is something related to the npm installation.

@LeoCordiuS
Copy link

LeoCordiuS commented Aug 19, 2022

Hello,

Had a similar issue one week ago and the same as @Renan-Mastropaolo after changing the CLI installation file from npm to tar file error has been solved.
But today, I am getting a similar UNKNOWN_ERROR issue with the npm and tar file both with the 7.164.2 version.
After downgrading to the 7.163.0 version everything works well.

I opened the case to Salesforce Support, they provided me the server log as below:
Thrown: java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
Date: Fri, 19 Aug 2022 01:39:19 +0000 (GMT)

And log message does not give me any insight or tips on how to solve the issue.
Maybe it's related to how CLI converts sources to metadata zip archive at force:source:deploy command.

@Renan-Mastropaolo
Copy link
Author

Hello everyone, confirmed on my side that 7.164.2 indeed cause the same error (UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1801400831-592134 (-1488516052)), with both npm and tar.xz/.exe versions.

@isaiassilva-osf
Copy link

isaiassilva-osf commented Aug 19, 2022

Hello, there is definitely something odd with 7.164.2, for a bit more input: we are using exclusively Github Actions, and our workflow didn't work with 7.164.2 either from npm or tar files. For now, we are sticking with 7.163.0 tar and it works fine.

*** Deploying with SOAP API v55.0 ***
ERROR running force:source:deploy:  UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1671461828-106631 (-1488516052)

@mdonnalley
Copy link
Contributor

@isaiassilva-osf @Renan-Mastropaolo @LeoCordiuS A couple of follow up questions:

  1. Can you try deploying with v7.164.1?
  2. Can you share the output of sfdx plugins:inspect @salesforce/plugin-source?

Thanks!

@Renan-Mastropaolo
Copy link
Author

@mdonnalley

  1. Tested on 7.164.1 and 7.164.0, both npm and .tar.xz failed to deploy with the same error message.
  2. 7.164.2 --> npm version
└─ @salesforce/plugin-source
   ├─ version 2.0.12
   ├─ homepage https://github.com/salesforcecli/plugin-source
   ├─ location C:\Users\Renan_Mastropaolo\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@salesforce\plugin-source
   ├─ commands
   │  ├─ force
   │  ├─ force:mdapi:convert
   │  ├─ force:mdapi:deploy
   │  ├─ force:mdapi:deploy:cancel
   │  ├─ force:mdapi:deploy:report
   │  ├─ force:mdapi:describemetadata
   │  ├─ force:mdapi:listmetadata
   │  ├─ force:mdapi:retrieve
   │  ├─ force:mdapi:retrieve:report
   │  ├─ force:source:convert
   │  ├─ force:source:delete
   │  ├─ force:source:deploy
   │  ├─ force:source:deploy:cancel
   │  ├─ force:source:deploy:report
   │  ├─ force:source:ignored:list
   │  ├─ force:source:manifest:create
   │  ├─ force:source:open
   │  ├─ force:source:pull
   │  ├─ force:source:push
   │  ├─ force:source:retrieve
   │  ├─ force:source:status
   │  ├─ force:source:tracking:clear
   │  └─ force:source:tracking:reset
   └─ dependencies
      ├─ @oclif/core ^1.9.5 => 1.13.10
      ├─ @oclif/plugin-help ^3.3.1 => 3.3.1
      ├─ @salesforce/apex-node ^1.0.0 => 1.1.0
      ├─ @salesforce/command ^5.2.1 => 5.2.4
      ├─ @salesforce/core ^3.21.5 => 3.26.2
      ├─ @salesforce/kit ^1.5.41 => 1.5.45
      ├─ @salesforce/source-deploy-retrieve ^6.2.6 => 6.3.0
      ├─ @salesforce/source-tracking ^2.1.2 => 2.2.2
      ├─ chalk ^4.1.2 => 4.1.2
      ├─ got ^11.8.3 => 11.8.5
      ├─ jsforce ^2.0.0-beta.16 => 2.0.0-beta.18
      ├─ open ^8.4.0 => 8.4.0
      ├─ proxy-agent ^5.0.0 => 5.0.0
      ├─ proxy-from-env ^1.1.0 => 1.1.0
      └─ tslib ^2 => 2.4.0

7.164.2 --> .tar.xz version

└─ @salesforce/plugin-source
   ├─ version 2.0.12
   ├─ homepage https://github.com/salesforcecli/plugin-source
   ├─ location /root/sfdx/node_modules/@salesforce/plugin-source
   ├─ commands
   │  ├─ force
   │  ├─ force:mdapi:convert
   │  ├─ force:mdapi:deploy
   │  ├─ force:mdapi:deploy:cancel
   │  ├─ force:mdapi:deploy:report
   │  ├─ force:mdapi:describemetadata
   │  ├─ force:mdapi:listmetadata
   │  ├─ force:mdapi:retrieve
   │  ├─ force:mdapi:retrieve:report
   │  ├─ force:source:convert
   │  ├─ force:source:delete
   │  ├─ force:source:deploy
   │  ├─ force:source:deploy:cancel
   │  ├─ force:source:deploy:report
   │  ├─ force:source:ignored:list
   │  ├─ force:source:manifest:create
   │  ├─ force:source:open
   │  ├─ force:source:pull
   │  ├─ force:source:push
   │  ├─ force:source:retrieve
   │  ├─ force:source:status
   │  ├─ force:source:tracking:clear
   │  └─ force:source:tracking:reset
   └─ dependencies
      ├─ @oclif/core ^1.9.5 => 1.13.10
      ├─ @oclif/plugin-help ^3.3.1 => 3.3.1
      ├─ @salesforce/apex-node ^1.0.0 => 1.1.0
      ├─ @salesforce/command ^5.2.1 => 5.2.4
      ├─ @salesforce/core ^3.21.5 => 3.26.2
      ├─ @salesforce/kit ^1.5.41 => 1.5.45
      ├─ @salesforce/source-deploy-retrieve ^6.2.6 => 6.3.0
      ├─ @salesforce/source-tracking ^2.1.2 => 2.2.2
      ├─ chalk ^4.1.2 => 4.1.2
      ├─ got ^11.8.3 => 11.8.5
      ├─ jsforce ^2.0.0-beta.16 => 2.0.0-beta.18
      ├─ open ^8.4.0 => 8.4.0
      ├─ proxy-agent ^5.0.0 => 5.0.0
      ├─ proxy-from-env ^1.1.0 => 1.1.0
      └─ tslib ^2 => 2.4.0

@mdonnalley mdonnalley added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Aug 19, 2022
@git2gus
Copy link

git2gus bot commented Aug 19, 2022

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

@rob-baillie-ortoo
Copy link

I am witnessing the same issue on multiple versions of the CLI:

Versions with error codes:

  • 7.163.0 - 1256550982-117127 (-1488516052)
  • 7.162.0 - 2063887122-299599 (-1488516052)
  • 7.159.0 - 1334184225-265985 (-1488516052)
  • 7.158.0 - 125231351-244937 (-1488516052)
  • 7.157.0 - 219879244-5650 (-1488516052)

@Renan-Mastropaolo
Copy link
Author

@rob-baillie-ortoo maybe if you install 7.163.0 with .tar.xz or .exe file this issue will not happen again.

@Renan-Mastropaolo
Copy link
Author

Same error with v7.165.0 installed thru .exe file
UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 256389163-55367 (-1488516052)

@Renan-Mastropaolo
Copy link
Author

@mdonnalley I just saw that I've never posted the full json response I got, with stack. Here you go (v7.165.0)
{
"status": 1,
"name": "sf:UNKNOWN_EXCEPTION",
"message": "UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 256389163-55367 (-1488516052)",
"exitCode": 1,
"context": "Deploy",
"stack": "sf:UNKNOWN_EXCEPTION: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 256389163-55367 (-1488516052)\n at Function.wrap (C:\Users\Renan_Mastropaolo\AppData\Local\sfdx\client\7.165.0-65b4bb0\node_modules\@salesforce\core\lib\sfError.js:61:25)\n at Deploy.catch (C:\Users\Renan_Mastropaolo\AppData\Local\sfdx\client\7.165.0-65b4bb0\node_modules\@salesforce\command\lib\sfdxCommand.js:267:38)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Deploy._run (C:\Users\Renan_Mastropaolo\AppData\Local\sfdx\client\7.165.0-65b4bb0\node_modules\@salesforce\command\lib\sfdxCommand.js:93:13)\n at async Config.runCommand (C:\Users\Renan_Mastropaolo\AppData\Local\sfdx\client\7.165.0-65b4bb0\node_modules\@oclif\core\lib\config\config.js:272:25)\n at async run (C:\Users\Renan_Mastropaolo\AppData\Local\sfdx\client\7.165.0-65b4bb0\node_modules\@oclif\core\lib\main.js:76:5)",
"warnings": [],
"commandName": "Deploy"
}

@vaibhavdangar-woolies
Copy link

a.) Issue seen in sfdx-cli/7.165.0 linux-x64 node-v16.13.2

ERROR running force:source:deploy: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 363786184-312086 (-1488516052)

b.) Works fine with sfdx-cli/7.159.0 linux-x64 node-v16.13.2

@iowillhoit
Copy link
Contributor

Hello all, just wanted to follow up to let you know that we've got a ticket created and will be looking into this soon. Feel free to post any additional details you come across. Thanks!

@rob-baillie-ortoo
Copy link

@Renan-Mastropaolo - Have witnessed it when downloading 7.165.0 as a tar.xz

Have also seen it on:

  • Windows Server 2022
  • Ubuntu 22.04
  • Ubuntu 20.04
  • macOS Monterey 12

Have also seen it when performing both a push and a deploy.

@iowillhoit - thanks for taking a look

@rob-baillie-ortoo
Copy link

rob-baillie-ortoo commented Aug 30, 2022

It looks like this GACK is reproducable with a .bin extension static resource of zero size and the following meta file:

<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
    <cacheControl>Public</cacheControl>
    <contentType>application/octet-stream</contentType>
</StaticResource>

@rob-baillie-ortoo
Copy link

Issue can be replicated with the attached project. See the README for details

gack-replication.zip

@RodEsp
Copy link
Contributor

RodEsp commented Sep 9, 2022

Hey @rob-baillie-ortoo, thanks for that .zip, I was able to replicate the issue with it!

As you mentioned the crux of the issue seems to revolve around the pleasewait.bin in that .zip which is just an empty file. But if you add any content to it at all, like just the letter a or a random string, then the deploy proceeds without throwing a GACK.

Is anybody in this thread that's encountering this issue purposefully trying to deploy an empty file with their metadata?

If not, could you please try the following?

  1. Set the SFDX_MDAPI_TEMP_DIR env var to a valid directory
  2. Run the deploy again
  3. Compare the metadata files in your project to the ones in the SFDX_MDAPI_TEMP_DIR dir
  4. Post here with your results
    1. I'm particularly interested to see if any files show up as size 0 in the SFDX_MDAPI_TEMP_DIR that weren't size 0 in your project dir.

I'm wondering if for some reason the CLI is accidentally deleting file contents when zipping them up for some metadata types. I haven't been able to find any instances of that happening in my testing so far though.

@rob-baillie-ortoo
Copy link

We were purposefully deploying an empty file since we're in ISV using 1st generation packaging and cannot delete a defunct static resource - the ideal is that any deprecated binary files are empty. We have had to work around by putting contents into the file, which we would prefer not to have to do.

@rob-baillie-ortoo
Copy link

I have also now witnessed the problem with an empty css file in an LWC bundle

@Renan-Mastropaolo
Copy link
Author

I had one empty file on staticResources, after I deleted that file the error is fixed. Thank you for the workaround.

@RodEsp
Copy link
Contributor

RodEsp commented Sep 12, 2022

Thanks for the extra context @rob-baillie-ortoo, I don't want you to have to put meaningless content in your files either but I'm not sure why these deploys work with versions lower than 7.163.0 of the CLI but not with newer versions.

I'll dig into that a little more but if I were to hazard a guess I'd say maybe earlier versions of the CLI didn't bundle empty files into the .zip sent to the org. Would that be acceptable for your use case?

@Renan-Mastropaolo
Copy link
Author

From my side we expect to be able to deploy staticResources, or other metadata types, with empty content. We do it currently on our Production ORG.

@RodEsp
Copy link
Contributor

RodEsp commented Sep 13, 2022

Hey everyone, with the above PR this should be fixed. It will come out with the next sfdx version which should be 7.169.0 and will have a release candidate made available on Thursday.

@RodEsp
Copy link
Contributor

RodEsp commented Sep 16, 2022

The fix is out now in the stable-rc channel for the installers or latest-rc tag for npm installs.
• Update with npm: npm install -g sfdx-cli@latest-rc
• Update with Installer: sfdx update stable-rc (run sfdx update stable to rollback)

@RodEsp RodEsp closed this as completed Sep 16, 2022
@RodEsp
Copy link
Contributor

RodEsp commented Sep 20, 2022

Hi everyone, just a quick update.

My apologies but there was an issue with our release last Thursday and the fix didn't actually go out with version 7.169.0 like we had thought.

We just released a new release candidate, version 7.169.1, that I have confirmed has the fix. As usual, you can update your CLI like so:
• Update with npm: npm install -g sfdx-cli@latest-rc
• Update with Installer: sfdx update stable-rc (run sfdx update stable to rollback)

@rob-baillie-ortoo
Copy link

Appears fixed for me.

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
Projects
None yet
Development

No branches or pull requests

8 participants