How to start Scala Play application on Bluemix? - scala

I have basic Scala application on Play framework and I try to deploy it to IBM Bluemix. During deployment it shows next:
an instance of the app crashed: failed to accept connections within health check timeout
exit status: -1, CRASHED
My manifest.yml
applications:
- path: ./target/universal/scala-bluemix-1.0-SNAPSHOT.zip
memory: 512M
instances: 1
domain: eu-gb.mybluemix.net
name: TestApp1WithTotalyUniqueName
host: testapp1withtotalyuniquename
disk_quota: 1024M
I have already checked this link: http://blog.ibmjstart.net/2015/10/27/a-play-scala-server-running-on-ibm-bluemix/
Any ideas how to fix it?
Output from console:
2015-11-03T18:30:50.70+0200 [STG/0] OUT -----> Liberty buildpack is done creating the droplet
2015-11-03T18:30:51.31+0200 [STG/0] ERR
2015-11-03T18:31:00.89+0200 [STG/115] OUT -----> Uploading droplet (91M)
2015-11-03T18:31:11.91+0200 [DEA/115] OUT Starting app instance (index 0) with guid b634d704-85f2-4e42-b559-985de67c90ae
2015-11-03T18:31:30.09+0200 [App/0] OUT [info] - play.api.Play - Application started (Prod)
2015-11-03T18:31:30.23+0200 [App/0] OUT [info] - play.core.server.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
2015-11-03T18:32:22.04+0200 [DEA/115] ERR Instance (index 0) failed to start accepting connections
2015-11-03T18:32:22.05+0200 [API/7] OUT App instance exited with guid b634d704-85f2-4e42-b559-985de67c90ae payload: {"cc_partition"=>"default", "droplet"=>"b634d704-85f2-4e42-b559-985de67c90ae", "version"=>"1b3e8d86-501a-4679-9104-9a9dea063ccd", "instance"=>"19d1570c9865486985c6f159a90233dd", "index"=>0, "reason"=>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1446568342}
2015-11-03T18:32:22.07+0200 [App/0] ERR
2015-11-03T18:32:52.39+0200 [DEA/112] OUT Starting app instance (index 0) with guid b634d704-85f2-4e42-b559-985de67c90ae
2015-11-03T18:33:04.31+0200 [App/0] OUT [info] - play.api.Play - Application started (Prod)
2015-11-03T18:33:04.43+0200 [App/0] OUT [info] - play.core.server.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

And this line was missing in manifest.yml:
buildpack: java_buildpack

Related

Need help connecting to libera chat

I am having trouble connecting to libera.chat and irc.libera.chat using Konversation Version 1.8.21123 on Jammy Jellyfish (fully updated). I have worked through the steps given on https://userbase.kde.org/Konversatio...tication#step5 and still cannot connect. The repeating log is shown below.
[12:44] [Info] Looking for server irc.libera.chat (port 6697)...
[12:44] [Info] Server found, connecting...
[12:44] [Info] Negotiating capabilities with server...
[12:44] [Notice] -lithium.libera.chat- *** Checking Ident
[12:44] [Notice] -lithium.libera.chat- *** Looking up your hostname...
[12:44] [Notice] -lithium.libera.chat- *** Couldn't look up your hostname
[12:45] [Notice] -lithium.libera.chat- *** No Ident response
[12:45] [Capabilities] account-notify away-notify chghost extended-join multi-prefix sasl=PLAIN,ECDSA-NIST256P-CHALLENGE,EXTERNAL tls account-tag cap-notify echo-message server-time solanum.chat/identify-msg solanum.chat/oper solanum.chat/realhost
[12:45] [Info] Requesting capabilities: account-notify away-notify chghost extended-join multi-prefix sasl cap-notify server-time
[12:45] [Info] SASL capability acknowledged by server, attempting SASL PLAIN authentication...
[12:45] [Error] SASL authentication attempt failed.
[12:45] [Info] Closing capabilities negotiation.
[12:45] [Error] Connection to server irc.libera.chat (port 6697) lost: The TLS/SSL connection has been closed.
[12:45] [Info] Trying to reconnect to irc.libera.chat (port 6697) in 10 seconds.
[12:45] [Info] Looking for server irc.libera.chat (port 6697)...​ <-- Log repeats from this line.
Is there something blatant that I have overlooked ?
Is there some web page that I need to visit in order to register my ident/hostname/whatever (!) ?
Stuart
​

