AWS ec2 instance reboot runs program twice

Closed Posted 10 months ago Paid on delivery
Closed Paid on delivery

I need someone who can help me resolve an issue with my EC2 instance so that my program doesn't runs twice when the instance reboots.

The operating system used is Windows and the program is written in Python for flask application. When I reboot the instance, I assume it runs my [login to view URL] file twice because there is 2 print statements (see log below for context).

if not [login to view URL]:

[login to view URL]()

print("Scheduler main started...")

I already have "[login to view URL](debug=False, use_reloader=False)".

My "Instance auto-recovery is on Default".

I am relatively new to AWS so I hope you can help solve this.

The successful applicant should have experience working with AWS EC2 instance reboots and a strong working knowledge of Windows and Python. The ideal person would be able to use their skills to figure out what the issue is and how to fix it so the program runs twice when the instance reboots.

If you think you have the necessary skills and experience, I'd love to hear from you. Thank you.

class ReverseProxied(object):

def __init__(self, app):

[login to view URL] = app

def __call__(self, environ, start_response):

scheme = [login to view URL]('HTTP_X_FORWARDED_PROTO')

if scheme:

environ['wsgi.url_scheme'] = scheme

return [login to view URL](environ, start_response)

# application.wsgi_app = ReverseProxied(application.wsgi_app)

application.wsgi_app = ProxyFix(

application.wsgi_app

)

if __name__ == "__main__":

with application.app_context():

db.create_all()

# Public run

[login to view URL](debug=False, use_reloader=False)

2023-06-02T10:12:47.835-04:00 Jun 2 14:12:43 ip-172-31-74-2 web: [2023-06-02 14:12:43 +0000] [1925] [INFO] Starting gunicorn 20.1.0

2023-06-02T10:12:47.835-04:00 Jun 2 14:12:43 ip-172-31-74-2 web: [2023-06-02 14:12:43 +0000] [1925] [INFO] Listening at: [login to view URL] (1925)

2023-06-02T10:12:47.835-04:00 Jun 2 14:12:43 ip-172-31-74-2 web: [2023-06-02 14:12:43 +0000] [1925] [INFO] Using worker: gthread

2023-06-02T10:12:47.835-04:00 Jun 2 14:12:43 ip-172-31-74-2 web: [2023-06-02 14:12:43 +0000] [1990] [INFO] Booting worker with pid: 1990

2023-06-02T10:12:51.175-04:00 Jun 2 14:12:43 ip-172-31-74-2 web: [2023-06-02 14:12:43 +0000] [1991] [INFO] Booting worker with pid: 1991

2023-06-02T10:13:03.802-04:00 Jun 2 14:13:02 ip-172-31-74-2 web: [2023-06-02 14:13:02 +0000] [1925] [INFO] Handling signal: term

2023-06-02T10:13:03.802-04:00 Jun 2 14:13:03 ip-172-31-74-2 web: [2023-06-02 14:13:03 +0000] [1990] [INFO] Worker exiting (pid: 1990)

2023-06-02T10:13:03.802-04:00 Jun 2 14:13:03 ip-172-31-74-2 web: Scheduler main started...

2023-06-02T10:13:03.802-04:00 Jun 2 14:13:03 ip-172-31-74-2 web: [2023-06-02 14:13:03 +0000] [1991] [INFO] Worker exiting (pid: 1991)

2023-06-02T10:13:04.302-04:00 Jun 2 14:13:03 ip-172-31-74-2 web: Scheduler main started...

2023-06-02T10:13:06.057-04:00 Jun 2 14:13:04 ip-172-31-74-2 web: [2023-06-02 14:13:04 +0000] [1925] [INFO] Shutting down: Master

2023-06-02T10:13:06.057-04:00 Jun 2 14:13:05 ip-172-31-74-2 web: [2023-06-02 14:13:05 +0000] [3100] [INFO] Starting gunicorn 20.1.0

