I setup CI/CD in a project using the customer BitBucket + Bamboo server instances.
I'm able to authorize to Salesforce org using the following command:
node_modules/sfdx-cli/bin/run.sh force:auth:sfdxurl:store -f loginkey.txt -s
When I try to deploy to the sandbox with the following command:
sfdx force:source:deploy -p force-app/main/default --testlevel RunLocalTests
I get this error:
26-Jan-2021 12:31:00 | ERROR running force:source:deploy:Β The org cannot be found
-- | --
26-Jan-2021 12:31:00 | Β
26-Jan-2021 12:31:00 | Try this:
26-Jan-2021 12:31:00 | Verify that the org still exists
26-Jan-2021 12:31:00 | If your org is newly created, wait a minute and run your command again
26-Jan-2021 12:31:00 | If you deployed or updated the org's My Domain, logout from the CLI and authenticate again
Deployment should be requested to the sandbox
Deployment is not started cause of the problem "ERROR running force:source:deploy:Β The org cannot be found"
I'm behind a proxy and I configured it as per the doc, placing the following lines:
export HTTP_PROXY=http://${bamboo.PROXY_USERNAME1}:${bamboo.PROXY_PASSWORD1}@${bamboo.PROXY_HOST1}:3128
export HTTPS_PROXY=http://${bamboo.PROXY_USERNAME1}:${bamboo.PROXY_PASSWORD1}@${bamboo.PROXY_HOST1}:3128
Everything worked until last week so we think it might be some change in the Bamboo version but the customer infrastructure provider said nothing had changed in the Bamboo configuration so we are trying to investigate where the problem could be.
The strange behaviour is that login is always successful, but the deployment is not.
Login and deployment commands are written in consecutive lines so it cannot be a problem in environment variables or scope.
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.
What version of the cli are you using? Do the commands pass when you run them locally (not in CI)? Is the org present when running sfdx force:org:list and subsequently sfdx force:org:display -u <org username>
Hi all,
we encounter the same issue. It seems to be a problem on Linux (CentOS).
The problem is, that the cli is not able to resolve hostname after successfull loging.
The alias json was updated and the json file with connection information get created successfully.
But when executing force:org:display or force:source:deploy the error message "The org cannot be found" occur.
The error is independent from the version. We try 7.63.0, 7.80.0 and 7.820 (NPM Versions)
Within the sfdxlog we see the following error message :
27-Jan-2021 08:34:34 {"name":"sfdx","hostname":"bamboo-agent-yellow-3.novalocal","pid":21327,"log":"MyDomainResolver","level":20,"msg":"Attempting to resolve url: MYDOMAIN.my.salesforce.com","time":"2021-01-27T07:34:24.430Z","v":0}
27-Jan-2021 08:34:34 {"name":"sfdx","hostname":"bamboo-agent-yellow-3.novalocal","pid":21327,"log":"MyDomainResolver","level":20,"msg":"An error occurred trying to resolve: MYDOMAIN.my.salesforce.com","time":"2021-01-27T07:34:24.432Z","v":0}
27-Jan-2021 08:34:34 {"name":"sfdx","hostname":"bamboo-agent-yellow-3.novalocal","pid":21327,"log":"MyDomainResolver","level":20,"msg":"Error: getaddrinfo ENOTFOUND MYDOMAIN.my.salesforce.com","time":"2021-01-27T07:34:24.432Z","v":0}
27-Jan-2021 08:34:34 {"name":"sfdx","hostname":"bamboo-agent-yellow-3.novalocal","pid":21327,"log":"MyDomainResolver","level":20,"msg":"Re-trying dns lookup again....","time":"2021-01-27T07:34:24.432Z","v":0}
27-Jan-2021 08:34:34 {"name":"sfdx","hostname":"bamboo-agent-yellow-3.novalocal","pid":21327,"log":"PollingClient","level":20,"msg":"Polling timed out","time":"2021-01-27T07:34:34.434Z","v":0}
The problem maybe that https:// is removed from login URL?!
Thanks in advance for your support
Hello @WillieRuemmele ,
I am replying for @lorebarba
The CLI version we are using is 7.82.1-0 but we tried older versions as well with no success. The commands run successfully locally(we don't use a proxy when deploying locally though).
Bellow you can see the output for each command you requested.
node_modules/sfdx-cli/bin/run.sh force:auth:sfdxurl:store -f loginkey.txt -s
Successfully authorized [email protected] with org ID 00D1w0000008iXmEAI
sfdx force:org:list
build 27-Jan-2021 08:50:13 === Orgs
build 27-Jan-2021 08:50:13 ALIAS USERNAME ORG ID CONNECTED STATUS
build 27-Jan-2021 08:50:13 βββββββββ βββββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββ
build 27-Jan-2021 08:50:13 targetorg [email protected] 00D1w0000008iXmEAI Unknown
build 27-Jan-2021 08:50:13
build 27-Jan-2021 08:50:13 No active scratch orgs found. Specify --all to see all scratch orgs
sfdx force:org:display -u targetorg
error 27-Jan-2021 08:50:24 ERROR running force:org:display: The org cannot be found
error 27-Jan-2021 08:50:24
error 27-Jan-2021 08:50:24 Try this:
error 27-Jan-2021 08:50:24 Verify that the org still exists
error 27-Jan-2021 08:50:24 If your org is newly created, wait a minute and run your command again
error 27-Jan-2021 08:50:24 If you deployed or updated the org's My Domain, logout from the CLI and authenticate again
Also, I can see the same error message regarding MyDomainResolver as above in the sfdxlog.
Thank you.
Hello All,
Please update your CLI version
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
I have got the same error on version
[email protected]
RightNow I have to use
sfdx-cli/7.83.0-eba9c6a927 darwin-x64 node-v12.18.3
Thank you.
Hi,
unfortunately upgrading to sfdx-cli/7.83.0 linux-x64 node-v14.15.1 didn't fix the issue for us.
Thanks you for the feedback!
Hi all,
same here, version 7.83.0 didn't solve the problem for me.
Tried other version like 7.86.3 but same result.
Regards
Any update?
Just a βwe are working on itβ would be enough.
or should we create a case at salesforce?
thanks in advance
Can you run this command on your terminal
sudo npm install [email protected] --global
Hi @lordmarshal @stnarlis2 @chetu-mirdul sorry for the silence, yes, we are working on this. I think it will be available next week on the latest-rc tag of the cli. I'll update here when/where it's available
Hi @chetu-mirdul ,
build jobs are not allowed to run in admin mode and install global content.
One build-server handles jobs for multiple projects and to avoid misconfiguration this is disabled.
Therefore we choose npm, because installation without admin rights are possible.
Everything works fine until about January 20th.
@WillieRuemmele Thank you very much for the feedback.
If you need further information to solve the problem, please do not hesitate to contact me.
we look really forward for the new version
Kind regards
Hi @lordmarshal @stnarlis2 @chetu-mirdul could you try running this with the latest-rc build of the cli, you can install it with npm install sfdx-cli@latest-rc --global and uninstall it with npm uninstall sfdx-cli@latest-rc --global
Hi @WillieRuemmele,
Unfortunately, the latest-rc build (7.87.0) gives us exactly the same "org not found" error. Also, I can still see in the logs the same MyDomainResolver error.
Hi Willie,
nothing changed, same error occured.
I also try to set the new Parameter SFDX_DNS_TIMEOUT to 60 but no difference.
I will check internally if something changed on NPM.
Is there a difference if I install it globally?
Kind regards
@stnarlis2 @lordmarshal
Can you verify that the domain is accessible behind your proxy? Assuming you know the domain ahead of time, you can add this to script:
curl -Is <domain> || echo 'NOT FOUND'
If you don't know what the domain will be you can do this assuming you have jq installed in the build:
curl -Is $(jq -r '.instanceUrl' ~/.sfdx/<username>.json) || echo 'NOT FOUND'
If you are able to access the domain you will see something like this and we'll have to continue working out what the issue might be.
HTTP/1.1 200 OK
X-Cnection: close
Date: Thu, 11 Feb 2021 18:30:06 GMT
Strict-Transport-Security: max-age=31536002; includeSubDomains
Expect-CT: max-age=86400, report-uri="https://a.forcesslreports.com/Expect-CT-report/00DB0000000Ih65m"
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Robots-Tag: none
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
Set-Cookie: BrowserId=KekCyWyXEeumNanCSnTRVQ; domain=.salesforce.com; path=/; expires=Fri, 11-Feb-2022 18:30:06 GMT; Max-Age=31536000
Content-Type: text/html; charset=UTF-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-FRAME-OPTIONS: DENY
Otherwise, you will see NOT FOUND and we can assume that the issue is with your proxy configuration
Let me know what you learn
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.
@stnarlis2 @lordmarshal can you also let me know what version of the CLI you're currently running? I'm most interested in knowing which version of node is being used
This is a challenge to repro (centos, bamboo, proxy, etc). Here's a few troubleshooting ideas in addition to what Mike suggested
I'm able to authorize to Salesforce org using the following command:
node_modules/sfdx-cli/bin/run.sh force:auth:sfdxurl:store -f loginkey.txt -s
When I try to deploy to the sandbox with the following command:
sfdx force:source:deploy -p force-app/main/default --testlevel RunLocalTests
can you try running both commands using the node_modules/sfdx-cli/bin/run.sh and both using the sfdx force: approach to see if anything changes?
force:org commands. The problem maybe that https:// is removed from login URL?!
That's definitely not it. The node dns lookup wants just the hostname https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback
Hello everyone and thank you!
@mdonnalley
Can you verify that the domain is accessible behind your proxy? Assuming you know the domain ahead of time, you can add this to script:
export http_proxy=http://${bamboo.PROXY_USERNAME1}:${bamboo.PROXY_PASSWORD1}@${bamboo.PROXY_HOST1}:3128
export https_proxy=http://${bamboo.PROXY_USERNAME1}:${bamboo.PROXY_PASSWORD1}@${bamboo.PROXY_HOST1}:3128
curl -Is $(jq -r '.instanceUrl' ~/.sfdx/<username>.json) || echo "NOT FOUND"
The above commands give me as output
12-Feb-2021 09:48:31 | HTTP/1.1 200 Connection established
12-Feb-2021 09:48:31 | HTTP/1.1 200 OK
12-Feb-2021 09:48:31 | X-Cnection: close
12-Feb-2021 09:48:31 | Date: Fri, 12 Feb 2021 08:48:31 GMT
12-Feb-2021 09:48:31 | Strict-Transport-Security: max-age=31536002; includeSubDomains
12-Feb-2021 09:48:31 | Expect-CT: max-age=86400, report-uri="https://a.forcesslreports.com/Expect-CT-report/00D1w0000008iXmm"
12-Feb-2021 09:48:31 | X-Content-Type-Options: nosniff
12-Feb-2021 09:48:31 | X-XSS-Protection: 1; mode=block
12-Feb-2021 09:48:31 | Content-Security-Policy: upgrade-insecure-requests
12-Feb-2021 09:48:31 | X-Robots-Tag: none
12-Feb-2021 09:48:31 | Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
12-Feb-2021 09:48:31 | Set-Cookie: BrowserId=FTohHG0PEeuyr2OeFOeaQw; domain=.salesforce.com; path=/; expires=Sat, 12-Feb-2022 08:48:31 GMT; Max-Age=31536000
12-Feb-2021 09:48:31 | Content-Type: text/html; charset=UTF-8
12-Feb-2021 09:48:31 | Expires: Thu, 01 Jan 1970 00:00:00 GMT
12-Feb-2021 09:48:31 | X-FRAME-OPTIONS: DENY
I tried similar tests with wget in the past and the result was successful as well.
can you also let me know what version of the CLI you're currently running? I'm most interested in knowing which version of node is being used
Some of the many versions we have used are below:
sfdx-cli/7.82.1-0 linux-x64 node-v14.15.1
sfdx-cli/7.81.0 linux-x64 node-v14.15.1
sfdx-cli/7.80.0 linux-x64 node-v14.15.1
sfdx-cli/7.77.0 linux-x64 node-v14.15.1
sfdx-cli/7.83.0 linux-x64 node-v14.15.1
I will try to test also with previous node versions, though I'm not sure if it is possible because we don't have full control on the environment.
@mshanemc
can you try running both commands using the node_modules/sfdx-cli/bin/run.sh and both using the sfdx force: approach to see if anything changes?
We never run the commands in different ways. We made a mistake and pasted the command with the wrong prefix. We tried both suggested approaches and both give the same error.
I will edit this response later today to answer the rest questions.
If you need me to try anything else let me know.
Thanks!
Hi @mdonnalley ,
same result here :
12-Feb-2021 15:17:30 | HTTP/1.1 200 OK
-- | --
12-Feb-2021 15:17:30 | X-Cnection: close
12-Feb-2021 15:17:30 | Date: Fri, 12 Feb 2021 14:17:30 GMT
12-Feb-2021 15:17:30 | Strict-Transport-Security: max-age=31536002; includeSubDomains
12-Feb-2021 15:17:30 | Public-Key-Pins-Report-Only: pin-sha256="9n0izTnSRF+W4W4JTq51avSXkWhQB8duS2bxVLfzXsY="; pin-sha256="5kJvNEMw0KjrCAu7eXY5HZdvyCS13BbA0VJG1RSP91w="; pin-sha256="njN4rRG+22dNXAi+yb8e3UMypgzPUPHlv4+foULwl1g="; max-age=86400; includeSubDomains; report-uri="https://a.forcesslreports.com/hpkp-report/00D1X0000008dgvm";
12-Feb-2021 15:17:30 | Expect-CT: max-age=86400, report-uri="https://a.forcesslreports.com/Expect-CT-report/00D1X0000008dgvm"
12-Feb-2021 15:17:30 | X-Content-Type-Options: nosniff
12-Feb-2021 15:17:30 | X-XSS-Protection: 1; mode=block
12-Feb-2021 15:17:30 | Content-Security-Policy: upgrade-insecure-requests
12-Feb-2021 15:17:30 | X-Robots-Tag: none
12-Feb-2021 15:17:30 | X-B3-TraceId: 987190a3e8a6274f
12-Feb-2021 15:17:30 | X-B3-SpanId: 987190a3e8a6274f
12-Feb-2021 15:17:30 | X-B3-Sampled: 0
12-Feb-2021 15:17:30 | Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
12-Feb-2021 15:17:30 | Set-Cookie: BrowserId=CuG5-W09Eeu6bnGNY8pIAQ; domain=.salesforce.com; path=/; expires=Sat, 12-Feb-2022 14:17:30 GMT; Max-Age=31536000
12-Feb-2021 15:17:30 | Content-Type: text/html; charset=UTF-8
12-Feb-2021 15:17:30 | Expires: Thu, 01 Jan 1970 00:00:00 GMT
12-Feb-2021 15:17:30 | X-FRAME-OPTIONS: DENY
Many of the versions @stnarlis2 shows are versions that I use as well.
On more investigation:
I created a clean ubuntu Docker and install the CLI by using the zip from here https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz.
When I try this installation the commands work without an error.
But the next problem is, that the included NODE version is 12.x which lead to a problem when installing the plugin "sfdx-git-delta".
So I need to create a link to the installed NodeJS 15.8.x version within the folder ./bin/node.
When I run it in this way I get it working, but I cannot update the version because the node version get overwritten with the old node version.
Kind regards
@stnarlis2 @lordmarshal
Thanks for the replies. It sounds like we can rule out the possibility of this being an issue with your proxy.
Next thing I want to rule out is whether it has anything to do with the node version. To do that we have a couple options:
npm install -g sfdx-cli@latest-rc. It might also be worth trying node 15 hereIn the meantime, I'm downloading a CentOS VM to see if I can replicate it
Hi @mdonnalley,
I was able to try the following versions, but unfortunately the errors remain (org not found, MyDomainResolver).
- sfdx-cli/7.88.1 linux-x64 node-v15.3.0
- sfdx-cli/7.88.1 linux-x64 node-v14.15.1
- sfdx-cli/7.88.1 linux-x64 node-v12.16.1
- sfdx-cli/7.88.1 linux-x64 node-v10.15.1
If you need any further information I'm available.
Thank you for the support!
Hi @mdonnalley
as mentioned above, a new version of node is requires for a plugin that we want to use in the further build process.
I got a setup running bit it is not the best solution.
Now all commands are running.
This is the output of sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.6 (core)
config 1.2.3 (core)
generator 1.1.3 (core)
salesforcedx 50.15.0 (core)
ββ limits 1.0.3 (core)
ββ schema 1.0.3 (core)
ββ user 1.0.9 (core)
ββ apex 0.1.4 (core)
ββ custom-metadata 1.0.11 (core)
ββ templates 50.4.0 (core)
ββ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
ββ salesforce-alm 50.15.0 (core)
sfdx-cli 7.85.1 (core)
When using the same setup with NPM package I am not able to run the force:org commands and get the error "The org cannot be found"
This is the output of sfdx-plugins of the cli installed whith NPM:
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.7 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 50.16.1 (core)
ββ limits 1.0.3 (core)
ββ schema 1.0.3 (core)
ββ user 1.0.11 (core)
ββ apex 0.1.4 (core)
ββ custom-metadata 1.0.11 (core)
ββ templates 50.4.0 (core)
ββ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
ββ salesforce-alm 50.16.1 (core)
Kind regards
Hi @All,
some more investigation.
I think it could be a node (config) problem.
When running the following command :
node -pe 'require("dns").lookup("CUSTOMDOMAIN.my.salesforce.com",function(){console.dir(arguments)})'
The result is the following:
build 16-Feb-2021 11:46:23 GetAddrInfoReqWrap {
build 16-Feb-2021 11:46:23 callback: [Function (anonymous)],
build 16-Feb-2021 11:46:23 family: 0,
build 16-Feb-2021 11:46:23 hostname: 'CUSTOMDOMAIN.my.salesforce.com',
build 16-Feb-2021 11:46:23 oncomplete: [Function: onlookup]
build 16-Feb-2021 11:46:23 }
build 16-Feb-2021 11:46:23 [Arguments] {
build 16-Feb-2021 11:46:23 '0': Error: getaddrinfo ENOTFOUND CUSTOMDOMAIN.my.salesforce.com
build 16-Feb-2021 11:46:23 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26) {
build 16-Feb-2021 11:46:23 errno: -3008,
build 16-Feb-2021 11:46:23 code: 'ENOTFOUND',
build 16-Feb-2021 11:46:23 syscall: 'getaddrinfo',
build 16-Feb-2021 11:46:23 hostname: 'CUSTOMDOMAIN.my.salesforce.com'
build 16-Feb-2021 11:46:23 }
build 16-Feb-2021 11:46:23 }
I will try to find out what the root cause is.
Kind regards
Stefan
@lordmarshal @stnarlis2
I just found a bug that was introduced in v2.17.0 of @salesforce/core that decreased the dns lookup timeout from 30 seconds to 3 seconds and the retry attempts from every 10 seconds to every 3 seconds... So essentially in v2.17.0 and newer, core only executes a single lookup attempt and then stops trying.
I just created a PR (https://github.com/forcedotcom/sfdx-core/pull/375) that will revert those values to 30 seconds and 10 seconds, respectively. In practice this means that core will retry the dns lookup 3 times: 1 every 10 seconds for 30 seconds.
Once that PR is merged, you can either wait for the next release or you can do a fresh install of the CLI with npm, and that should pick up the latest version of core for you.
Also, you'll be able to manipulate those values with these environment variables:
SFDX_DNS_TIMEOUT (note: you cannot set this to less than 3)SFDX_DNS_RETRY_FREQUENCY (note: you cannot set this to less than 10)That being said, this doesn't resolve the fact that the dns server is returning ENOTFOUND for you domains. I'm hopeful, however, that reverting the retry logic will help.
This issue has been linked to a new work item: W-8896111
Hi @mdonnalley
After investigating the code of the Versions delivered with the ZIP file and the NPM package I saw that different salesforce/core versions are used.
When comparing the Connection.js I saw that you have introduced a method isResolveable.(version 2.18.0)
Here you do the DNS lookup.
When the DNS lookup fails the exception βthe org cannot be foundβ is thrown.
In the zip you deliver 2.11.0 of salesforce/Core and there the method is not available.
You directly do a http request and this works fine.
I talked to our network guys and become the answer that our DNS servers will only return IP for internal servers and computers.
My suggestion is that you implement a fallback when DNS lookup does not return a result.
For now, can you explain how I can downgrade the salesforce/core plugin for the sfdx-cli installed with NPM?
Kind regards and thanks in advance for your answer.
Hi @All,
I have found a "solution" for my problem.
After having a deeper look into the code, I retrace when the dns command is executed.
The DNS lookup is only executed when the the CLI tries to get the maximum API Version from Salesforce API.
This is only done, when no API Version is set in the config.
So, when I set the API Version with sfdx force:config:set apiVersion=51.0 the commands work without the mentioned error.
Looking forward for a final solution but for now, the build jobs running fine.
Hi,
the solution above fixed our issue as well.
@lordmarshal thanks for tracking that down! We have a bug logged internally to fix this. My hope is to get it in before the next release
@lordmarshal @stnarlis2 we just published a new version of core that introduces a new environment variable for disabling the problematic dns lookup: SFDX_DISABLE_DNS_CHECK
That dns lookup was added to improve the performance of the force:org commands when users have expired orgs. We decided that we'd prefer to keep the dns lookup since more users are affected by the performance issue than there are users affected by a dns server that blocks external IPs
So if you'd like to bypass the dns lookup, you'll just need to set SFDX_DISABLE_DNS_CHECK=true in the environment.
If you want to get the latest version of core (2.19.0), you'll need to do a fresh install of the CLI via npm. If you want to use the archives, you'll have to wait for the next release of the CLI at the end of the week
Hi @mdonnalley
i have tested the fix and it worked like a charm.
Thank you for the quick update.
Kind regards
SFDX_DISABLE_DNS_CHECK
Is there a "sfdx config:set" name for it?
Most helpful comment
Hi @lordmarshal @stnarlis2 @chetu-mirdul sorry for the silence, yes, we are working on this. I think it will be available next week on the
latest-rctag of the cli. I'll update here when/where it's available