Cargo Tomcat 7.X not stopping - tomcat7

Here is my configuration in gradle file for cargo.
cargo {
containerId = 'tomcat7x'
port = httpPort.toInteger()
local {
homeDir = file(cargoHome)
configHomeDir = file(cargoHome)
jvmArgs = 'Dcom.sun.management.jmxremote.port=9092
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -'
installer {
installUrl = 'https://installdirectory/content/groups/public/org/apache/tomcat/tomcat/7.0.57/tomcat-7.0.57.zip'
downloadDir = file("$buildDir/download")
extractDir = file("$buildDir/extract")
}
containerProperties { property 'cargo.tomcat.ajp.port', portFinder.nextAvailable}
extraClasspath = files("../service/service-1.0.0-LOCAL-local.jar",configurations.cargoruntime) }}
Following error it's shows in log while running cargoStopLocal task
WARNING: StandardServer.await: Invalid command '' received
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9092; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
Nov 20, 2015 4:32:34 PM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
can anyone guide me how to handle this issue , it's not stopping cargo server so my build is failing?

Related

Unable to execute sonarqube scanner with jenkins

I am unable to execute the sonarqube scanner with Jenkins pipeline script.
sonarqube scanner version : 3.3.0
Please suggest.
stage('SonarQube analysis 3') {
steps {
withSonarQubeEnv('sonarqube') {
echo "${SONAR_HOST_URL}"
sh "/var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonarQScanner/bin/sonar-scanner -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_USERNAME} -Dsonar.password = ${SONAR_PASSWORD} -Dsonar.projectName=HelloWorldMavenProj -Dsonar.projectVersion=4.0 -Dsonar.projectKey=HelloWorldMavenProjKey -Dsonar.sources=/var/lib/jenkins/workspace/SonarPipelineTest"
}}}
Error :
/var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonarQScanner/bin/sonar-scanner -Dsonar.host.url=http://xxxxx:9000 -Dsonar.login=admin -Dsonar.password = admin -Dsonar.projectName=HelloWorldMavenProj -Dsonar.projectVersion=4.0 -Dsonar.projectKey=HelloWorldMavenProjKey -Dsonar.sources=/var/lib/jenkins/workspace/SonarPipelineTest
ERROR: Unrecognized option: =

Any haskell stack command fails on windows with this: HostCannotConnect "127.0.0.1"

