I’m trying to do a deploy locally (not done one for months but it used to work) from my Mac and have started getting this error. Any Mac experts know the fix? Is it something at my end or with the builder?
$ flyctl deploy
Deploying [name]
==> Validating app configuration
--> Validating app configuration done
Services
TCP 443 ⇢ 8686
UDP 514 ⇢ 514
Waiting for remote builder fly-builder-patient-shadow-851... connecting ⣷
Error error connecting to docker: error establishing agent: exec: "flyctl": executable file not found in $PATH
Hmm. I’m not running docker locally. But the remote builder shouldn’t need that.
$ flyctl version
flyctl v0.0.236 darwin/amd64 Commit: 01912e1 BuildDate: 2021-09-03T19:13:04Z
My paths work fine. Again, outside of the builder all looks fine:
~ $ where flyctl
-bash: where: command not found
~ $ type -a flyctl
flyctl is /Users/name/.fly/bin/flyctl
~ $ echo $PATH
/Users/name/google-cloud-sdk/bin:~/.fly/bin:~/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
… so it should be there. Unless it can’t resolve ~?
Ah … does the builder run where internally? And so can’t find the path? Because it would get command not found, presumably, like I do.
Ah. Strange! I confirmed which is there … but seems like it can’t find flyctl:
~ $ type which
which is hashed (/usr/bin/which)
~ $ which
usage: which [-as] program ...
~ $ which flyctl
~ $
Empty.
Yet flyctl must be in PATH for me to call it. It works for me. And it is there:
$ cd ~/.fly/bin
bin $ ls -l
total 75704
lrwxr-xr-x 1 name staff 39B 4 Sep 02:58 fly@ -> /Users/name/.fly/bin/flyctl
-rwxr-xr-x 1 name staff 37M 3 Sep 20:13 flyctl*
It’s entirely possible I did that months ago. Possibly trying to fix some other issue. And once it worked, I left it (well, apart from flyctl version update).
However the good news is the …
Unless it can’t resolve ~?
suspicion was correct. Your fix solved it Yay.
After running that export command and so getting the full path into the PATH, the builder found it and proceeded to deploy (which failed, ha, but that’s an issue with my app, not the builder!)
I mean there is another ~ in the PATH, for composer:
:~/.fly/bin:~/.composer/vendor/bin
… and we can’t rule out me having edited that PATH. Perhaps trying to get fly and composer working at some point months/years back. And given both do work (it was just the builder didn’t) I would have left the PATH as it was. With ~. So I don’t know where the paths originally came from.