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 Project Deploy Resume returns - No job found for Id: 0Af68... #2498

Closed
divinedragon opened this issue Sep 29, 2023 · 7 comments
Closed

SF Project Deploy Resume returns - No job found for Id: 0Af68... #2498

divinedragon opened this issue Sep 29, 2023 · 7 comments
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@divinedragon
Copy link

divinedragon commented Sep 29, 2023

Summary

I am trying to setup our CI/CD Pipeline to use the latest sf commands. We plan to have 3 steps in our pipeline.

  1. Step 1 - Login, Trigger deployment with sf project deploy validate --async
  2. Step 2 - Put the pipeline to sleep for 15 mins (our entire Test suite takes about 17 minutes to run)
  3. Step 3 - Login again and resume using sf project deploy resume --job-id

It is at this Step 3 where, when we are trying to resume with the validation, the command returns No job found for ID: 0Af68...

Steps To Reproduce

Commands as part of Step 1

# Login using Access Token
sf org login access-token --instance-url https://<<INSTANCE_NAME>>.my.salesforce.com --no-prompt --set-default
...
# Run the Deploy Validate in Async Mode
sf project deploy validate --async --source-dir $DEPLOY_DIR
...
# Save the Deployment ID in a file which can be used in Step 3
echo "$DEPLOYMENT_ID" > SF_DEPLOY_ID

Commands as part of Step 3

# Login using Access Token
sf org login access-token --instance-url https://<<INSTANCE_NAME>>.my.salesforce.com --no-prompt --set-default
...
# Get the Deployment Id from the File that was created in Step 1
SF_DEPLOY_ID=$(cat SF_DEPLOY_ID)
...
# Resume the Deploy Validate
sf project deploy resume --job-id "$SF_DEPLOY_ID" --results-dir deploy-results --junit --coverage-formatters text

Error (1): No job found for ID: 0Af6800XXXXX.

Expected result

Expecting the sf project deploy resume to locate the job and continue.

Actual result

Command returns Job not found

System Information

Terminal - Bash
System - Ubuntu

{

  "cliVersion": "@salesforce/cli/2.10.2",
  "architecture": "linux-x64",
  "nodeVersion": "node-v18.17.1",
  "osVersion": "Linux 5.15.0-1045-aws",
  "shell": "bash",
  "rootPath": "/usr/lib/node_modules/@salesforce/cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.8 (core)",
    "@oclif/plugin-commands 2.2.25 (core)",
    "@oclif/plugin-help 5.2.19 (core)",
    "@oclif/plugin-not-found 2.4.1 (core)",
    "@oclif/plugin-plugins 3.7.1 (core)",
    "@oclif/plugin-search 0.0.22 (core)",
    "@oclif/plugin-update 3.2.3 (core)",
    "@oclif/plugin-version 1.3.10 (core)",
    "@oclif/plugin-warn-if-update-available 2.1.0 (core)",
    "@oclif/plugin-which 2.2.32 (core)",
    "@salesforce/cli 2.10.2 (core)",
    "apex 2.3.15 (core)",
    "auth 2.8.17 (core)",
    "data 2.5.9 (core)",
    "deploy-retrieve 1.18.0 (core)",
    "info 2.6.43 (core)",
    "limits 2.3.34 (core)",
    "login 1.2.31 (core)",
    "marketplace 0.2.2 (core)",
    "org 2.10.8 (core)",
    "schema 2.3.26 (core)",
    "settings 1.4.29 (core)",
    "sobject 0.2.7 (core)",
    "source 2.10.34 (core)",
    "telemetry 2.3.3 (core)",
    "templates 55.5.12 (core)",
    "trust 2.6.13 (core)",
    "user 2.3.32 (core)"
  ]
}

Additional information

Node Version - node --version

v18.17.1

Salesforce CLI version - sf version

@salesforce/cli/2.10.2 linux-x64 node-v18.17.1

Result for sf org login access-token

Successfully authorized dshakya@XXXXXXXXX with org ID 00DXXXXXXXXXX

Result for sf org list

    Type   Alias Username                  Org ID             Status    Expires 

 ── ────── ───── ───────────────────────── ────────────────── ───────── ─────── 
 🍁 DevHub       dshakya@XXXXXXXX 00DXXXXXXXX Connected         

Legend:  🌳=Default DevHub, 🍁=Default Org      Use --all to see expired and deleted scratch orgs

Result for sf doctor

=== Running all diagnostics

pass - salesforcedx plugin not installed
pass - no linked plugins
pass - [@salesforce/plugin-source] sourceApiVersion matches apiVersion
warn - [@salesforce/plugin-source] sourceApiVersion matches default target org max apiVersion
pass - using latest or latest-rc CLI version

Wrote doctor diagnosis to: 1696004692204-diagnosis.json

=== Suggestions

  * Check https://github.com/forcedotcom/cli/issues for CLI issues posted by the community.
  * Check http://status.salesforce.com/ for general Salesforce availability and performance.
  * The sourceApiVersion in sfdx-project.json doesn't match the max apiVersion of the default target org. As a result, you're not using the latest features available in API version 58.0. The version mismatch isn't a problem, as long as it's the behavior you actually want.

Job Response from Rest API - /metadata/deployRequest/0Af68XXXXX

image

@divinedragon divinedragon added the investigating We're actively investigating this issue label Sep 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 github-actions bot added the validated Version information for this issue has been validated label Sep 29, 2023
@mdonnalley
Copy link
Contributor

@divinedragon We recently made some changes to support "nomadic deploys" (e.g validate deploy on one machine, resume on another - see discussion).

Can you try v2.11.8 to see if that resolves your issue? Thanks!

@divinedragon
Copy link
Author

I am trying to update the sf version using sf update --version 2.12.2, but it doesn't work.

-> sf update --version 2.12.2
@salesforce/cli: Updating CLI...
@salesforce/cli: Updating CLI... not updatable

Am I missing anything?

@divinedragon
Copy link
Author

As mentioned by @mnunezdm in the comment, Caching and Restoring the ~/.sf folder can be used as a workaround.

@mnunezdm
Copy link

mnunezdm commented Oct 2, 2023

@divinedragon you need to update to latest release candidate with sf update stable-rc after that --wait and --target-org becomes available in sf project deploy report

@mdonnalley
Copy link
Contributor

@divinedragon @salesforce/cli: Updating CLI... not updatable indicates that you installed the cli via npm, which means sf update won't work. For npm, you need to run npm install --global @salesforce/[email protected]

@divinedragon
Copy link
Author

Since saving the cache folder (~/.sf) works for us currently, we will wait for the support for nomadic deployments to be available in the stable channel.

We can close this issue.

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

3 participants