aws / elastic-beanstalk-roadmap

AWS Elastic Beanstalk roadmap
https://aws.amazon.com/elasticbeanstalk/
Creative Commons Attribution Share Alike 4.0 International
283 stars 11 forks source link

Can not modify environment in not ready state #97

Open gilvi opened 3 years ago

gilvi commented 3 years ago

Community Note

Having created an environment throught the console (many env params, balancer rules, etc.) I forgot setting AssociatePublicIpAddress to true so some connections problems happen: The EC2 instances failed to communicate with AWS Elastic Beanstalk, either because of configuration problems with the VPC or a failed EC2 instance. Check your VPC configuration and try launching the environment again

The solution would be as simple as editing the config and enabling this checkbox but it fails beacuse the environment must be ready. I also tried to change the config trhought CLI but same problems occurs: An error occurred (InvalidParameterValue) when calling the UpdateEnvironment operation: Environment named api99 is in an invalid state for this operation. Must be Ready.

Editing cloudformation template is also not easy, so finally I have to create a new environment from the begining. This is maddening.

Please, let us be able to change config in not 'ready' envirnments or, at least, recreate it with new modifications.

Sekhar-Kutikuppala commented 3 years ago

Hi @gilvi Is there a reason why you wouldn't want to change this when the environment goes ready state?

gilvi commented 3 years ago

The problem is that it never gets Ready so I can´t do anything with it. I'm not able to fix it (must be Ready) so have to terminate it and begin from zero to config a new one.

tmclean15 commented 2 years ago

I'm having the same issue. Being able to rebuild an EB environment with modifications rather than always defaulting to the old configurations would solve the problem. It's frustrating and time-consuming to have to terminate the environment and rebuild it from scratch just to change one configuration.

vanhungbkcbg1 commented 2 years ago

yes I also have same problem and I can't change config to fix issue

sonipranjal commented 2 years ago

Please Please fix this, it is wasting too much time 🥲

Ashcoca commented 2 years ago

Please fix this, frankly it's wild that this issue has persisted for so long.

felipe-dap commented 2 years ago

Allowing to change config --force seems important, imo.

Here's my scenario: I was testing deploying with EB. Looking promising. All good.

Here's what going on.

  1. Had a working testing environment with a RDS DB coupled to it. Time to switch to my new RDS DB

  2. I deleted my RDS database BEFORE I decoupled it from my eb environment.

  3. My understanding was that deleting my RDS DB prior to going into config and switching wouldn't be a problem.

  4. Went to Configurations > Modify Database > Decouple Database > Apply.

    Invalid Parameter Value
    Environment named drafty-dev is in an invalid state for this operation. Must be Ready.
  5. Went to Events Trace and got this: Service:AmazonRDS, Message:DBInstance aa5b39a00sffd not found.

Fair enough, but I got a loop situation:

Ended up deleting the whole thing in Cloud Formation and starting over. https://aws.amazon.com/pt/premiumsupport/knowledge-center/elastic-beanstalk-deleted-rds-database/

But I think it's worse poiting out my reasons for being able to change config while not in ready state. By the way, you cannot also terminate your environment by force which I think is something you should be able to do in order to prevent costs by any means.

By the way, EB is great. Cheers!

DataGreed commented 1 year ago

This is an awful design, really. I tried to rebuild an environment, but got an error, saying that my database instance type is no longer supported. The environment is now in invalid state and I cannot change configuration of database due to that (can't even decouple it).

Basically seems like this environment is dead and nothing can be done to rebuilt it, what a shame. Have to start from scratch because it's even impossible to clone it while it's in invalid state.

vladyslav2 commented 1 year ago

@DataGreed now imaging you need to fix environment which been working for 6 years and there is no one who initially build it

DataGreed commented 1 year ago

@DataGreed now imaging you need to fix environment which been working for 6 years and there is no one who initially build it

That sucks, I feel you

mskonovalov commented 1 year ago

Still the same issue, very poor experience The only feasible option to migrate off of EB

Drivible commented 1 year ago

This issue was raised in 2020 and is still an issue. I've just rebuilt an environment 3 times and it's still not quite right. The last time I got an error "_Creating load balancer named: arn:aws:elasticloadbalancing...f01c failed Reason: The value of 'access_logs.s3.prefix' cannot start or end with '/'_ "

So I could easily go through the online create environment process and there was no error until it tried to create the Load Balancer.

I've created at least 8 or 9 working EB environments without issues and suddenly I'm getting all sorts of problems and I'm only trying some minor things like adding S3 logging which is a good general practice.

This is getting rather frustrating.

tsheaff commented 1 year ago

This is by far the worst issue with Elastic Beanstalk. It's totally bonkers and makes no sense. It's a huge pain when configuring a new environment. There's almost always some kind of small issue to start (e.g. the startup command is wrong, or one of the dependencies didn't install remotely, etc). If that's the case, the obvious thing to do is to:

A) Get logs from the instance B) Debug the issue. C) If it's a code issue, deploy new code D) If it's a configuration issue, change the configuration

But steps (C) and (D) are impossible because the application must be "Ready". Yeah no shit it's not ready, that's what I'm trying to get it to be! It's not even letting me get the logs until the status is "Ready". Why would the whole thing need to be in a "Ready" state just to let me change any configuration or deploy new code! In fact, the most important time to be able to change configuration or code is when my application is NOT ready — that means I am probably experiencing downtime or data loss!

Fix this one thing, and I'd be a huge fan of EB (lots to like about it). But this issue is so horrendous and stupid that it takes the whole EB experience from great to shit all by itself. Y'all gotta fix this one.

dgagnon commented 1 year ago

It's never been much of an issue for me, except when I was learning EB. I will agree the learning curve is steep, but if you start from the sample app and iterate from there, it easy to isolate what error you made.

For A/B/C, and sometimes D, logging to the created instance with Session Manager or SSH and fix the error manually. That will bring the state to READY.

The only time this does not work is when the error is in the CloudFormation iteself or when its an external ressource that did not get created, can't create it. Lunch a new environment and deleted the old one.

You do not even need to wait, you can start working on the new one right away and just update your cname when your are done.

chrisskylark commented 9 months ago

One thing I have found to unlock the situation is to go to the scaling group created in the environment and edit it so that the min and desired instances are 0. Abort any current updates and then wait a while - normally it ends up back at status ready with a health of grey.

nicklyra commented 8 months ago

For whoever runs into this next, I found another answer for at least some situations (like mine) here: https://repost.aws/knowledge-center/elastic-beanstalk-invalid-state

TLDR: Go into CloudFormation, search for a stack called awseb-{your beanstalk environment id}-stack, so something like "awseb-e-abcdefghij-stack". Pick it. Then from the "Stack Actions" drop-down, pick "Continue update rollback."

If continuing the rollback fails, the reason you're stuck in this state will be plain to see there in the CloudFormation events, and once you correct that, you should be able to try again.

jdpagley commented 8 months ago

Please fix this issue!!!!!!!!!!!!!!!!!!!!!!!! I'v had to create and terminate 5+ environments at this point to try and resolve an issue because I'm guessing at what the problem could be since I can't pull logs.

dgagnon commented 8 months ago

@jdpagley don't guess. Log in to the machine and troubleshoot it from there. When the issue is on the VM, you can fix it manually, which will bring up the environment. When it is not a VM related issue, the cloudformation stack will contain the log with the actual error. SSM session manager works really well for this.