Skip to content
site logo mobile

Forum in maintenance, we will back soon 🙂

I need help AWS Ela...
 
Notifications
Clear all

I need help AWS Elastic Beanstalk webapp deployment

8 Posts
3 Users
2 Likes
580 Views
(@samuelson00)
Posts: 4
Active Member
Topic starter
 

Hello, I tried deploying my webapp on AWS Elastic Beanstalk EC2 instance but it failed. I completely have no clue on how to go about fixing the problem. I need a step-by-step on on what to do, please. I'm sort of new to this. I only followed @Hasan video on YouTube and wanted to try out something.

Here's the error log.

2023/07/07 21:02:22.657421 [INFO] Starting...
2023/07/07 21:02:22.657475 [INFO] Starting EBPlatform-PlatformEngine
2023/07/07 21:02:22.657575 [INFO] reading event message file
2023/07/07 21:02:22.657760 [INFO] Engine received EB command userdata-exec

2023/07/07 21:02:22.672573 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBAutoScalingGroup --region us-east-1
2023/07/07 21:02:23.441348 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBBeanstalkMetadata --region us-east-1
2023/07/07 21:02:24.283140 [INFO] This is a workflow controlled instance.
2023/07/07 21:02:24.283237 [INFO] Engine command: (env-launch)

2023/07/07 21:02:24.283668 [INFO] Executing instruction: SyncClock
2023/07/07 21:02:24.283674 [INFO] Starting SyncClock
2023/07/07 21:02:24.283686 [INFO] Running command /bin/sh -c /usr/bin/chronyc tracking
2023/07/07 21:02:24.328293 [INFO] Reference ID    : A9FEA97B (169.254.169.123)
Stratum         : 4
Ref time (UTC)  : Fri Jul 07 21:02:22 2023
System time     : 0.000000037 seconds fast of NTP time
Last offset     : -0.000035899 seconds
RMS offset      : 0.000035899 seconds
Frequency       : 1.666 ppm fast
Residual freq   : -13.496 ppm
Skew            : 1.073 ppm
Root delay      : 0.000284181 seconds
Root dispersion : 0.000283118 seconds
Update interval : 0.7 seconds
Leap status     : Normal

2023/07/07 21:02:24.328325 [INFO] Running command /bin/sh -c /usr/bin/chronyc -a makestep
2023/07/07 21:02:24.333828 [INFO] 200 OK

2023/07/07 21:02:24.333885 [INFO] Skipping Configure OS
2023/07/07 21:02:24.333892 [INFO] Skipping LockRepo
2023/07/07 21:02:24.333897 [INFO] Skipping GenerateEBBanner
2023/07/07 21:02:24.333902 [INFO] Skipping Install Process Manager
2023/07/07 21:02:24.333907 [INFO] Skipping install syslog
2023/07/07 21:02:24.333913 [INFO] Skipping install cron
2023/07/07 21:02:24.333918 [INFO] Skipping install proxy
2023/07/07 21:02:24.333923 [INFO] Skipping installhealthd
2023/07/07 21:02:24.333928 [INFO] Skipping Install Log Streaming Manager
2023/07/07 21:02:24.333934 [INFO] Skipping install X-Ray
2023/07/07 21:02:24.333940 [INFO] Skipping install Third Party License
2023/07/07 21:02:24.333945 [INFO] Skipping install httpd
2023/07/07 21:02:24.333951 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:24.333954 [INFO] Executing instruction: installSqsd
2023/07/07 21:02:24.333958 [INFO] This is a web server environment instance, skip install sqsd daemon ...
2023/07/07 21:02:24.333963 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:24.333967 [INFO] Executing instruction: bootstraphealthd
2023/07/07 21:02:24.333971 [INFO] this is an enhanced health env ...
2023/07/07 21:02:24.333985 [INFO] bootstrap healthd....
2023/07/07 21:02:24.333998 [INFO] Running command /bin/sh -c /usr/bin/id -u healthd || /usr/sbin/useradd --user-group healthd -s /sbin/nologin --create-home
2023/07/07 21:02:24.994326 [INFO] /usr/bin/id: ‘healthd’: no such user

