Rails - AWS elastic beanstalk failed to deploy - ruby-on-rails

I tried to deploy my rails app to aws elastic beanstalk but got stuck with this error
[INFO] Job for worker.service failed because the control process exited with error code.
See "systemctl status worker.service" and "journalctl -xe" for details.
[ERROR] An error occurred during execution of command [app-deploy] - [flip ruby application].
Stop running the command. Error: register application failed because the registration of proc worker failed:
startProcess Failure: starting process "worker" failed:
Command /bin/sh -c systemctl start worker.service failed with error exit status 1.
Stderr:Job for worker.service failed because the control process exited with error code.
See "systemctl status worker.service" and "journalctl -xe" for details.
[INFO] Executing cleanup logic
[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 failed. For details, see 'eb-engine.log'.",
"timestamp":1675150429219,"severity":"ERROR"}]}]}
[INFO] Platform Engine finished execution on command: app-deploy
Can anyone help me with this? I can provide any Info you want me to share

Related

OOM when building quarkus native application

Not sure what am I missing? After reading multiple blogs and StackOverflow questions, I tried increasing the memory to Xmx12G but with no success. I keep getting msg to increase memory.
Has anyone faced the issue in the recent past and is it been solved?
This is just the plain application downloaded directly from the quarkus website.
docker run --env LANG=C --rm -v qaurkus-test/target/qaurkus-test-1.0.0-SNAPSHOT-native-image-source-jar:/project:z --name build-native-bkbGA quay.io/quarkus/ubi-quarkus-native-image:21.2-java11 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -jar qaurkus-test-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -J-Xmx12G -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-UseServiceLoaderFeature -H:+StackTrace -H:-ParseOnce qaurkus-test-1.0.0-SNAPSHOT-runner
[qaurkus-test-1.0.0-SNAPSHOT-runner:25] classlist: 6,968.00 ms, 0.94 GB
[qaurkus-test-1.0.0-SNAPSHOT-runner:25] (cap): 534.58 ms, 0.94 GB
[qaurkus-test-1.0.0-SNAPSHOT-runner:25] setup: 2,329.28 ms, 0.94 GB
The bundle named: messages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
19:29:29,666 INFO [org.jbo.threads] JBoss Threads version 3.4.2.Final
Error: Image build request failed with exit status 137
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.324 s
[INFO] Finished at: 2021-09-01T00:59:39+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.2.1.Final:build (default) on project qaurkus-test: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:235)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.lang.RuntimeException: Image generation failed. Exit code was 137 which indicates an out of memory error. Consider increasing the Xmx value for native image generation by setting the "quarkus.native.native-image-xmx" property
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:372)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:205)
[ERROR] ... 11 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Finally, got it working.
check how much memory docker is allocated using docker stats command
Follow the process mentioned in the post and increase it to atleast 8G, in my case max memory consumed was around 7G

Elasticbeanstalk Deployment Fails

I am trying to deploy a docker based environment that is using 1-1 application load balancer in AWS elasticbeanstalk. I am getting the below error message. It seemed to deploy very well before but for unknown reasons the new deploys fail.
2019-01-31 18:52:23 INFO Environment update is starting.
2019-01-31 18:53:03 INFO Deploying new version to instance(s).
2019-01-31 18:53:12 INFO Successfully pulled node:10.15.0
2019-01-31 18:57:34 INFO Successfully built aws_beanstalk/staging-app
2019-01-31 18:57:42 ERROR Failed to start nginx, abort deployment
2019-01-31 18:57:44 ERROR [Instance: i-0d4b3811324b90c27] Command failed on instance. Return code: 1 Output: nginx: [emerg] no host in upstream ":8080" in /etc/nginx/conf.d/elasticbeanstalk-nginx-docker-upstream.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed
Failed to start nginx, abort deployment.
Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/01flip.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-01-31 18:57:45 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-01-31 18:57:45 ERROR Unsuccessful command execution on instance id(s) 'i-0d4b3811324b90c27'. Aborting the operation.
2019-01-31 18:57:45 ERROR Failed to deploy application.
This issue was caused of an Uncaught error in my Node js application. Issue is not with Beanstalk.

JENKINS: Unable to load the mojo 'test'

When I am running build from jenkins. I am getting below error.The command I am running is mvn -P dev clean install
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project OMS: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
[ERROR] while locating org.apache.maven.plugin.surefire.SurefirePlugin
[ERROR] at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test
But if I run the same command on the build machine manually. The build is getting successful. why I am getting error? I can't make the changes into pom as it is building successful while running mvn command directly.

Failed to execute fabric8 docker plugin

Running mvn clean install pulls up this error( Windows)
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.20.1:start (prepare-environment) on project integration-test: Execution prepare-environment of goal io.fabric8:docker-maven-plugin:0.20.1:start failed: Start-Job failed with unexpected exception: [sebp/elk:latest] "elk": Timeout after 120365 ms while waiting on url http://localhost:32774/

jhipster - error executing task :bower

