# Bootstrap fails with error in a bash script - which one?

**URL:** <https://discourse.chef.io/t/bootstrap-fails-with-error-in-a-bash-script-which-one/13306>\
**Category:** Chef Infra (archive)\
**Created:** [July 16, 2018, 8:32am UTC](https://discourse.chef.io/t/bootstrap-fails-with-error-in-a-bash-script-which-one/13306 "2018-07-16T08:32:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marbury](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@marbury](https://discourse.chef.io/u/marbury)\
**Post date:** [July 16, 2018, 8:32am UTC](https://discourse.chef.io/t/bootstrap-fails-with-error-in-a-bash-script-which-one/13306/1 "2018-07-16T08:32:23Z")

</div>

Hi,

I am trying to bootstrap a host with knife and get the following error:

```
[chef@magrathea ~/chef-repo]$ knife bootstrap chefinit@minecraft-test -i ~/.ssh/id_rsa --sudo -E 'minecraft 
test' -r 'role[forge_server]' -N 'minecraft-test'
Doing old-style registration with the validation key at ...
Delete your validation key in order to use your user credentials instead

Connecting to minecraft-test
minecraft-test bash: -c: line 180: unexpected EOF while looking for matching `''
minecraft-test bash: -c: line 182: syntax error: unexpected end of file

```

The bootstrap user on that host uses a bash as login shell. When I change the login shell to a Bourne Shell, I get the following error:

```
sh: Syntax error: Unterminated quoted string

```

Can anyone tell me which script is the problem here? How can I fix this error? Is there a variable missing that I have to set on the bootstrapped host?

Oh yeah … it also complains about the validation key. There is none. Maybe this is part of the error? Is there an attribute I should set?

Cheers,  
Stefan

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [July 16, 2018, 3:22pm UTC](https://discourse.chef.io/t/bootstrap-fails-with-error-in-a-bash-script-which-one/13306/2 "2018-07-16T15:22:08Z")

</div>

How did you install `knife` and what version is it? We had a bug like this a few years ago due to some incorrect newlines in a file in git.

---

<div class="post-metadata">

**Author:** ![suthir](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/suthir/32/2280_2.png) [@suthir](https://discourse.chef.io/u/suthir)\
**Post date:** [July 16, 2018, 4:32pm UTC](https://discourse.chef.io/t/bootstrap-fails-with-error-in-a-bash-script-which-one/13306/3 "2018-07-16T16:32:36Z")

</div>

@marbury pretty much upgrading `knife` and reconfiguring `knife.rb` would resolve this issue. For configuring `knife.rb`, you can use the command `knife configure` and run `knife ssl check` to make sure your ssl connection working with chef server.