Keycloak 10 partially starts when run as a service

I have currently installed Keycloak 10.0.2 in domain mode with two servers on Ubuntu 18.04. When running manually as ./domain.sh --host-config=host-master.xml all the services start normally and the system works fine.
I wanted to run Keycloak as a service and followed the steps given in https://medium.com/#hasnat.saeed/setup-keycloak-server-on-ubuntu-18-04-ed8c7c79a2d9. The problem is that the service shows as Active but navigating to the management URL results The site can't be reached error. I checked the generated log file and it seems that the services have started only partially.
2020-06-26 12:53:52,164 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Keycloak 10.0.2 (WildFly Core 11.1.1.Final) (Host Controller) started in 12675ms - Started 83 of 86 services (28 services are lazy, passive or on-demand)
2020-06-26 12:53:52,238 INFO [org.jboss.as.host.controller] (server-registration-threads - 1) WFLYHC0020: Registering server server-one
Whereas when run manually I see that there are many more services that have started.
[Server:server-one] 13:44:34,349 INFO [org.jboss.as.server] (ServerService Thread Pool -- 36) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")
[Server:server-one] 13:44:34,463 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
[Server:server-one] 13:44:34,475 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Keycloak 10.0.2 (WildFly Core 11.1.1.Final) started in 30123ms - Started 673 of 979 services (703
services are lazy, passive or on-demand)
Not sure what is going wrong. Need help resolving the issue.
Here are my configuration details:
Service Details
keycloak.service - Keycloak Authentication Server
Loaded: loaded (/etc/systemd/system/keycloak.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-06-26 13:47:12 UTC; 2min 23s ago
Main PID: 116569 (launch.sh)
Tasks: 187 (limit: 9479)
CGroup: /system.slice/keycloak.service
├─116569 /bin/bash /data/keycloak/bin/launch.sh domain domain.xml host-master.xml 0.0.0.0 YES
├─116578 /bin/sh /data/keycloak/bin/domain.sh -c domain.xml --host-config=host-master.xml
/etc/keycloak/keycloak.conf
# The mode you want to run
WILDFLY_MODE=domain
# The configuration you want to run
WILDFLY_DOMAIN_CONFIG=domain.xml
# Host configuration
WILDFLY_HOST_CONFIG=host-master.xml
# The address to bind to
WILDFLY_BIND=0.0.0.0
# Whether this host is a domain controller. If not run with --backup switch
IS_DC=YES
/data/keycloak/bin/launch.sh
#!/bin/bash
WILDFLY_HOME="/data/keycloak"
if [[ "$1" == "domain" ]]; then
if [[ "$5" == "YES" ]]; then
$WILDFLY_HOME/bin/domain.sh -c $2 --host-config=$3
else
$WILDFLY_HOME/bin/domain.sh -c $2 --host-config=$3 --backup
fi
else
$WILDFLY_HOME/bin/standalone.sh -c $2 -b $4
fi
/etc/systemd/system/keycloak.service
[Unit]
Description=Keycloak Authentication Server
After=syslog.target network.target
Before=httpd.service
[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-/etc/keycloak/keycloak.conf
User=keycloak
Group=keycloak
LimitNOFILE=102642
PIDFile=/var/run/keycloak/keycloak.pid
ExecStart=/data/keycloak/bin/launch.sh $WILDFLY_MODE $WILDFLY_DOMAIN_CONFIG $WILDFLY_HOST_CONFIG $WILDFLY_BIND $IS_DC
StandardOutput=null
[Install]
WantedBy=multi-user.target
I also followed the same Medium tutorial and faced the same issue as you. Turns out that I have to run the service as root user instead of keycloak user. I have no idea why though.

Ejabberd with Jitsi Videobridge ejabberd_service Failed external component handshake authentication

I want to use the Ejabberd with Jitsi Videobridge. When i configured the Ejabberd service and start the Jitsi Videobridge both side thrown the exception.
My ejabberd.yml
port: 5275
ip: "0.0.0.0"
module: ejabberd_service
access: all
shaper_rule: fast
ip: "127.0.0.1"
privilege_access:
roster: "both"
message: "outgoing"
presence: "roster"
delegations:
"urn:xmpp:mam:1":
filtering: ["node"]
"http://jabber.org/protocol/pubsub":
filtering: []
hosts:
"jitsi-videobridge.[mydomain]":
password: "587828"
start Jitsi Videobridge like below
HOST="127.0.0.1"
DOMAIN="mydomain"
PORT="5275"
SECRET="abcdef123"
JVB_HOME="/usr/src/ejabberd/jitsi-videobridge"
mvn compile exec:java -Dexec.args="--host=$HOST --domain=$DOMAIN --port=$PORT --secret=$SECRET" -Djava.library.path=$JVB_HOME/lib/native/linux-64 -Djava.util.logging.config.file=$JVB_HOME/lib/logging.properties -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=.jitsi-videobridge
The ejabberd exception:
17-10-17 23:29:44.719 [info] <0.336.0>#ejabberd_listener:accept:302 (<0.521.0>) Accepted connection 127.0.0.1:39506 -> 127.0.0.1:5275
2017-10-17 23:29:44.721 [info] <0.522.0>#ejabberd_service:handle_auth_failure:173 (tcp|<0.521.0>) Failed external component handshake authentication for jitsi-videobridge.mydomain from 127.0.0.1: not authorized
2017-10-17 23:55:20.459 [info] <0.336.0>#ejabberd_listener:accept:302 (<0.549.0>) Accepted connection 127.0.0.1:51580 -> 127.0.0.1:5275
2017-10-17 23:55:20.474 [info] <0.550.0>#ejabberd_service:handle_auth_failure:173 (tcp|<0.549.0>) Failed external component handshake authentication for jitsi-videobridge.mydomain from 127.0.0.1: not authorized
2017-10-17 23:55:25.484 [info] <0.336.0>#ejabberd_listener:accept:302 (<0.551.0>) Accepted connection 127.0.0.1:51618 -> 127.0.0.1:5275
2017-10-17 23:55:25.487 [info] <0.552.0>#ejabberd_service:handle_auth_failure:173 (tcp|<0.551.0>) Failed external component handshake authentication for jitsi-videobridge.mydomain from 127.0.0.1: not authorized
Videobridge exception like :
SEVERE: not-authorized, host:127.0.0.1, port:5275
org.xmpp.component.ComponentException: not-authorized
at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:243)
at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentManager.java:242)
at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentManager.java:222)
at org.jitsi.meet.ComponentMain$3.call(ComponentMain.java:270)
at org.jitsi.meet.ComponentMain$3.call(ComponentMain.java:255)
at org.jitsi.retry.RetryStrategy$TaskRunner.run(RetryStrategy.java:193)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Can anybody help?
Thank you!
orgin:
hosts:
"jitsi-videobridge.[mydomain]":
password: "587828"
the correct configure:
hosts:
"jitsi-videobridge.[mydomain]":
password: "587828"

