Health degraded after downgrading php version for my ZF2 Application - amazon-web-services

I am trying to setup elastic beanstalk. After selecting PHP 5.6 my application is not deploying and showing the below errors and also my health is showing degraded -
i-08a5a7a9b027a7de9 Severe 16 hours 4 -- -- -- -- -- -- -- -- -- -- 0.00 0.00 0.1 0.0 99.9 0.0
Application update failed at 2019-07-25T13:30:00Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed.
. /opt/elasticbeanstalk/support/envvars-wrapper.sh
++ set +x
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
EB_APP_STAGING_DIR=/var/app/ondeck
cd /var/app/ondeck
'[' -f composer.json ']'
export COMPOSER_HOME=/root
COMPOSER_HOME=/root
'[' -d vendor ']'
++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options
PHP_COMPOSER_OPTIONS=
echo 'Found composer.json file. Attempting to install vendors.'
Found composer.json file. Attempting to install vendors.
composer.phar install --no-ansi --no-interaction
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error: Out of memory (allocated 755761152) (tried to allocate 134217728 bytes) in phar:///opt/elasticbeanstalk/support/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220
Fatal error: Out of memory (allocated 755761152) (tried to allocate 134217728 bytes) in phar:///opt/elasticbeanstalk/support/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220.
Incorrect application version "Sample Application-3" (deployment 4). Expected version "Sample Application" (deployment 1).
I have already tried to setup first a sample application and then tried to upload my app but didn't work

Try clearing composer cache on your instances, or rebuild environment. See if it helps

Related

Apache Zeppelin 0.7.3 - http error 503 in browser

Following the minimalist installation instructions from here, then on macOS High Sierra 10.13.1 executing:
bin/zeppelin-daemon.sh start
The daemon starts OK, but pointing any browser to http://localhost:8080 yields
HTTP ERROR: 503
Problem accessing /. Reason:
Service Unavailable
Powered by Jetty://
The same thing happens if I run as root, or if I run the browser as root, or if I install via homebrew (brew install apache-zeppelin).
Permissions problem?
What is a solution?
Thanks!
The workaround was:
Install Java 8, following How to set or change the default Java (JDK) version on OS X?, i.e.
brew tap caskroom/versions
brew cask install java8
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Then:
sudo bash
zeppelin-daemon.sh start
/Applications/Safari.app/Contents/MacOS/Safari
Point browser to:
http://localhost:8080
Success! Conclusions:
Zeppelin 0.7.3 only supports Java <= 8.0
zeppelin-daemon.sh must be run as root, but browser doesn't have to be
Install Java 1.8 as mentioned in the above post.
If we can give the super user password at the time of installing, we do not have to run as root every time. See below for the logs and the option to give password.
[ksurendranath#machine /usr/local/Cellar/apache-zeppelin/0.7.3/libexec/logs 10:54 AM ]$ brew cask install java8
==> Tapping caskroom/cask
Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 4057, done.
remote: Compressing objects: 100% (4022/4022), done.
remote: Total 4057 (delta 37), reused 824 (delta 31), pack-reused 0
Receiving objects: 100% (4057/4057), 1.39 MiB | 11.49 MiB/s, done.
Resolving deltas: 100% (37/37), done.
Tapped 0 formulae (4,066 files, 4.4MB)
==> Creating Caskroom at /usr/local/Caskroom
==> We'll set permissions properly so we won't need sudo in the future
Password:
Get the process info on the port you are using the Zeppelin server
1)sudo netstat -anp|grep 8080
2)sudo kill (ProcessID)
3)/zeppelin-server/bin/zeppelin-daemon.sh restart
This might help you

Shiny deployment error