2023-06-02T10:13:06.057-04:00 Jun 2 14:13:05 ip-172-31-74-2 web: [2023-06-02 14:13:05 +0000] [3100] [INFO] Listening at: [login to view URL] (3100)

2023-06-02T10:13:06.057-04:00 Jun 2 14:13:05 ip-172-31-74-2 web: [2023-06-02 14:13:05 +0000] [3100] [INFO] Using worker: gthread

2023-06-02T10:13:06.057-04:00 Jun 2 14:13:05 ip-172-31-74-2 web: [2023-06-02 14:13:05 +0000] [3158] [INFO] Booting worker with pid: 3158

2023-06-02T10:13:10.548-04:00 Jun 2 14:13:05 ip-172-31-74-2 web: [2023-06-02 14:13:05 +0000] [3159] [INFO] Booting worker with pid: 3159

Python Amazon Web Services Linux Flask

Project ID: #36692545

About the project

13 proposals Remote project Active 8 mos ago

13 freelancers are bidding on average $44 for this job

kuldeepvk

Hi, I will check and find solution for reboot if server and fix the same. I have 10 years of experience and knowledge as system administrator setup and management of different Linux Web Hosting Servers, AWS servers,C More

$25 USD in 1 day
(552 Reviews)
7.3
tanubourasi

✅✅Certified Amazon Solution Architects, Azure, Docker, CI/CD, Jenkins, Terraform, Pulumi & Kubernetes Expert✅✅ ✅I have read your project REQUIREMENT and UNDERSTOOD IT COMPLETELY.✅ ✅Here is some more detail about my s More

$25 USD in 3 days
(41 Reviews)
5.9
merinsinha

AWS expert. I can do it. As 9+ years experiences in these field. I can give good quality work. I have read the guidelines of your work.I believe that i can provide you the best quality works you are anticipating from t More

$90 USD in 2 days
(51 Reviews)
5.5
sant527

Hi, I am a independent full stack developer. Worked mainly with (python/django/DRF (rest api) + javascript/reactjs + RDMS/Nosql). Also I can handle the devops/server related tasks. Use docker containers. I am well ve More

$20 USD in 7 days
(12 Reviews)
4.9
manishchgh

Hello, my name is manish and I'm excited to hear that you need help with your AWS EC2 instance reboots. With my extensive experience in web hosting services and cloud servers, I believe I am the perfect person to help More

$100 USD in 2 days
(16 Reviews)
4.3
adityasaroj

Hi there, I have gone up through the job description I completely understood your all requirement. I have a huge experience in programming skills and languages such as Linux, Cloud Computing, Amazon Web Services, Syste More

$50 USD in 1 day
(12 Reviews)
3.4
mtalha3520

Hi, Having more than 5 years of experience in Python & AWS. I'm writing you to show my interest in the available project. I can provide you with my technical assistance for this project. I understand that you are exper More

$50 USD in 1 day
(3 Reviews)
2.7
uxdev

[✔] ISSUE EXPERT: You have received a 30% discount ($18) on Project 'AWS ec2 instance reboot runs program twice'. (Recently finished a comparable work) - As a result, you should expect better outcomes in a shorter peri More

$42.7 USD in 1 day
(2 Reviews)
1.8
rohit5081

✅✅Certified Expert in Amazon Solution Architect✅✅ ✅Experienced in Azure, Docker, CI/CD, Jenkins, Terraform✅ ✅Certified Kubernetes Administrator✅ ✅Thank you for considering my services. I have thoroughly reviewed your More

$20 USD in 7 days
(1 Review)
0.2
Satyamtripathi02

Hello, my self satyam tripathi and I am also a certified AWS solutions architect, I have around 6+ years of hands-on experience in cloud & DevOps. I saw your requirements, I also did this earlier so as far as better un More

$20 USD in 7 days
(0 Reviews)
0.0
MoazAshraf

Hello. I have experience in AWS EC2, Python, Flask and Gunicorn. I will help you figure out why the program runs twice. Let's chat!

$20 USD in 3 days
(0 Reviews)
0.0