2023/07/07 21:02:24.997328 [INFO] bootstrap healthd....
2023/07/07 21:02:24.997373 [INFO] Running command /bin/sh -c /usr/bin/id -u healthd || /usr/sbin/useradd --user-group healthd -s /sbin/nologin --create-home
2023/07/07 21:02:25.001355 [INFO] 1001

2023/07/07 21:02:25.002970 [INFO] configure bundle log for healthd...
2023/07/07 21:02:25.003094 [INFO] Executing instruction: GetSetupProxyLog
2023/07/07 21:02:25.003181 [INFO] Skipping Install yum packages
2023/07/07 21:02:25.003187 [INFO] Skipping Configure Python site-packages
2023/07/07 21:02:25.003193 [INFO] Skipping Install Python Modules
2023/07/07 21:02:25.003199 [INFO] Skipping MarkBaked
2023/07/07 21:02:25.003206 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:25.003209 [INFO] Executing instruction: TuneSystemSettings
2023/07/07 21:02:25.003212 [INFO] Starting TuneSystemSettings
2023/07/07 21:02:25.003217 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:25.004387 [INFO] Executing instruction: GetSetupLogRotate
2023/07/07 21:02:25.004392 [INFO] Initialize LogRotate files and directories
2023/07/07 21:02:25.021801 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:25.021813 [INFO] Executing instruction: BootstrapCFNHup
2023/07/07 21:02:25.021817 [INFO] Bootstrap cfn-hup
2023/07/07 21:02:25.023469 [INFO] Copying file /opt/elasticbeanstalk/config/private/aws-eb-command-handler.conf to /etc/cfn/hooks.d/aws-eb-command-handler.conf
2023/07/07 21:02:25.025626 [INFO] Executing instruction: StartCFNHup
2023/07/07 21:02:25.025634 [INFO] Start cfn-hup
2023/07/07 21:02:25.025658 [INFO] Running command /bin/sh -c systemctl show -p PartOf cfn-hup.service
2023/07/07 21:02:25.056825 [INFO] cfn-hup is not registered with EB yet, registering it now
2023/07/07 21:02:25.056875 [INFO] Running command /bin/sh -c systemctl show -p PartOf cfn-hup.service
2023/07/07 21:02:25.091211 [INFO] Running command /bin/sh -c systemctl daemon-reload
2023/07/07 21:02:25.605180 [INFO] Running command /bin/sh -c systemctl reset-failed
2023/07/07 21:02:25.616524 [INFO] Running command /bin/sh -c systemctl is-enabled aws-eb.target
2023/07/07 21:02:25.636907 [INFO] Running command /bin/sh -c systemctl enable aws-eb.target
2023/07/07 21:02:26.111213 [INFO] Running command /bin/sh -c systemctl start aws-eb.target
2023/07/07 21:02:26.130176 [INFO] Running command /bin/sh -c systemctl enable cfn-hup.service
2023/07/07 21:02:26.640795 [INFO] Synchronizing state of cfn-hup.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable cfn-hup
Created symlink /etc/systemd/system/multi-user.target.wants/cfn-hup.service → /etc/systemd/system/cfn-hup.service.

2023/07/07 21:02:26.640829 [INFO] Running command /bin/sh -c systemctl is-active cfn-hup.service
2023/07/07 21:02:26.652120 [INFO] cfn-hup process is not running, starting it now
2023/07/07 21:02:26.652151 [INFO] Running command /bin/sh -c systemctl show -p PartOf cfn-hup.service
2023/07/07 21:02:26.672749 [INFO] Running command /bin/sh -c systemctl is-active cfn-hup.service
2023/07/07 21:02:26.694027 [INFO] Running command /bin/sh -c systemctl start cfn-hup.service
2023/07/07 21:02:26.760687 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:26.760701 [INFO] Executing instruction: SetupPublishLogCronjob
2023/07/07 21:02:26.760705 [INFO] Setup publish logs cron job...
2023/07/07 21:02:26.760709 [INFO] Copying file /opt/elasticbeanstalk/config/private/logtasks/cron/publishlogs to /etc/cron.d/publishlogs
2023/07/07 21:02:26.763581 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:26.763590 [INFO] Executing instruction: MarkBootstrapped
2023/07/07 21:02:26.763593 [INFO] Starting MarkBootstrapped
2023/07/07 21:02:26.763598 [INFO] Instance has NOT been bootstrapped
2023/07/07 21:02:26.763669 [INFO] Marked instance as Bootstrapped
2023/07/07 21:02:26.763673 [INFO] Executing instruction: Save CFN Stack Info
2023/07/07 21:02:26.763717 [INFO] Starting SwitchCFNStack
2023/07/07 21:02:26.763722 [INFO] Executing cleanup logic
2023/07/07 21:02:26.763731 [INFO] Platform Engine finished execution on command: env-launch