IoTP boilerplate application not working after Diego migration

After migrating my Watson IoTP boilerplate application to Diego, it not longer starts. I see this in the log:
[APP/0] OUT Welcome to Node-RED
[APP/0] OUT ===================
[APP/0] OUT 18 Jan 15:43:16 - [info] Node-RED version: v0.15.3
[APP/0] OUT 18 Jan 15:43:16 - [info] Node.js version: v4.6.2
[APP/0] OUT 18 Jan 15:43:16 - [info] Linux 4.4.0-45-generic x64 LE
[APP/0] OUT 18 Jan 15:43:16 - [info] Loading palette nodes
[APP/0] OUT 18 Jan 15:43:18 - [warn] [ibm hdfs in] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0] OUT 18 Jan 15:43:18 - [warn] [ibm hdfs] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0] OUT 18 Jan 15:43:18 - [warn] [ibmpush] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0] OUT 18 Jan 15:43:20 - [info] Settings file : /home/vcap/app/bluemix-settings.js
[APP/0] OUT 18 Jan 15:43:20 - [info] Server now running at http://127.0.0.1:`**1880**`/red/
[APP/0] OUT 18 Jan 15:43:20 - [info] Starting flows
[APP/0] OUT 18 Jan 15:43:20 - [info] Started flows
[CELL/0] ERR Timed out after 1m0s: health check never passed.
[CELL/0] OUT Exit status 0
[CELL/0] OUT Destroying container
[API/8] OUT App instance exited with guid ca3f2bbd-ac6e-42ec-8a61-1ff704274c3e payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* Exited with status 4\n* 2 error(s) occurred:\n\n* cancelled\n* process did not exit", "crash_count"=>2, "crash_timestamp"=>1484754267594231230, "version"=>"0361fa77-694c-4e8f-991e-0c52dd0c4c87"}
How can I fix this ?
The problem is that the way apps find the port to bind to has changed with Diego. The VCAP_APP_PORT environment variable is no longer populated by default. To fix it, you need to create a git repo for your app (Overview tab -> Continuous Delivery -> Add GIT). Use jazzhub to edit the bluemix-settings.js file to change
uiPort: process.env.VCAP_APP_PORT
to
uiPort: process.env.PORT
Deploy those changes and the app should start.
I had a similar issue with a npm express app and fixed it without having to edit the bluemix-settings.js file.
Simple remove all references to process.env.VCAP_APP_HOST (no longer a reference in Diego) and change process.env.VCAP_APP_PORT to process.env.PORT.
for example,
var host = 'localhost';
var port = (process.env.PORT || 1337);
app.listen(port, host);
console.log('App started on port ' + port);
You can check to see if your app is running Diego by typing:
cf has-diego-enabled APPNAME
after installing the diego cli tool
cf install-plugin Diego-Enabler -r CF-Community
I also disabled health checks:
cf set-health-check APPNAME none

