On 6/14/19 4:36 PM, Brian Cain wrote:
So I pulled down the FreeBSD-12-RELEASE box myself and noticed this line
when I tried to run this simple provisioner:
freebsd.vm.provision "shell", inline: "echo 'hi'"
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: (sudo=false)
DEBUG ssh: stderr: bash: Command not found.
DEBUG ssh: Exit status: 1
INFO ssh: SSH not ready: #<Vagrant::Errors::SSHInvalidShell: The
configured shell (config.ssh.shell) is invalid and unable
to properly execute commands. The most common cause for this is
using a shell that is unavailable on the system. Please verify
you're using the full path to the shell and that the shell is
executable by the SSH user.>
ERROR warden: Error occurred: The configured shell
(config.ssh.shell) is invalid and unable
to properly execute commands. The most common cause for this is
using a shell that is unavailable on the system. Please verify
you're using the full path to the shell and that the shell is
executable by the SSH user.
I'm not 100% sure, but I think perhaps bash is a hard requirement for
the shell provisioner? Seems like this might be the issue
you are running into as well? Do the other FreeBSD boxes that are
working have bash installed?
We have 3 FreeBSD VMs of various ages. One for 11.2, one for 12, one
for 13. Each has /usr/local/bin/bash. For some reason I can't
remember, on the FreeBSD-11.2 machine (which is where we have been
running an application for a year that we would now like to run on
FreeBSD-12) has this:
#####
$ which bash
/bin/bash
$ ls -l /bin/bash
lrwxr-xr-x 1 root wheel 19 May 31 2018 /bin/bash -> /usr/local/bin/bash
#####
Is there a possibility that the vagrant process wants a /bin/bash rather
than an /usr/local/bin/bash?
Thank you very much.
Jim Keenan
On Thu, Jun 13, 2019 at 4:04 PM James E Keenan <[email protected]
<mailto:[email protected]>> wrote:
On 6/13/19 6:51 PM, James E Keenan wrote:
> On 6/13/19 6:09 PM, Brian Cain wrote:
>>
>>
>> On Thu, Jun 13, 2019 at 12:49 PM James E Keenan
<[email protected] <mailto:[email protected]>
>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>
>> On 6/13/19 11:15 AM, Brian Cain wrote:
>> >
>> >
>> > On Wed, Jun 12, 2019 at 10:57 PM James E Keenan
>> <[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
>> > <mailto:[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>>> wrote:
>> >
>> > On 6/12/19 5:37 PM, Brian Cain wrote:
>> > > Hey there,
>> > >
>> > > Do you have a full debug log showing this provisioning
>> behavior
>> > when you
>> > > run Vagrant up or vagrant provision? Thanks!
>> >
>> > I haven't been able to locate any logging for Vagrant
(only
>> for
>> > VirtualBox). Where would I find that?
>> >
>> >
>> > It's only enabled when you use the flag. So you'll need
to rerun
>> your
>> > command with --debug then capture the output.
>> >
>> >
>>
>>
>> Thank you very much for that suggestion.
>>
>> As a basis for comparison, I ran 'vagrant provision --debug'
and
>> logged
>> the output in each of *two* VMs: the first being the
problematic
>> FreeBSD-12 VM, the second a FreeBSD-13 VM we have been using for
>> several
>> months without incident. The Vagrantfiles in each are similarly
>> structured, i.e., each uses a shell script for
provisioning. The
>> Vagrantfile for the FreeBSD-13VM has real content in its
shell script
>> and completes successfully.
>>
>> In each of the two log files, the following is the first 'ERROR'
>> line to
>> appear:
>>
>> #####
>> E, [datestamp #id] ERROR --
net.ssh.authentication.agent[404b67954]:
>> could not connect to ssh-agent: Agent not configured
>> #####
>>
>> In the FreeBSD-13 VM, this is the *only* 'ERROR' message in
the log.
>> Please see attachment freebsd13.following.ERROR.txt for how
'vagrant
>> provision' recovered from this. (The expected STDOUT begins at
>> the end
>> of this excerpt.)
>>
>> In the FreeBSD-12 VM, this is the first of 11 'ERROR'
messages in the
>> log (though many of the instances are repeats). Please see
>> attachment
>> freebsd12.following.ERROR.txt.
>>
>> What seems to be the first instance of real failure is these
lines
>> from
>> the FreeBSD-12 debug log:
>>
>> #####
>> INFO ssh: Execute: chown -R vagrant /tmp/vagrant-shell
(sudo=true)
>> DEBUG ssh: stderr: sudo
>> DEBUG ssh: stderr: :
>> DEBUG ssh: stderr: no tty present and no askpass program
specified
>> DEBUG ssh: stderr:
>>
>> DEBUG ssh: Exit status: 1
>> #####
>>
>>
>> I think this is a fairly common issue, and might just be an
issue with
>> how that box has setup the root account? I believe this error
>> is essentially saying that it's trying to run the script as root
but
>> there is no configured shell to be used on the root account. I'm
>> guessing maybe
>> if you update the root account to be able to allocate a shell, the
>> error should go away?
>>
>>
>
> This is what I have for the key users on each of 2 VMs.
FreeBSD-12 is
> not working. FreeBSD-13 is working.
>
> #####
> $ uname -mrs;grep -E '^(root|vagrant)' /etc/passwd | cut -d ':' -f1,7
> FreeBSD 12.0-RELEASE-p4 amd64
> root:/bin/csh
> vagrant:/usr/local/bin/bash
>
> % uname -mrs;grep -E '^(root|vagrant)' /etc/passwd | cut -d ':' -f1,7
> FreeBSD 13.0-CURRENT amd64
> root:/bin/csh
> vagrant:/bin/csh
> ######
>
> Could it be that the vagrant user's shell must be /bin/csh?
Well, in the faulty FreeBSD-12 VM, I changed user 'vagrant's shell to
/bin/csh. I then exited the VM and called 'vagrant provision --debug'
and logged the output.
I got no improvement. Once again I got:
#####
DEBUG ssh: == Net-SSH connection debug-level log END ==
INFO ssh: Execute: chown -R vagrant /tmp/vagrant-shell (sudo=true)
DEBUG ssh: stderr: sudo
DEBUG ssh: stderr: :
DEBUG ssh: stderr: no tty present and no askpass program specified
DEBUG ssh: stderr:
#####
>
>> The corresponding lines in the FreeBSD-13 VM debug line are:
>>
>> #####
>> DEBUG ssh: == Net-SSH connection debug-level log END ==
>> INFO ssh: Execute: chown -R vagrant /tmp/vagrant-shell
(sudo=true)
>> DEBUG ssh: stderr:
41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
>> DEBUG ssh: Exit status: 0
>> DEBUG ssh: Uploading:
/tmp/vagrant-shell20190613-60554-odqtcv.ps1 to
>> /tmp/vagrant-shell
>> DEBUG ssh: Re-using SSH connection.
>> #####
>>
>> I can supply complete debug logs off-line upon request.
>>
>> So, can you suggest what is going wrong in the FreeBSD-12 VM
(taking
>> into consideration that several days ago I did achieve one
successful
>> provisioning of this VM) and how to remedy it?
>>
>> Thank you very much.
>> Jim Keenan
>>
>> --
>
> Thank you very much.
> Jim Keenan
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/4fcdc36d-8f54-e02f-961f-958ddbbbf6b3%40pobox.com.
For more options, visit https://groups.google.com/d/optout.