2023/07/07 21:02:35.962858 [INFO] Starting...
2023/07/07 21:02:35.962919 [INFO] Starting EBPlatform-PlatformEngine
2023/07/07 21:02:35.962959 [INFO] reading event message file
2023/07/07 21:02:35.963115 [INFO] Engine received EB command cfn-hup-exec

2023/07/07 21:02:36.030358 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBAutoScalingGroup --region us-east-1
2023/07/07 21:02:36.574982 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBBeanstalkMetadata --region us-east-1
2023/07/07 21:02:36.906244 [INFO] checking whether command app-deploy is applicable to this instance...
2023/07/07 21:02:36.906263 [INFO] this command is applicable to the instance, thus instance should execute command
2023/07/07 21:02:36.906267 [INFO] Engine command: (app-deploy)

2023/07/07 21:02:36.906272 [INFO] Downloading EB Application...
2023/07/07 21:02:36.906275 [INFO] Region: us-east-1
2023/07/07 21:02:36.906278 [INFO] envID: e-7swiuaswft
2023/07/07 21:02:36.906281 [INFO] envBucket: elasticbeanstalk-us-east-1-537214917058
2023/07/07 21:02:36.906284 [INFO] Using manifest file name from command request
2023/07/07 21:02:36.906289 [INFO] Unable to get version manifest file.
2023/07/07 21:02:36.906291 [INFO] Downloading latest manifest available.
2023/07/07 21:02:36.906293 [INFO] Download latest app version manifest
2023/07/07 21:02:36.906383 [INFO] resources/environments/e-7swiuaswft/_runtime/versions/manifest
2023/07/07 21:02:36.969347 [INFO] latestManifest key *: resources/environments/e-7swiuaswft/_runtime/versions/manifest_1688763685503

2023/07/07 21:02:36.969511 [INFO] Downloading: bucket: elasticbeanstalk-us-east-1-537214917058, object: /resources/environments/e-7swiuaswft/_runtime/versions/manifest_1688763685503
2023/07/07 21:02:37.029856 [INFO] Download successful132bytes downloaded
2023/07/07 21:02:37.029960 [INFO] Trying to read and parse version manifest...
2023/07/07 21:02:37.030041 [INFO] Downloading: bucket: elasticbeanstalk-us-east-1-537214917058, object: /resources/environments/e-7swiuaswft/_runtime/_versions/ChatGPT prompts for AI images/7Jul23v2
2023/07/07 21:02:37.055635 [INFO] Download successful1400322bytes downloaded
2023/07/07 21:02:37.056694 [INFO] Executing instruction: ElectLeader
2023/07/07 21:02:37.056702 [INFO] Running leader election for instance i-00c8c8ecd53881369...
2023/07/07 21:02:37.056706 [INFO] Calling the cfn-elect-cmd-leader to elect the command leader.
2023/07/07 21:02:37.056719 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-elect-cmd-leader --stack arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 --command-name ElasticBeanstalkCommand-AWSEBAutoScalingGroup --invocation-id 51a44045-800b-4c5d-a199-ae24510f51cd --listener-id i-00c8c8ecd53881369 --region us-east-1
2023/07/07 21:02:37.382870 [INFO] Instance is Leader.
2023/07/07 21:02:37.382908 [INFO] Executing instruction: stopSqsd
2023/07/07 21:02:37.382914 [INFO] This is a web server environment instance, skip stop sqsd daemon ...
2023/07/07 21:02:37.382917 [INFO] Executing instruction: PreBuildEbExtension
2023/07/07 21:02:37.382921 [INFO] Starting executing the config set Infra-EmbeddedPreBuild.
2023/07/07 21:02:37.382936 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBAutoScalingGroup --region us-east-1 --configsets Infra-EmbeddedPreBuild
2023/07/07 21:02:37.724319 [INFO] Finished executing the config set Infra-EmbeddedPreBuild.