When I am trying to deploy my shiny app at shinyapps.io I get below error :
> deployApp()
Preparing to deploy application...DONE
Uploading bundle for application: 187055...DONE
Deploying bundle: 857060 for application: 187055 ...
Waiting for task: 416072120
building: Processing bundle: 857060
building: Parsing manifest
building: Building image: 849457
building: Installing system dependencies
################################ Begin Task Log ################################
[2017-06-07T17:28:40.200495546+0000] Execute script: packages/build/nloptr.sh
+ set -e
+ VERSION=2.4.2
+ cd /tmp
+ curl -O http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0################################# End Task Log #################################
Error: Unhandled Exception: Child Task 416072122 failed: Error building image: Build exited with non-zero status: 56
Has anyone come across this error. Appreciate if someone help me on how to resolve this. I am using R version 3.4.0
Thanks,
It looks like your app require NLopt, but shinyapps.io failed to install the package. The package installation seemed to be some shell script which may not work in the shinyapps.io server(because of permission etc).
Basically the deployment process scan your file and environment, then try to duplicate the dependency packages in the server. If you used CRAN version the server will also install CRAN version, which should not need build from source or running some shell script. If you used github version server will also try to use github version or build from source, which could have more dependency requirement.
Another possibility is the R package is just the interface and you need to install the actual library, which failed to be installed in server.
R packages will often rely on operating system packages to be
installed on the server. If your application happens to use an R
package that requires a system library that is not installed by
default, please let us know by filing an issue, or a pull request, at
shinyapps-package-dependencies

How to install Google Cloud SDK on Travis?

I have tried to install Google Cloud SDK on Travis with the following .travis.yml
sudo: required
language: go
- curl https://sdk.cloud.google.com | bash;
My attempt is inspired by this guide from Google: https://cloud.google.com/solutions/continuous-delivery-with-travis-ci
Unfortunately, I get this output on Travis:
$ curl https://sdk.cloud.google.com | bash;
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 421 0 421 0 0 17820 0 --:--:-- --:--:-- --:--:-- 60142
Downloading Google Cloud SDK install script: https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash
######################################################################## 100.0%
Running install script from: /tmp/tmp.uz8jP70e56/install_google_cloud_sdk.bash
which curl
curl -# -f https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
######################################################################## 100.0%
Installation directory (this will create a google-cloud-sdk subdirectory) (/home/travis):
Travis waits for 10 minutes and then terminates the build. It seems like it is waiting for an installation directory.
How do I install Google Cloud SDK on Travis?
You are running into this issue because there is no interaction possible on Travis CI. Hence, the installation script is blocked waiting for input and Travis CI kills the build after 10 minutes.
The trick is to disable the prompts when installing the Google Cloud SDK. This can be done by setting the CLOUDSDK_CORE_DISABLE_PROMPTS environment variable to 1.
Here's a sample recipe to put in your .travis.yml file (including caching it for faster subsequent builds):
cache:
directories:
- "$HOME/google-cloud-sdk/"
script:
- gcloud version || true
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
# Add gcloud to $PATH
- source /home/travis/google-cloud-sdk/path.bash.inc
- gcloud version
Hope this helps!

Elastic Beanstalk application failing to deploy - existing application seemingly broken