Deploy on Heroku using Scalatra

I am trying to deploy my Scalatra web application in heroku but I am having one problem.
My application works in local with SBT and using "heroku local web". I am using heroku sbt plugin.
When I use "sbt stage deployHeroku" the application is uploaded and started properly, obtaining:
user#user-X550JF:~/Documents/SOFT/cloudrobe$ sbt stage deployHeroku
Detected sbt version 0.13.9
....
....
[info] Packaging /home/user/Documents/SOFT/cloudrobe/target/scala-2.11/cloudrobe_2.11-0.1.0-SNAPSHOT.war ...
[info] Done packaging.
[success] Total time: 2 s, completed May 25, 2016 1:04:51 AM
[info] -----> Packaging application...
[info] - app: cloudrobe
[info] - including: target/universal/stage/
[info] -----> Creating build...
[info] - file: target/heroku/slug.tgz
[info] - size: 45MB
[info] -----> Uploading slug... (100%)
[info] - success
[info] -----> Deploying...
[info] remote:
[info] remote: -----> Fetching set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/jvm-common.tgz... done
[info] remote: -----> sbt-heroku app detected
[info] remote: -----> Installing OpenJDK 1.8... done
[info] remote:
[info] remote: -----> Discovering process types
[info] remote: Procfile declares types -> web
[info] remote:
[info] remote: -----> Compressing...
[info] remote: Done: 93.5M
[info] remote: -----> Launching...
[info] remote: Released v11
[info] remote: https://cloudrobe.herokuapp.com/ deployed to Heroku
[info] remote:
[info] -----> Done
___________________________________________________________________________
Using "heroku logs" I can see:
2016-05-24T23:14:16.007200+00:00 app[web.1]: 23:14:16.006 [main] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:5, serverValue:5}] to localhost:33333
2016-05-24T23:14:16.370324+00:00 app[web.1]: 23:14:16.370 [main] INFO o.f.s.servlet.ServletTemplateEngine - Scalate template engine using working directory: /tmp/scalate-5146893161861816095-workdir
2016-05-24T23:14:16.746719+00:00 app[web.1]: 23:14:16.746 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#7a356a0d{/,file:/app/src/main/webapp,AVAILABLE}
2016-05-24T23:14:16.782745+00:00 app[web.1]: 23:14:16.782 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#7dc51783{HTTP/1.1}{0.0.0.0:8080}
2016-05-24T23:14:16.782924+00:00 app[web.1]: 23:14:16.782 [main] INFO org.eclipse.jetty.server.Server - Started #6674ms
But, 5 or 10 seconds later appears the following error showing that the connection has been timed out:
2016-05-24T23:52:32.962896+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=cloudrobe.herokuapp.com request_id=a7f68d98-54a2-44b7-8f5f-47efce0f1833 fwd="52.90.128.17" dyno= connect= service= status=503 bytes=
2016-05-24T23:52:45.463575+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
This is my Procfile using the port 5000:
web: target/universal/stage/bin/cloudrobe -Dhttp.address=127.0.0.1
Thank you.
Your app is binding to port 8080, but it needs to bind to the port set as the $PORT environment variable on Heroku. To do this, you need to add -Dhttp.port=$PORT to your Procfile. It also needs to bind to 0.0.0.0 and not 127.0.0.1. So it might look like this:
web: target/universal/stage/bin/cloudrobe -Dhttp.address=0.0.0.0 -Dhttp.port=$PORT