# Packer with Shell Script Provisioners( Error Uploading)

**URL:** <https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017>\
**Category:** Packer\
**Created:** [March 13, 2021, 1:07am UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017 "2021-03-13T01:07:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudovinh](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sudovinh/32/17954_2.png) [@sudovinh](https://discuss.hashicorp.com/u/sudovinh)\
**Post date:** [March 13, 2021, 1:07am UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017/1 "2021-03-13T01:07:22Z")

</div>

Hi,

I am trying to build off from an aws ami from aws marketplace using Packer. I am running into issues where the ami automatically pops up an interactive shell prompt (agreeing to licenses) when you ssh. So the Packer issue is when Provisioning with shell script that I have, it gets stuck uploading because of the interactive shell prompt.

The error will come up as this:  
Error uploading script: { big text from license agreement }

Any ideas?

---

<div class="post-metadata">

**Author:** ![brucellino1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/brucellino1/32/16147_2.png) [@brucellino1](https://discuss.hashicorp.com/u/brucellino1)\
**Post date:** [March 13, 2021, 5:02am UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017/2 "2021-03-13T05:02:19Z")

</div>

Hi @sudovinh !

Could you provide a bit more information, _e.g._, the AMI id in the marketplace? Perhaps there is an environment variable which you can set to turn off the interactive prompt, similar to setting `DEBIAN_FRONTEND` when doing unattended actions on `apt` ?

It may also be possible to use a single provisioner to simply `echo yes` into the first shell, but that depends on what the prompt expects.

---

<div class="post-metadata">

**Author:** ![sudovinh](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sudovinh/32/17954_2.png) [@sudovinh](https://discuss.hashicorp.com/u/sudovinh)\
**Post date:** [March 15, 2021, 6:34pm UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017/3 "2021-03-15T18:34:48Z")

</div>

Hi @brucellino1 !

Thanks for helping! I am trying to build off from the OpenVPN AMI. Once you hit yes for the first initial prompt, there is more interactive prompts (6 yes/no questions). I tried using `DEBIAN_FRONTEND=noninteractive` but does not seem to work.

---

<div class="post-metadata">

**Author:** ![Wolfsrudel](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wolfsrudel/32/28465_2.png) [@Wolfsrudel](https://discuss.hashicorp.com/u/Wolfsrudel)\
**Post date:** [March 16, 2021, 1:16pm UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017/4 "2021-03-16T13:16:00Z")

</div>

If it’s something about old vs. New configuration file, there is something like

```auto
DEBIAN_FRONTEND=noninteractive apt-get \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" \
<command-follow-up>

```

You should read the docs about it first.

Maybe this post can help you out, too:

> <https://askubuntu.com/questions/254129/how-to-display-all-apt-get-dpkgoptions-and-their-current-values/389933#389933>

---

<div class="post-metadata">

**Author:** ![brucellino1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/brucellino1/32/16147_2.png) [@brucellino1](https://discuss.hashicorp.com/u/brucellino1)\
**Post date:** [March 16, 2021, 1:21pm UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017/5 "2021-03-16T13:21:34Z")

</div>

This sounds more like an `expect` problem than an `apt` problem. I haven’t confirmed yet, but from what @sudovinh says, the AMI is configured with a startup script that expects user input. So, Packer needs to be able to run a provisioner to send that input to the script. Does this sound right?

---

<div class="post-metadata">

**Author:** ![sudovinh](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sudovinh/32/17954_2.png) [@sudovinh](https://discuss.hashicorp.com/u/sudovinh)\
**Post date:** [March 16, 2021, 6:24pm UTC](https://discuss.hashicorp.com/t/packer-with-shell-script-provisioners-error-uploading/22017/6 "2021-03-16T18:24:21Z")

</div>

@Wolfsrudel It is failing before It can run what I need to do. For example, If I do an inline shell command “echo yes”, it will still fail.

@brucellino1 Yes, that sounds about right.
