AWS Beanstalk keeps changing the instance underneath - amazon-elastic-beanstalk

I have Node JS application running on AWS Beanstalk with load balance, I set the minimum instance number to 1 and max to 5.
The Node JS application executes some time consuming tasks that could take several hours.
Everything is working ok on my local environment but after deploying to Beanstalk, I notice Beanstalk is running ok at the beginning, but after 5-10 minutes, the instance seems be replaced with a clone.
E.g.: My Node JS task keeps writing to the log file to track the task progress, and at the beginning I can see the beanstalk log file contains the progress text and it keeps growing, but after 5 minutes, when I look at the log file again, the progress the task logged is gone. Then I downloaded the full log file and checked full log, the log file size is very small and only contains basic server start information. It looks like a newly started instance as even the instance is restarted, the previous log should still in the file.
It gives me a strong indication that the log file now I am looking at is not the same instance I was looking at before, and I suspect Beanstalk swap the instance that was running my task with a brand new but cloned instance. And even every code I deployed before is still there, but the task progress is gone. Therefore, the task is never able to fully completed.
Anyone has seen this before? And how to fix it?

Related

UIPath Orchestrator based Automation: Schedule Job Fails due to robot unavailability

I have my GCP machine that is scheduled to switch on and run from 6hrs in the morning to 12hrs. I am trying to automate the script once the machine is on, so I am scheduling a job on 6:30 hrs.
But what I observed is that UIPath Robot doesn't automatically get connected unless I open an RDP session and then manually open UI Path Assistant to connect it with orchestrator.
I also tried to create a bat script and schedule it with windows startup. But that fails to run as well. To verify my startup script I added two commands:
<verification script sending mail on startup> && <UIPath Script>
I tested this script manually in RDP session and they did run sequentially as expected. But when I added it to auto-scheduling in gcp, only the first script actually ran (<verification script sending mail on startup>) and the second one (<UIPath Script>) just didn't.
Moreover I did put the bat file in Windows Startup Folder but again that also required me to sign into the system using RDP session for it to run.
From my understanding, the UIPath Script (XAML) in order to run needs the system to be switched on 24/7 and then it connects to orchestrator and then we can schedule the process based on the time, but then my maching will be idle for lots of ineffective hours.
Secondly, going by the .bat file to be as a startup script also fails as in order to run the script, it needs the user to be logged in which doesn't happen. Though other scripts such as .py files run smoothly so I lose here as well.
Finally scheduling my bat file through windows startup feature does work but then it's also of no use as for it to start also I need to open an RDP session and log in.
Does anyone know the workaround for this?

Xdebug - PhpStorm breaks on other process, but not the original run configuration

I've had Xdebug set up and working properly in the past, but seem to have a real problem getting it to work consistently. This is a WordPress/WooCommerce install and I'm simply trying to load the homepage with some search query parameters so that I can debug a custom function.
Currently, I can't get it to break properly when I debug using a run configuration. It just won't break at all unless I tick the button to listen for incoming connections. At that point, I have to wade through every single index.php and cron.php process that runs, waiting for the right one to come along.
I'm not crazy, am I? I should be able to look at the single debug process and not all these others? It's as if PhpStorm is not receiving the initial connection when I run the configuration.

IBM's Bluemix Toolchain process hangs on completion

I've built my container multiple times successfully, as noted by the image below. Each time it remains on 99% for > 20+ mins AFTER saying 'Finished: SUCCESS' in the logs. It never makes it past this. I cant kick off the deploy phase until the build registers completion. Is there a way to get past this hang?
I've got no notable errors in the console. The build is based on the registry.ng.bluemix.net/ibmnode:latest image, runs an apache2 server with some Node.js processes that run during the build phase. And lastly, it kicks off a bash script to run apache2 in the foreground.
I just checked my toolchain and wasn't able to reproduce this problem. Please try again, it might have been a transient issue with the toolchains.
If the problem persists, it might have to do with how you have your build script setup. If you are spawning processes and leaving them running, that could be stopping the build from finishing.

Can't clone a VM instance from Google Developer Compute Console

I'm trying to clone an instance Centos based and in a load balancing pool. As soon as I click "create" I see the yellow baloon saying "creating instance...." but I don't see the task running in the Activities Windows and the message "creating instance..." freeze for ever.
So I tried creating the instance starting from a snapshot of the original instance but the result is the same. I'm not sure if something happened in the project or the problem is related to the fact the the instance is in a pool of the loadbalancer. Thank you.
This is the screenshot:

Why does my custom beanstalk keep restarting?

I am trying to customize the default AMI of beanstalk, but everytime I get server restarts after some random time. I went so far as not to change anything, but nothing works.
I have tried the following:
find the instance of running beanstalk, create AMI, modify the AMI of beanstalk-crashing
create new instance with same AMI as on beanstalk, create AMI, modify configuration-crashing
I have tried both stopping the instance before creating AMI, and creating AMI of running instance.
Edit: I found the answer here: Can't generate a working customized EC2 AMI from Amazon Beanstalk sample appl
From personal experience, place the health status page to point to a dummy, static .html file. Although not recommended, this will prevent the health checks from restarting the machine and you could make more inside inspection.
AWS captures into the S3 logs only the ones output via java.util.logging. It means all console logging is not transferred.
That said, make sure you define an private key in your environment config, so you could ssh to it easily and see its output (it changes - for Tomcat 7, it is at /opt/tomcat7. For tomcat6, it is under /usr/share/tomcat6)
Just to add to what aldrinleal wrote (can't comment yet): In the past, I would often find a failed Healthcheck would also disable my site. By which I mean: If you have the health check on your actual app and that app threw an exception, you wouldn't actually get to see anything, the environment would just report a failed state. Only after I changed to a static file for the health check, did I manage to see the errors.
Now I obviously this is more a problem with a dev environment and you can always just pull the logs. But especially in the beginning as someone new to AWS/Beanstalk this helped me a lot.