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

mdapi deploy report timeout error for in progress deployments #1612

Closed
t-zakar opened this issue Jul 7, 2022 · 16 comments
Closed

mdapi deploy report timeout error for in progress deployments #1612

t-zakar opened this issue Jul 7, 2022 · 16 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@t-zakar
Copy link

t-zakar commented Jul 7, 2022

Summary

Since the sfdx v7.150.0, the sfdx force:mdapi:deploy:report --wait 1 command are failing with an error message when I use to query status of an in progress deployment.
'MetadataTransfer:Metadata API request failed: The client has timed out.'
The sfdx force:mdapi:legacy:deploy:report command is still working but it is deprecated and will be removed.

Steps To Reproduce:

  1. Start a deploy which is running long time (we have 2000 tests, running ~3 hours):
    $deployJob = sfdx force:mdapi:deploy --deploydir ./deploydir --ignorewarnings -w 0 --testlevel RunLocalTests -u $deployUser --json | ConvertFrom-Json
  2. Query the status of the deployment:
    $report = sfdx force:mdapi:deploy:report -i $deployJobId --wait 1 -u $deployUser --json 2>&1 | ConvertFrom-Json
    (We are using this from Azure pipeline)

Expected result

status in json format

Actual result

MetadataTransfer:Metadata API request failed: The client has timed out.

System Information

PS > sfdx version --verbose --json
{
"cliVersion": "sfdx-cli/7.158.1",
"architecture": "win32-x64",
"nodeVersion": "node-v16.15.1",
"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 0.13.0 (core)",
"auth 2.2.2 (core)",
"community 2.0.0 (core)",
"config 1.4.12 (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.1 (core)",
"salesforce-alm 54.6.2 (core)",
"schema 2.1.1 (core)",
"sfdx-cli 7.158.1 (core)",
"sfdx-git-delta 5.3.0",
"signups 1.2.0 (core)",
"source 2.0.3 (core)",
"telemetry 2.0.0 (core)",
"templates 55.0.0 (core)",
"trust 2.0.1 (core)",
"user 2.1.0 (core)"
],
"osVersion": "Windows_NT 10.0.19044"
}

Additional information

But it does not matter from where you start the deploy, when you use the 'sfdx force:mdapi:deploy:report -i $deployJobId --wait 1 -u $deployUser --json' on a deploy in progress, it returns 'MetadataTransfer:Metadata API request failed: The client has timed out.' error.
When you use this on a deployment is already finished or cancelled, it is working as expected.
Before the sfdx version 7.150.0 it was working, and the force:mdapi:legacy:deploy:report command still working.

Please fix it before removing the force:mdapi:legacy:deploy:report command.

@t-zakar t-zakar added the investigating We're actively investigating this issue label Jul 7, 2022
@github-actions
Copy link

github-actions bot commented Jul 7, 2022

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.

@maggiben
Copy link
Contributor

maggiben commented Jul 8, 2022

Hello, is this happen frequently, can it be attributed to network issues ?

@maggiben maggiben added the more information required Issue requires more information or a response from the customer label Jul 8, 2022
@t-zakar
Copy link
Author

t-zakar commented Jul 8, 2022

Hi, no, it is happening always.. and the force:mdapi:legacy:deploy:report is working always

@mshanemc
Copy link
Contributor

has the deployment completed when you run sfdx force:mdapi:deploy:report --wait 1 ? Or is it still pending/in progress? (you can check Deployment Status in an org's UI to see).

If yes, what happens if you put it to a larger number than 1, like (--wait 10)? Does it still fail?

@t-zakar
Copy link
Author

t-zakar commented Jul 14, 2022

If the deploy is in progress I get this error, even with --wait 10. If the deploy is completed it is working fine.
I use this command to monitoring a deploy from a powershell script in Azure pipeline and it had worked before the sfdx version 7.150.0.

@mshanemc
Copy link
Contributor

one more question: does the same happen if you use force:source:deploy:report with the same jobid on an in progress job ? If so, I'll make sure that gets fixed there, too.

@mshanemc mshanemc added bug Issue or pull request that identifies or fixes a bug and removed more information required Issue requires more information or a response from the customer investigating We're actively investigating this issue labels Jul 14, 2022
@git2gus
Copy link

git2gus bot commented Jul 14, 2022

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

@t-zakar
Copy link
Author

t-zakar commented Jul 15, 2022

one more question: does the same happen if you use force:source:deploy:report with the same jobid on an in progress job ? If so, I'll make sure that gets fixed there, too.

I don't know, we don't use that command.

@mshanemc
Copy link
Contributor

it's good, we'll fix them both to handle this timeout thing

@shetzel
Copy link
Contributor

shetzel commented Jul 15, 2022

@t-zakar - note that by providing -w 1 to the report command you are polling for the deploy status for a minute (which is how the client timeout error comes back). If you want an immediate response you could either leave off the wait param or specify -w 0 (which is the default when omitted). Not sure if this fits with what your script does but thought I'd mention it in case it does.

Regardless, it doesn't match the behavior of the legacy command so it'll be fixed.

@RohitGagan16
Copy link

I am also facing the same issue and i am using the version sfdx-cli/7.160.0
Waiting for the upcoming fix

@RohitGagan16
Copy link

RohitGagan16 commented Jul 28, 2022 via email

@RohitGagan16
Copy link

@mshanemc Could you please confirm if this is fixed in July 28 th rc release

@peternhale
Copy link
Contributor

@RohitGagan16 it is not is the 7/28 release.

@RohitGagan16
Copy link

RohitGagan16 commented Jul 28, 2022 via email

@t-zakar
Copy link
Author

t-zakar commented Aug 5, 2022

I have just tried the version 7.162.0, it is working fine, thanks.

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

6 participants