forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
488 stars 78 forks source link

salesforce/salesforcedx:Latest can not be found. Gitlab pipeline deployment is failing #1136

Closed mahbouf closed 3 years ago

mahbouf commented 3 years ago

Summary

salesforce/salesforcedx:Latest can not be found. Gitlab pipeline deployment is failing

in our gitlab yml file we have specified salesforce/salesforcedx which should look for the latest tag. That has been working for a long time and it stopped working on Thursday Aug 12 . We tried to update the sfdx and also force the tag version in the yml file (tried all the followings ) but we recieve an error that Org can not be found .

docker pull salesforce/salesforcedx:7.113.1-full

docker pull salesforce/salesforcedx:latest-rc-full

docker pull salesforce/salesforcedx:7.113.0-full docker pull salesforce/salesforcedx:latest-full

Error : Successfully authorized $ cd dx/crm $ sfdx force:source:deploy -p force-app/main/default --targetusername $SF_CRMDEV_USERNAME --testlevel $SF_CRMDEV_TEST ERROR running force:source:deploy: The org cannot be found Try this: Verify that the org still exists If your org is newly created, wait a minute and run your command again If you deployed or updated the org's My Domain, logout from the CLI and authenticate again If you are running in a CI environment with a DNS that blocks external IPs, try setting SFDX_DISABLE_DNS_CHECK=true Running after_script

As a workaround I am forcing the version 7.81.0-full and deployment goes through .

we should not specify the Tag name in the command as this will be a manual work everytime there will be a updated version . Latest should always point to latest version and deployment shouldn't fails

Also why the old version 8.81.0 works and any latest version give us an error "org can not be found "

SFDX CLI Version:

We have updated it to the latest version 7.113.0

OS and version:

AndrewRayCode commented 3 years ago

cc @cristiand391 @WillieRuemmele looks like more docker issues

See related https://github.com/forcedotcom/cli/issues/1123

PalGenadich commented 3 years ago

Encountered the same issue. Suddenly following Gitlab Pipelines config started failing: image: salesforce/salesforcedx

After checking here https://hub.docker.com/r/salesforce/salesforcedx/tags I noticed there are two tags now:

So I just updated my pipeline config to use the latest-slim and it works. image: salesforce/salesforcedx:latest-slim

mahbouf commented 3 years ago

Thank you for the reply. I did try "latest-full" I get this error " org not found Error" .

Due to: Validation errors: should have required property 'packageDirectories' 2021-08-17T15:03:47.236Z sfdx:SchemaValidator DEBUG Schema loaded for /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/schemas/sfdx-project.schema.json ERROR running force:source:deploy: The org cannot be found Try this: Verify that the org still exists If your org is newly created, wait a minute and run your command again If you deployed or updated the org's My Domain, logout from the CLI and authenticate again If you are running in a CI environment with a DNS that blocks external IPs, try setting SFDX_DISABLE_DNS_CHECK=true Internal Diagnostic Domain Not Found: The org cannot be found at Connection.isResolvable (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:276:19) at async Connection.retrieveMaxApiVersion (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:237:9) at async Connection.useLatestApiVersion (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:248:32) at async useLatest (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:406:13) at async Connection.loadInstanceApiVersion (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:428:13) at async Function.create (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:88:39) at async Org.init (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/org.js:401:31) at async Function.create (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/kit/lib/creatable.js:31:9) at async SourceDeployCommand.assignOrg (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:109:24) at async SourceDeployCommand.init (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:231:13) at async SourceDeployCommand._run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:80:13) at async Config.runCommand (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js:173:24) at async SfdxMain.run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/main.js:27:9) at async SfdxMain._run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js:43:20) at async Object.run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/dist/cli.js:162:47)


2021-08-17T15:03:47.251Z sfdx:SourceDeployCommand ERROR [ 'ERROR running force:source:deploy: ', 'The org cannot be found', '\n\nTry this:', '\nVerify that the org still exists', '\nIf your org is newly created, wait a minute and run your command again', '\n' + "If you deployed or updated the org's My Domain, logout from the CLI and authenticate again", '\n' + 'If you are running in a CI environment with a DNS that blocks external IPs, try setting SFDX_DISABLE_DNS_CHECK=true', '\n' + ' Internal Diagnostic \n' + '\n' + 'Domain Not Found: The org cannot be found\n' + ' at Connection.isResolvable (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:276:19)\n' + ' at async Connection.retrieveMaxApiVersion (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:237:9)\n' + ' at async Connection.useLatestApiVersion (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:248:32)\n' + ' at async useLatest (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:406:13)\n' + ' at async Connection.loadInstanceApiVersion (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:428:13)\n' + ' at async Function.create (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/connection.js:88:39)\n' + ' at async Org.init (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/core/lib/org.js:401:31)\n' + ' at async Function.create (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@salesforce/kit/lib/creatable.js:31:9)\n' + ' at async SourceDeployCommand.assignOrg (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:109:24)\n' + ' at async SourceDeployCommand.init (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:231:13)\n' + ' at async SourceDeployCommand._run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:80:13)\n' + ' at async Config.runCommand (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js:173:24)\n' + ' at async SfdxMain.run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/main.js:27:9)\n' + ' at async SfdxMain._run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js:43:20)\n' + ' at async Object.run (/usr/local/lib/nodejs/lib/node_modules/sfdx-cli/dist/cli.js:162:47)\n' + '**\n' ]

PalGenadich commented 3 years ago

Our team also started getting the "The org cannot be found" error. Usually re-running the pipeline fixes it for us. For now I switched our piplenes to use the previous version of docker image: image: salesforce/salesforcedx:7.111.6-full

Seems to work with no errors so far. Still monitoring. Also "The org cannot be found" error is mentioned here https://github.com/forcedotcom/cli/issues/820 Hope this helps.

cristiand391 commented 3 years ago

@mahbouf @PalGenadich We only provide 2 docker images (slim and full), we have stopped publishing latest images some months ago but it seems they weren't removed from dockerhub until last release, that's why you all get the error: manifest for salesforce/salesforcedx:latest not found: manifest.

We have confirmed that the latest tag that was available was published by our team, but since we stopped publishing it some months ago it's possible that it was using an outdated version of sfdx.

If you want to always use the latest version of sfdx you can use either latest-slim or latest-full (if you don't need node or jq, latest-slim is the recommended image since it only install sfdx from the linux tarball instead of an npm installation).

Regarding other errors when using latest-slim/full images, I will see if I can to reproduce them but I suspect these are caused by latest versions of sfdx.

mahbouf commented 3 years ago

Thanks for the reply! As I stated in my previous messages I receive an error using latest-full or any other latest tag versions (I tried 4/5 different ones ) . we need to know why do we get an error and deployment failure using latest-full and how to fix it . The only version which finally worked was 7.81.0-full which is an OLD version .

Thanks