For example:
> stack ghci
Writing implicit global project config file to: C:\sr\global-project\stack.yaml
Note: You can change the snapshot via the resolver field there.
HttpExceptionRequest Request {
host = "s3.amazonaws.com"
port = 443
secure = True
requestHeaders = [("Accept","application/json")]
path = "/haddock.stackage.org/snapshots.json"
queryString = ""
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(InternalException (HostCannotConnect "127.0.0.1" [Network.Socket.connect: <socket: 508>: failed (Connection refused (WSAECONNREFUSED))]))
The curl command form the same console have no problems with resolving the url
> curl https://s3.amazonaws.com/haddock.stackage.org/snapshots.json
StatusCode : 200
StatusDescription : OK
Content : {"lts-2":"lts-2.22","lts-10":"lts-10.9","lts-9":"lts-9.21","lts-4":"lts-4.2","lts-3":"lts-3.22","lts-5":"lts-5.18","lts":"lts-11.0","lts-0":"lts-0.7","nightly":"nightly-2018-03-16","lts-1":"lts-1.15",
....
Tried to install the same version on the other PC - no such problem.
Any ideas?
Setting this registry key to 0 helped:
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable

reconcile unable to talk with Consul backend

Im trying to setup a docker container for my vault/consul but get the following error:-
2017/06/22 18:15:58.335293 [WARN ] physical/consul: reconcile unable to talk with Consul backend: error=service registration failed: Put http://127.0.0.1:8500/v1/agent/service/register: dial tcp 127.0.0.1:8500: getsockopt: connection refused
Here is my vault config file.
storage "consul" {
address = "127.0.0.1:8500"
redirect_addr = "http:/127.0.0.1:8500"
path = "vault"
scheme = "http"
}
listener "tcp" {
address = "127.0.0.1:8200"
tls_disable = 1
}
#telemetry {
# statsite_address = "127.0.0.1:8125"
# disable_hostname = true
#}
where is Consul?
This error is saying I'm trying to reach this URL: http://127.0.0.1:8500/v1/agent/service/register and can't.
This implies that either Consul isn't running, or it's running somewhere other than at http://127.0.0.1:8500
Find your consul, and then update your config to point to it.

geb.Browser is trying to use FirefoxDriver instead of PhatomJSDriver

For some reason, my code tries to use the firefox browser when it should be using phantomjs.
My groovy code looks like this:
import geb.Browser
...
env = System.getenv()
def username = env.username
def password = env.password
def gateway = env.gateway
def matcher = gateway =~ /^(https?:\/\/)([^:^\/]*)(:\d*)?(.*)?.*$/
def host = matcher[0][2]
def port = matcher[0][3]
if (env.driver == 'firefox') {
driver = new FirefoxDriver()
} else {
println env.phantomjspath
def caps = DesiredCapabilities.phantomjs()
caps.setCapability(
PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, env.phantomjspath
)
driver = new PhantomJSDriver(caps)
driver.manage().window().setSize(new Dimension(1028, 768))
}
def browser = new Browser(driver: driver)
BiHome = "https://" + username + ":" + password + "#" + host + port + "/gateway/default/BigInsightsWeb/#/welcome"
browser.drive {
go BiHome
// code omitted for brevity
}
browser.close()
Unfortunately, for some reason geb.Browser is trying to use the FirefoxDriver:
:CheckHomePhantomJS
/Users/snowch/Repos/biginsight-examples2/examples/BiginsightsHome/build/webdriver/phantomjs/bin/phantomjs
May 10, 2016 10:13:57 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: executable: /Users/snowch/Repos/biginsight-examples2/examples/BiginsightsHome/build/webdriver/phantomjs/bin/phantomjs
May 10, 2016 10:13:57 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: port: 19084
May 10, 2016 10:13:57 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: arguments: [--webdriver=19084, --webdriver-logfile=/Users/snowch/Repos/biginsight-examples2/examples/BiginsightsHome/phantomjsdriver.log]
May 10, 2016 10:13:57 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: environment: {}
PhantomJS is launching GhostDriver...
[INFO - 2016-05-10T09:13:58.925Z] GhostDriver - Main - running on port 19084
[INFO - 2016-05-10T09:13:59.117Z] Session [8784a390-168f-11e6-bcd7-a7a5f8e205b1] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2016-05-10T09:13:59.117Z] Session [8784a390-168f-11e6-bcd7-a7a5f8e205b1] - page.customHeaders: - {}
[INFO - 2016-05-10T09:13:59.117Z] Session [8784a390-168f-11e6-bcd7-a7a5f8e205b1] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2016-05-10T09:13:59.117Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 8784a390-168f-11e6-bcd7-a7a5f8e205b1
Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: MAC
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'xxxxxxx', ip: 'xxxxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: 'xxxxx', java.version: '1.8.0_66'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:75)
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:60)
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
....
My build.gradle:
import org.apache.tools.ant.taskdefs.condition.Os
// set the dependencies for running the groovy script
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.codehaus.groovy:groovy-all:latest.release'
}
}
plugins {
id 'groovy'
}
apply from: "osSpecificDownloads.gradle"
// set the dependencies for compiling the groovy script
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:latest.release'
compile 'org.codehaus.geb:geb-core:latest.release'
compile 'org.seleniumhq.selenium:selenium-firefox-driver:2.53.0'
compile('com.codeborne:phantomjsdriver:1.3.0') {
transitive = false
}
}
// tell gradle the groovy script is in the same folder as the build.gradle file
sourceSets {
main {
groovy {
srcDirs = ['.']
}
}
}
Properties props = new Properties()
props.load(new FileInputStream("$projectDir/../../connection.properties"))
task("CheckHomePhantomJS", type: JavaExec) {
dependsOn unzipPhantomJs
def phantomJsFilename = Os.isFamily(Os.FAMILY_WINDOWS) ? "phantomjs.exe" : "bin/phantomjs"
environment 'phantomjspath', new File(unzipPhantomJs.outputs.files.singleFile, phantomJsFilename).absolutePath
environment 'driver', 'phantomjs'
environment 'gateway', props.gateway
environment 'username', props.username
environment 'password', props.password
main = 'CheckHome'
classpath = sourceSets.main.runtimeClasspath
}
Any idea what is going wrong here?
Geb creates a new Browser instance when you call.
Browser drive(Closure script)
Instead try with
Browser drive(Browser browser, Closure script)
So change your code to
Browser.drive(browser) {
go BiHome
// code omitted for brevity
}

Unable to run distributed shell on YARN

I am trying to run distributed shell example on YARN cluster.
#Test
public void realClusterTest() throws Exception {
System.setProperty("HADOOP_USER_NAME", "hdfs");
String[] args = {
"--jar",
APPMASTER_JAR,
"--num_containers",
"1",
"--shell_command",
"ls",
"--master_memory",
"512",
"--container_memory",
"128"
};
LOG.info("Initializing DS Client");
Client client = new Client(new Configuration());
boolean initSuccess = client.init(args);
Assert.assertTrue(initSuccess);
LOG.info("Running DS Client");
boolean result = client.run();
LOG.info("Client run completed. Result=" + result);
Assert.assertTrue(result);
}
But it fails with:
2013-09-17 11:45:28,338 INFO [main] distributedshell.Client (Client.java:monitorApplication(600)) - Got application report from ASM for, appId=11, clientToAMToken=null, appDiagnostics=Application application_1379338026167_0011 failed 2 times due to AM Container for appattempt_1379338026167_0011_000002 exited with exitCode: 1 due to: Exception from container-launch:
org.apache.hadoop.util.Shell$ExitCodeException:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:458)
at org.apache.hadoop.util.Shell.run(Shell.java:373)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:578)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
................
.Failing this attempt.. Failing the application., appMasterHost=N/A, appQueue=default, appMasterRpcPort=0, appStartTime=1379407525237, yarnAppState=FAILED, distributedFinalState=FAILED, appTrackingUrl=ip-10-232-149-222.us-west-2.compute.internal:8088/proxy/application_1379338026167_0011/, appUser=hdfs
Here is what I see in server logs:
2013-09-17 08:45:26,870 WARN nodemanager.DefaultContainerExecutor (DefaultContainerExecutor.java:launchContainer(213)) - Exception from container-launch with container ID: container_1379338026167_0011_02_000001 and exit code: 1
org.apache.hadoop.util.Shell$ExitCodeException:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:458)
at org.apache.hadoop.util.Shell.run(Shell.java:373)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:578)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:258)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:74)
The question is how can I get more details to identify what is going wrong.
PS: we are using HDP 2.0.5

Resources