We've been using EB for about a year, our main backend guy is not working with us at the moment. I've been deploying without any issues for the last 2 months, and today when I've tried to deploy I'm seeing this:
INFO: Environment update is starting. INFO: Deploying new version to
instance(s). ERROR: [Instance: i-dc773612,i-4073a981] Command failed
on instance. Return code: 1 Output:
[CMD-AppDeploy/AppDeployStage0/InfraWriteApp2] command failed with
error code 1: Error occurred during build: Command 01downloadVersion
failed. INFO: Command execution completed on all instances. Summary:
[Successful: 0, Failed: 2]. ERROR: [Instance: i-dc773612] Command
failed on instance. Return code: 1 Output:
[CMD-AppDeploy/AppDeployStage1/AppDeployEnactHook/01_flip.sh] command
failed with error code 1:
/opt/elasticbeanstalk/hooks/appdeploy/enact/01_flip.sh
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
+ EB_APP_STAGING_DIR=/var/app/ondeck
++ /opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir
+ EB_APP_DEPLOY_DIR=/var/app/current
+ '[' -d /var/app/current ']'
+ mv /var/app/current /var/app/current.old
+ mv /var/app/ondeck /var/app/current mv: cannot stat ‘/var/app/ondeck’: No such file or directory. INFO: Command execution
completed on 1 of 2 instances in environment. ERROR: [Instance:
i-4073a981] Command failed on instance. Return code: 1 Output:
[CMD-AppDeploy/AppDeployStage1/AppDeployEnactHook/01_flip.sh] command
failed with error code 1:
/opt/elasticbeanstalk/hooks/appdeploy/enact/01_flip.sh
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
+ EB_APP_STAGING_DIR=/var/app/ondeck
++ /opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir
+ EB_APP_DEPLOY_DIR=/var/app/current
+ '[' -d /var/app/current ']'
+ mv /var/app/current /var/app/current.old
+ mv /var/app/ondeck /var/app/current mv: cannot stat ‘/var/app/ondeck’: No such file or directory. INFO: Command execution
completed on 2 of 2 instances in environment. INFO: Command execution
completed on all instances. Summary: [Successful: 0, Failed: 2]. INFO:
New application version was deployed to running EC2 instances. ERROR:
Update environment operation is complete, but with errors. For more
information, see troubleshooting documentation. ERROR: Update
environment operation is complete, but with errors. For more
information, see troubleshooting documentation.
I have no idea why, as far as I can tell I've committed/deployed everything as I normally would.
I see the latest commit when I go into 'Application Versions' - and it would appear that is is deployed (it has the environment name next to the commit in the Deployed To column). However my mobile applications are no longer able to connect to the PHP files on the server, they keep getting 403 forbidden - even on files which were not changed in the last commit. It's as if the application is not there since the deploy failed.
Where should I go from here?
Edit: I've investigated a bit further, and the upload seemed to be successful as I can see the zip file is there. It's the deploy part itself which is failing. I've tried rebooting instances, as well as stopping instances and letting the load balancer create new ones. Still everything fails, although now I get a timeout. From start->timeout is taking less time that the timeout limit of 30 mins, the timeout happens in 5-10 mins.

Docker automated build results in Unexpected failure

I am trying to create an automated build with docker. What I have done is linked my bit-bucket repo in the docker hub and trying to build. The status of build is unexpected failure. Also, I see the below failure message:
{"error": "Image depends on an unauthorized parent"}
And interestingly, the logs says build successful.
Failure message
[Failure instance: Traceback: <type 'exceptions.RuntimeError'>: HTTP code 400 while uploading metadata: {"error": "Image depends on an unauthorized parent"}
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:382:callback
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:490:_startRunCallbacks
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:1155:gotResult
--- <exception caught here> ---
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:1097:_inlineCallbacks
/usr/local/lib/python2.7/dist- packages/twisted/python/failure.py:389:throwExceptionIntoGenerator
/app/builder.py:160:execute_job
/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks
/app/shared/tx/docker.py:295:on_done
]
Dockerfile
FROM ubuntu
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# Install vnc, xvfb in order to create a 'fake' display and firefox
RUN apt-get install -y x11vnc xvfb firefox
RUN mkdir /.vnc
# Setup a password
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
# Autostart firefox (might not be the best way, but it does the trick)
RUN bash -c 'echo "firefox" >> /.bashrc'
EXPOSE 5900
CMD ["x11vnc", "-forever", "-usepw", "-create"]
Logs
Step 0 : FROM ubuntu
Pulling image (quantal) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/ e314931015bd
....
....
Removing intermediate container c8e48d27a271
Step 8 : CMD ["x11vnc", "-forever", "-usepw", "-create"]
---> Running in d9319762cb0f
---> bd7eb37a7f78
Removing intermediate container d9319762cb0f
Successfully built bd7eb37a7f78
Update: The issue was fixed.
I just got an answer from the Docker support team. It's an issue on their side, which they are already investigating.
Unfortunately there isn't much you can do besides waiting.