I am having an issue building my app based off jhipster, using gradle. It fails on task :bower. The exact error I get is:
./gradlew bower --debug
20:23:46.154 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':bower'.
20:23:46.174 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'node''. Working directory: /workplace/zupus Command: node /workplace/zupus/node_modules/bower/bin/bower install
20:23:46.174 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'node'': {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jav a-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin, CMD_DURATION=7.19s, XAUTHORITY=/home/brendan/.Xauthority, __fish_help_dir=/usr/share/doc/fish, XMODIFIERS=#im=i bus, XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/, GDMSESSION=ubuntu, MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path, TEXTDOMAINDIR=/usr/share/locale/, GTK _IM_MODULE=ibus, DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-2jqL9U4Ofh, DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path, XDG_CURRENT_DESKTOP=Unity, SSH_AGENT_PID=2238, COLORTERM=gn ome-terminal, QT4_IM_MODULE=xim, UPSTART_SESSION=unix:abstract=/com/ubuntu/ups tart- session/1000/2169, SESSION_MANAGER=local/brendan-home:#/tmp/.ICE-unix/2337,unix/brendan-home:/tmp/.ICE-unix/233 7, LOGNAME=brendan, JOB=dbus, PWD=/workplace/zupus, IM_CONFIG_PHASE=1, DERBY_HOME=/usr/lib/jvm/java-8-oracle/db, LANGUAGE=en_US, WINDOWID=75497483, SHELL=/usr/bin/fish, __fish_bin_di r=/usr/bin, INSTANCE=, J2SDKDIR=/usr/lib/jvm/java-8-oracle, OLDPWD=/wor kplace/zupus, GNOME_DESKTOP_SESSION_ID=this-is-deprecated, J2REDIR=/usr/lib/jvm/java-8-oracle/jre, GTK_MODULES=overlay-scroll bar:unity-gtk-module, CLUTTER_IM_MODULE=xim, TEXTDOMAIN=im-config, XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0, COMPIZ_BIN_PATH=/usr/bin/, SESSIONTYPE=gnome-session , LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41: sg =30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*. taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;3 1: *.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*. deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpi o= 01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm= 01;35:*. pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.sv gz =01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.m kv=01;35:* .webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.a sf =01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl =01;35:*. dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx= 01 ;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3= 00;36:*. mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:, SSH_AGENT_LAUNC HE R=upstart, SHLVL=1, __fish_sysconfdir=/etc/fish, COMPIZ_CONFIG_PROFILE=ubuntu, QT_IM_MODULE=ibus, JAVA_HOME=/usr/lib/jvm/java-8-oracle, TERM=xterm, XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt , XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg, LANG=en_US .UTF-8, XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0, GNOME_KEYRING_CONTROL=/run/user/1000/keyring-k4czcd, XDG_S ES SION_ID=c2, SELINUX_INIT=YES, DISPLAY=:0, NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript, GDM_LANG=en_US, UBUNTU_MENUPROXY=1, XDG_ GR EETER_DATA_DIR=/var/lib/lightdm-data/brend an, DESKTOP_SESSION=ubuntu, GPG_AGENT_INFO=/run/user/1000/keyring-k4czcd/gpg:0:1, SESSION=ubuntu, USER=brendan, XDG_MENU_PREFIX=gnome-, VTE _V ERSION=3409, XDG_SEAT=seat0, SSH_AUTH_SOCK =/run/user/1000/keyring-k4czcd/ssh, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, QT_QPA_PLATFORMTHEME=appmenu-qt5, XDG_RUNTIME_DIR=/run/user/1000, XDG_VT NR =7, HOME=/home/brendan, __fish_datadir=/us r/share/fish, GNOME_KEYRING_PID=2165 }
20:23:46.175 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
20:23:46.175 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process start ed: command 'node'.
20:23:46.179 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
20:23:46.179 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are h a ndled...
20:23:46.179 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started proces s 'command 'node''
20:23:46.187 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
20:23:46.188 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'node'' fi nished with exit value 1 (state: FAILED)
20:23:46.188 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] F in ished executing task ':bower'
20:23:46.188 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :bower FAILED
20:23:46.189 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :bower (Thread[mai n,5,main]) completed. Took 0.036 secs.
20:23:46.189 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor ] Task worker [Thre ad[main,5,main]] finished, busy: 0.899 secs, idle: 0.001 secs
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter]
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception .
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter]
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':bower'.
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter] > Process 'command 'node'' finished wit h non-zero exit value 1
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter]
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
20:23:46.195 [LIFECYCLE] [org.gradle.BuildResultLogger]
20:23:46.196 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
20:23:46.196 [LIFECYCLE] [org.gradle.BuildResultLogger]
20:23:46.197 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 3.275 secs
I have a feeling it has to do with global vs local npm installs, but I'm scratching my head about how to fix it or even find the error. I'm hoping someone else can save me from more hours of frustration.
Thanks
Fixed this eventually, if anyone else stumbles across this the answer was that I had to uninstall node (i.e. sudo apt-get remove node) and leave nodejs in place. You should see this:
user#user /w/zupus> which node
/usr/bin/node
user#user /w/zupus> which nodejs
/usr/bin/nodejs
This is my quick and dirty fix on Mac OS:
I just ran npm install bower as sudo
sudo npm install -g bower
I used windows 7 and got this error. I was able to fix this issue by installing Git. Make sure that you close the current command prompt window and try again.
just do npm install bower in project root directory where bower.json file should present.

Resources