2023/07/07 21:02:37.724352 [INFO] Executing instruction: StageApplication
2023/07/07 21:02:37.724901 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2023/07/07 21:02:37.724918 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2023/07/07 21:02:37.763788 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2023/07/07 21:02:37.767527 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2023/07/07 21:02:37.767585 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2023/07/07 21:02:37.767601 [INFO] The dir .platform/hooks/prebuild/ does not exist
2023/07/07 21:02:37.767604 [INFO] Finished running scripts in /var/app/staging/.platform/hooks/prebuild
2023/07/07 21:02:37.767609 [INFO] Executing instruction: InstallDependency
2023/07/07 21:02:37.767613 [INFO] checking dependencies file
2023/07/07 21:02:37.767627 [INFO] No dependency file found
2023/07/07 21:02:37.767629 [INFO] Executing instruction: check Procfile
2023/07/07 21:02:37.767645 [INFO] creating default Procfile...
2023/07/07 21:02:37.767696 [INFO] Executing instruction: configure X-Ray
2023/07/07 21:02:37.767699 [INFO] X-Ray is not enabled.
2023/07/07 21:02:37.767702 [INFO] Executing instruction: configure proxy server
2023/07/07 21:02:37.774914 [INFO] Executing instruction: configure healthd specific proxy conf
2023/07/07 21:02:37.777454 [INFO] Running command /bin/sh -c systemctl show -p PartOf healthd.service
2023/07/07 21:02:37.789351 [INFO] Running command /bin/sh -c systemctl daemon-reload
2023/07/07 21:02:38.061803 [INFO] Running command /bin/sh -c systemctl reset-failed
2023/07/07 21:02:38.070766 [INFO] Running command /bin/sh -c systemctl is-enabled aws-eb.target
2023/07/07 21:02:38.078662 [INFO] Running command /bin/sh -c systemctl enable aws-eb.target
2023/07/07 21:02:38.379056 [INFO] Running command /bin/sh -c systemctl start aws-eb.target
2023/07/07 21:02:38.387870 [INFO] Running command /bin/sh -c systemctl enable healthd.service
2023/07/07 21:02:38.649723 [INFO] Created symlink /etc/systemd/system/multi-user.target.wants/healthd.service → /etc/systemd/system/healthd.service.

2023/07/07 21:02:38.649755 [INFO] Running command /bin/sh -c systemctl show -p PartOf healthd.service
2023/07/07 21:02:38.660345 [INFO] Running command /bin/sh -c systemctl is-active healthd.service
2023/07/07 21:02:38.667022 [INFO] Running command /bin/sh -c systemctl start healthd.service
2023/07/07 21:02:38.720006 [INFO] Copying file /opt/elasticbeanstalk/config/private/healthd/healthd_logformat.conf to /var/proxy/staging/nginx/conf.d/healthd_logformat.conf
2023/07/07 21:02:38.721107 [INFO] Copying file /opt/elasticbeanstalk/config/private/healthd/healthd_nginx.conf to /var/proxy/staging/nginx/conf.d/elasticbeanstalk/healthd.conf
2023/07/07 21:02:38.722684 [INFO] Executing instruction: configure log streaming
2023/07/07 21:02:38.722692 [INFO] log streaming is not enabled
2023/07/07 21:02:38.722694 [INFO] disable log stream
2023/07/07 21:02:38.722704 [INFO] Running command /bin/sh -c systemctl show -p PartOf amazon-cloudwatch-agent.service
2023/07/07 21:02:38.738723 [INFO] Running command /bin/sh -c systemctl stop amazon-cloudwatch-agent.service
2023/07/07 21:02:38.752813 [INFO] Executing instruction: GetToggleForceRotate
2023/07/07 21:02:38.752838 [INFO] Checking if logs need forced rotation
2023/07/07 21:02:38.752860 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBAutoScalingGroup --region us-east-1
2023/07/07 21:02:39.186901 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBBeanstalkMetadata --region us-east-1
2023/07/07 21:02:39.615904 [INFO] Generating rsyslog config from Procfile
2023/07/07 21:02:39.617731 [INFO] Running command /bin/sh -c systemctl restart rsyslog.service
2023/07/07 21:02:40.193777 [INFO] Executing instruction: PostBuildEbExtension
2023/07/07 21:02:40.193805 [INFO] Starting executing the config set Infra-EmbeddedPostBuild.
2023/07/07 21:02:40.193823 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBAutoScalingGroup --region us-east-1 --configsets Infra-EmbeddedPostBuild
2023/07/07 21:02:40.541316 [INFO] Finished executing the config set Infra-EmbeddedPostBuild.

