# Elastic Beanstalk Deploy never terminates on CircleCi but App is deployed

**URL:** <https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573>\
**Category:** Deployments\
**Tags:** elasticbeanstalk, aws, deploy, awscli\
**Created:** [July 27, 2019, 10:02am UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573 "2019-07-27T10:02:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.deploys](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@alex.deploys](https://discuss.circleci.com/u/alex.deploys)\
**Post date:** [July 27, 2019, 10:02am UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/1 "2019-07-27T10:02:11Z")

</div>

Hi there,

I use a pretty simple pipeline (push to git then npm install my server, then npm install my front-end, test then build) and then it is deployed to AWS using EB. However the app does deploy to AWS but does not terminate the task in CircleCi leaving it in “Running Forever”.

Any ideas why this may be?

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [July 27, 2019, 1:35pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/2 "2019-07-27T13:35:24Z")

</div>

Could you add a Linux `timeout` to your deploy step? If it deploys but still times out, perhaps there is a platform bug. Also, if you have a verbose mode to your deploy, switch it on, so you can see how far it is getting.

---

<div class="post-metadata">

**Author:** ![alex.deploys](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@alex.deploys](https://discuss.circleci.com/u/alex.deploys)\
**Post date:** [July 27, 2019, 1:55pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/3 "2019-07-27T13:55:46Z")

</div>

Hello @halfer,

1. If I add a timeout it will time out and fail which is not optimal as builds that pass will still be marked as failed in CircleCi right?

2. Here is the verbose xoutput:

It then hangs here forever but it successfully deploys to AWS and I can see the changes I made.

Also, thanks for helping me out!

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [July 27, 2019, 7:48pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/4 "2019-07-27T19:48:48Z")

</div>

> [@alex.deploys](#):
>
> If I add a timeout it will time out and fail which is not optimal as builds that pass will still be marked as failed in CircleCi right?

Yes. I did not mean this to be a permanent solution - just that if you can show that it has deployed and it is still hanging, then it may be worth filing a bug with Circle. Given your verbose output, perhaps you can say that you have shown there to be a problem already?

---

<div class="post-metadata">

**Author:** ![alex.deploys](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@alex.deploys](https://discuss.circleci.com/u/alex.deploys)\
**Post date:** [August 7, 2019, 3:14pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/5 "2019-08-07T15:14:25Z")

</div>

Hey @halfer,

No luck on the bug post! I think i’ll just add a timeout! How would you approach this?

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [August 7, 2019, 6:06pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/6 "2019-08-07T18:06:54Z")

</div>

A timeout just takes a time and a command, so yours would probably be:

```
timeout 5m eb deploy MyEnvironment -v

```

where “5m” can be any number (e.g. 5) and any unit (e.g. m=minutes, s=seconds, etc).

Separately, I _think_ I have identified a platform bug where the server stdout hangs onto the process even after the output has finished, but it is very sporadic, in my experience. Does your issue happen every time, or infrequently?

---

<div class="post-metadata">

**Author:** ![alex.deploys](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@alex.deploys](https://discuss.circleci.com/u/alex.deploys)\
**Post date:** [September 27, 2019, 7:38pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/7 "2019-09-27T19:38:34Z")

</div>

Everytime!

---

<div class="post-metadata">

**Author:** ![Kibbey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kibbey/32/23733_2.png) [@Kibbey](https://discuss.circleci.com/u/Kibbey)\
**Post date:** [December 4, 2019, 5:15pm UTC](https://discuss.circleci.com/t/elastic-beanstalk-deploy-never-terminates-on-circleci-but-app-is-deployed/31573/8 "2019-12-04T17:15:42Z")

</div>

Had a similar issue and found a [suggestion](https://gist.github.com/RobertoSchneiders/9e0e73e836a80d53a21e) to add the permission elasticbeanstalk:DescribeEvents  
to the deploy user.

Resolved my issue.