2023/07/07 21:02:40.541339 [INFO] Executing instruction: CleanEbExtensions
2023/07/07 21:02:40.541361 [INFO] Cleaned ebextensions subdirectories from app staging directory.
2023/07/07 21:02:40.541364 [INFO] Executing instruction: RunAppDeployPreDeployHooks
2023/07/07 21:02:40.541380 [INFO] Executing platform hooks in .platform/hooks/predeploy/
2023/07/07 21:02:40.541396 [INFO] The dir .platform/hooks/predeploy/ does not exist
2023/07/07 21:02:40.541400 [INFO] Finished running scripts in /var/app/staging/.platform/hooks/predeploy
2023/07/07 21:02:40.541413 [INFO] Executing instruction: stop X-Ray
2023/07/07 21:02:40.541415 [INFO] stop X-Ray ...
2023/07/07 21:02:40.541425 [INFO] Running command /bin/sh -c systemctl show -p PartOf xray.service
2023/07/07 21:02:40.554944 [WARN] stopProcess Warning: process xray is not registered
2023/07/07 21:02:40.555012 [INFO] Running command /bin/sh -c systemctl stop xray.service
2023/07/07 21:02:40.568927 [INFO] Executing instruction: stop proxy
2023/07/07 21:02:40.568972 [INFO] Running command /bin/sh -c systemctl show -p PartOf httpd.service
2023/07/07 21:02:40.583634 [WARN] deregisterProcess Warning: process httpd is not registered, skipping...

2023/07/07 21:02:40.583681 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2023/07/07 21:02:40.596425 [WARN] deregisterProcess Warning: process nginx is not registered, skipping...

2023/07/07 21:02:40.596447 [INFO] Executing instruction: FlipApplication
2023/07/07 21:02:40.596452 [INFO] Fetching environment variables...
2023/07/07 21:02:40.596590 [INFO] Purge old process...
2023/07/07 21:02:40.596614 [INFO] Removing /var/app/current/ if it exists
2023/07/07 21:02:40.596625 [INFO] Renaming /var/app/staging/ to /var/app/current/
2023/07/07 21:02:40.596646 [INFO] Register application processes...
2023/07/07 21:02:40.596649 [INFO] Registering the proc: web

2023/07/07 21:02:40.596662 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2023/07/07 21:02:40.611243 [INFO] Running command /bin/sh -c systemctl daemon-reload
2023/07/07 21:02:40.868646 [INFO] Running command /bin/sh -c systemctl reset-failed
2023/07/07 21:02:40.876829 [INFO] Running command /bin/sh -c systemctl is-enabled eb-app.target
2023/07/07 21:02:40.883970 [INFO] Copying file /opt/elasticbeanstalk/config/private/aws-eb.target to /etc/systemd/system/eb-app.target
2023/07/07 21:02:40.884865 [INFO] Running command /bin/sh -c systemctl enable eb-app.target
2023/07/07 21:02:41.150555 [INFO] Created symlink /etc/systemd/system/multi-user.target.wants/eb-app.target → /etc/systemd/system/eb-app.target.

2023/07/07 21:02:41.150584 [INFO] Running command /bin/sh -c systemctl start eb-app.target
2023/07/07 21:02:41.159484 [INFO] Running command /bin/sh -c systemctl enable web.service
2023/07/07 21:02:41.417299 [INFO] Created symlink /etc/systemd/system/multi-user.target.wants/web.service → /etc/systemd/system/web.service.

2023/07/07 21:02:41.417328 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2023/07/07 21:02:41.428057 [INFO] Running command /bin/sh -c systemctl is-active web.service
2023/07/07 21:02:41.435193 [INFO] Running command /bin/sh -c systemctl start web.service
2023/07/07 21:02:41.502443 [INFO] Executing instruction: start X-Ray
2023/07/07 21:02:41.502464 [INFO] X-Ray is not enabled.
2023/07/07 21:02:41.502468 [INFO] Executing instruction: start proxy with new configuration
2023/07/07 21:02:41.502491 [INFO] Running command /bin/sh -c /usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf
2023/07/07 21:02:41.538325 [INFO] nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
nginx: the configuration file /var/proxy/staging/nginx/nginx.conf syntax is ok
nginx: configuration file /var/proxy/staging/nginx/nginx.conf test is successful

2023/07/07 21:02:41.538454 [INFO] Running command /bin/sh -c cp -rp /var/proxy/staging/nginx/* /etc/nginx
2023/07/07 21:02:41.543639 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2023/07/07 21:02:41.559986 [INFO] Running command /bin/sh -c systemctl daemon-reload
2023/07/07 21:02:41.961424 [INFO] Running command /bin/sh -c systemctl reset-failed
2023/07/07 21:02:41.972584 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2023/07/07 21:02:41.989386 [INFO] Running command /bin/sh -c systemctl is-active nginx.service
2023/07/07 21:02:42.002678 [INFO] Running command /bin/sh -c systemctl start nginx.service
2023/07/07 21:02:42.121357 [INFO] Executing instruction: configureSqsd
2023/07/07 21:02:42.121374 [INFO] This is a web server environment instance, skip configure sqsd daemon ...
2023/07/07 21:02:42.121378 [INFO] Executing instruction: startSqsd
2023/07/07 21:02:42.121382 [INFO] This is a web server environment instance, skip start sqsd daemon ...
2023/07/07 21:02:42.121385 [INFO] Executing instruction: Track pids in healthd
2023/07/07 21:02:42.121389 [INFO] This is an enhanced health env...
2023/07/07 21:02:42.121402 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf aws-eb.target | cut -d= -f2
2023/07/07 21:02:42.132130 [INFO] healthd.service nginx.service cfn-hup.service

2023/07/07 21:02:42.132163 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf eb-app.target | cut -d= -f2
2023/07/07 21:02:42.141973 [INFO] web.service

2023/07/07 21:02:42.142045 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 1
2023/07/07 21:02:43.144366 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 2
2023/07/07 21:02:45.144554 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 3
2023/07/07 21:02:48.144706 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 4
2023/07/07 21:02:52.147801 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 5
2023/07/07 21:02:57.148022 [ERROR] update processes [web healthd nginx cfn-hup] pid symlinks failed with error read pid source file /var/pids/web.pid failed with error:open /var/pids/web.pid: no such file or directory
2023/07/07 21:02:57.148068 [ERROR] An error occurred during execution of command [app-deploy] - [Track pids in healthd]. Stop running the command. Error: update processes [web healthd nginx cfn-hup] pid symlinks failed with error read pid source file /var/pids/web.pid failed with error:open /var/pids/web.pid: no such file or directory

2023/07/07 21:02:57.148071 [INFO] Executing cleanup logic
2023/07/07 21:02:57.148271 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment successfully generated a 'Procfile'.","timestamp":1688763757767,"severity":"INFO"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1688763777148,"severity":"ERROR"}]}]}

2023/07/07 21:02:57.148461 [INFO] Platform Engine finished execution on command: app-deploy

2023/07/07 21:08:47.692917 [INFO] Starting...
2023/07/07 21:08:47.692963 [INFO] Starting EBPlatform-PlatformEngine
2023/07/07 21:08:47.692983 [INFO] reading event message file
2023/07/07 21:08:47.693113 [INFO] Engine received EB command cfn-hup-exec

2023/07/07 21:08:47.776277 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBAutoScalingGroup --region us-east-1
2023/07/07 21:08:48.158455 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:537214917058:stack/awseb-e-7swiuaswft-stack/6fad3ec0-1d09-11ee-bde5-0e6f72f736b3 -r AWSEBBeanstalkMetadata --region us-east-1
2023/07/07 21:08:48.484104 [INFO] checking whether command bundle-log is applicable to this instance...
2023/07/07 21:08:48.484119 [INFO] this command is applicable to the instance, thus instance should execute command
2023/07/07 21:08:48.484122 [INFO] Engine command: (bundle-log)

2023/07/07 21:08:48.484165 [INFO] Executing instruction: GetBundleLogs
2023/07/07 21:08:48.484168 [INFO] Bundle Logs...
 
Posted : 07/07/2023 11:18 pm
SSAdvisor
(@ssadvisor)
Posts: 936
Noble Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 
2023/07/07 21:02:42.142045 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 1
2023/07/07 21:02:43.144366 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 2
2023/07/07 21:02:45.144554 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 3
2023/07/07 21:02:48.144706 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 4
2023/07/07 21:02:52.147801 [WARN] Failed to read file /var/pids/web.pid, retry attempt: 5
2023/07/07 21:02:57.148022 [ERROR] update processes [web healthd nginx cfn-hup] pid symlinks failed with error read pid source file /var/pids/web.pid failed with error:open /var/pids/web.pid: no such file or directory
2023/07/07 21:02:57.148068 [ERROR] An error occurred during execution of command [app-deploy] - [Track pids in healthd]. Stop running the command. Error: update processes [web healthd nginx cfn-hup] pid symlinks failed with error read pid source file /var/pids/web.pid failed with error:open /var/pids/web.pid: no such file or directory
2023/07/07 21:02:57.148071 [INFO] Executing cleanup logic
2023/07/07 21:02:57.148271 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment successfully generated a 'Procfile'.","timestamp":1688763757767,"severity":"INFO"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1688763777148,"severity":"ERROR"}]}]}

Based on this I'm guessing that the user executing the service doesn't have access to store the web.pid. You should contact the service provider.

 

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 07/08/2023 1:36 am
Hasan Aboul Hasan
(@admin)
Posts: 963
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 

yeah, it may be permession, or the folder doesn't exist at all.

can you get the full logs, something like:

  1. Navigate to the management page for your environment.
  2. Choose 'Logs' in the sidebar.
  3. Click 'Request Logs'.
  4. Choose 'Last 100 lines' or 'Full Logs'. Note that 'Full Logs' will take longer to prepare and download.
  5. Download the logs and look for 'eb-engine.log' in the downloaded files.
 
Posted : 07/08/2023 3:43 am
SSAdvisor reacted
(@samuelson00)
Posts: 4
Active Member
Topic starter
 

@admin Hello Hasan, thanks so much for your comment. Please, note that the log presented here is the eb-engine.log. I tried attaching the file here but the site rejected it so I had to copy and paste everything here.

 
Posted : 07/08/2023 5:16 pm
(@samuelson00)
Posts: 4
Active Member
Topic starter
 

@ssadvisor Hello, thanks so much for your comment. I'm actually the one doing all of these. Frankly, I don't have a strong background in coding. Initially, I thought it'll be easy to deploy the zipped file but the AWS environment as a whole appears to be complicated, maybe it's because I'm a total newbie in this.

@Hasan actually used Streamlit to demonstrate in the video I watched but I needed something that I could exercise more control, and then I discovered AWS EB (was actually searching for free webapp hosting). So, I had to rewrite the Python code using Flask framework. However, this whole AWS EB error thing has so frustrated me. I couldn't even find any good help on YouTube because the 502 Bad Gateway error from Nginx probably means a different thing to different situations.

I just feel bad. I wanted to see this working.

 
Posted : 07/08/2023 5:32 pm
SSAdvisor
(@ssadvisor)
Posts: 936
Noble Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 

@samuelson00 As I mentioned already the issue is that the process cannot write to the expected PID control file. This is related to a service trying to start your python code. I've not use AWS and haven't had experience with NGINX which is the service requiring PID control. There are most likely environment variables that you could set to start the service differently. Do you have root access to the server? Maybe consider using https://www.pythonanywhere.com/pricing/  instead.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 07/08/2023 10:39 pm
(@samuelson00)
Posts: 4
Active Member
Topic starter
 

@ssadvisor Thank you for your comment once again. It appears I've been able to resolve the PID control issues. Sadly, the error has transitioned to 504 Gateway Time-out.

Any ideas what I can do?

Here's the error log: https://drive.google.com/file/d/1sL3QLhobwFDcx5KFkFmr2mch7Q1HMxdP/view?usp=sharing

 
Posted : 07/11/2023 11:21 am
SSAdvisor
(@ssadvisor)
Posts: 936
Noble Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 

@samuelson00 I don't see anything in the file you provided. However, take a look at https://repost.aws/knowledge-center/504-error-alb

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 07/11/2023 11:02 pm
Samuel W reacted
Share: