Unable to execute command on server using j2ssh - ssh

I connected to a unix server through ssh and tried to execute a "ls" command and obtain it's output. The code is like this
SessionChannelClient session = client.openSessionChannel();
session.startShell();
String cmd = "ls -l";
session.executeCommand(cmd);
ChannelInputStream in = session.getInputStream();
ChannelOutputStream out = session.getOutputStream();
IOStreamConnector input = new IOStreamConnector(System.in, session.getOutputStream());
IOStreamConnector output = new IOStreamConnector(session.getInputStream(), System.out);
After running I was not getting any output in log file. What I found is that the channel request is failing as shown
1019 [main] INFO com.sshtools.j2ssh.connection.ConnectionProtocol - Channel request succeeded
1020 [main] INFO com.sshtools.j2ssh.session.SessionChannelClient - Requesting command execution
1021 [main] INFO com.sshtools.j2ssh.session.SessionChannelClient - Command is ls -l
1021 [main] INFO com.sshtools.j2ssh.connection.ConnectionProtocol - Sending exec request for the session channel
1021 [main] INFO com.sshtools.j2ssh.transport.TransportProtocolCommon - Sending SSH_MSG_CHANNEL_REQUEST
1021 [main] INFO com.sshtools.j2ssh.connection.ConnectionProtocol - Waiting for channel request reply
1032 [Transport protocol 1] INFO com.sshtools.j2ssh.transport.TransportProtocolCommon - Received SSH_MSG_CHANNEL_EXTENDED_DATA
1033 [ssh-connection 1] DEBUG com.sshtools.j2ssh.transport.Service - Routing SSH_MSG_CHANNEL_EXTENDED_DATA
1033 [ssh-connection 1] DEBUG com.sshtools.j2ssh.transport.Service - Finished processing SSH_MSG_CHANNEL_EXTENDED_DATA
1075 [Transport protocol 1] INFO com.sshtools.j2ssh.transport.TransportProtocolCommon - Received SSH_MSG_CHANNEL_FAILURE
1075 [main] INFO com.sshtools.j2ssh.connection.ConnectionProtocol - Channel request failed
Why is this happening ?

You can use startShell or executeCommand, but not both.
executeCommand is only intended to invoke a particular shell of your choosing, e.g. /bin/bash. In most cases you can just use startShell to start the default shell.
This is all you need to execute the command you provided:
final String cmd = "ls -l" + '\n';
session.startShell();
session.getOutputStream().write(cmd.getBytes());
Or, alternatively, using executeCommand:
final String cmd = "ls -l";
session.executeCommand(String.format("sh -c \"%s\"", cmd));
You can hook up to the stdout & stderr InputStreams in the same manner to see the result of your command. Further, note that a SessionChannelClient can only process one command. You'll need to instantiate another one to send a second command.
I suggest you download the J2SSH documentation. Inside you'll find j2ssh-getting-started.htm which explains the basic operation of the API.

Related

Cannot get current URL in Selenium::Remote::Driver in perl

I navigated to google and called the get_current_url() method. but it's showing timeout and exiting the program.
Here is the code I tried
my $driver = Selenium::Remote::Driver->new(
'browser_name' => 'firefox',
'platform' => 'Windows',
'extra_capabilities' => {
'moz:firefoxOptions' => {},
}
);
$driver->debug_on() ;
$driver->get("https://www.google.com/");
wait_until {print $driver->get_path()};
$driver->quit;
I've turned on debug and got the following output in console
Prepping get
Executing get
REQ: POST, http://localhost:4444/wd/hub/session/69ced133-9420-4b0e-a7fd-e4f6bb343f7e/url, {"url":"https://www.google.co.in/"}
RES: {"value":null}
Prepping getCurrentUrl
Executing getCurrentUrl
REQ: GET, http://localhost:4444/wd/hub/session/69ced133-9420-4b0e-a7fd-e4f6bb343f7e/url, {}
RES: read timeout at C:/Perl64/lib/Net/HTTP/Methods.pm line 268.
Error while executing command: Server returned error message read timeout at C:/Perl64/lib/Net/HTTP/Methods.pm line 268.
instead of data at C:/Perl64/site/lib/Selenium/Remote/Driver.pm line 403.
at C:/Perl64/site/lib/Selenium/Remote/Driver.pm line 353.
Prepping quit
Executing quit
REQ: DELETE, http://localhost:4444/wd/hub/session/69ced133-9420-4b0e-a7fd-e4f6bb343f7e, {}
In console,program stucks here for while- 'Executing getCurrentURL' and later shown up with timeout message-Res:read timeout
The following works for me using Windows 10, Strawberry Perl version 5.30.1.
I installed geckodriver.exe from
https://github.com/mozilla/geckodriver/releases
and Selenium Server from
https://www.selenium.dev/downloads/
then downloaded firefox binary from
https://www.mozilla.org/en-US/firefox/new/
and then started the server successfully from the command prompt:
> java "-Dwebdriver.gecko.driver=geckodriver/geckodriver.exe" -jar selenium-server/selenium-server-standalone-3.141.59.jar -host localhost -port 4444
20:00:48.591 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
20:00:53.896 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2020-07-06 20:00:54.601:INFO::main: Logging initialized #12170ms to org.seleniumhq.jetty9.util.log.StdErrLog
20:01:05.928 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
20:01:23.567 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
Now the following Perl script works:
use feature qw(say);
use strict;
use warnings;
use Selenium::Remote::Driver;
my $driver = Selenium::Remote::Driver->new(
remote_server_addr => "127.0.0.1"
);
$driver->get('http://www.google.com');
say "Result: ", $driver->get_title();
$driver->quit();
Output:
Result: Google
Note: using localhost instead of 127.0.0.1 for remote_server_addr does not work for some reason, see this question for more information.

Filebeat does not complete on close_eof + --once

Using filebeat 7.5.2:
I'm using a filebeat configuration with close_eof enabled and I run filebeat with the flag --once. I can see the harvester reaching eof but the filebeat keeps going.
Flebeat conf:
filebeat.inputs:
- type: log
close_eof: true
enabled: true
paths:
- "${LOGS_PATH}"
scan_frequency: 1s
fields: {
machine: "${HOST}"
}
output.logstash:
hosts: ["192.168.41.6:5044"]
bulk_max_size: 1024
timeout: 30s
pipelining: 1
workers: 1
And I run it using:
filebeat run --once -v -c "PATH TO CONF..."
And some logs from the filebeat instance:
...
2020-02-04T18:30:16.950Z INFO instance/beat.go:297 Setup Beat: filebeat; Version: 7.5.2
2020-02-04T18:30:17.059Z INFO [publisher] pipeline/module.go:97 Beat name: logstash
2020-02-04T18:30:17.167Z WARN beater/filebeat.go:152 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch out
put is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2020-02-04T18:30:17.168Z INFO instance/beat.go:429 filebeat start running.
2020-02-04T18:30:17.168Z INFO [monitoring] log/log.go:118 Starting metrics logging every 30s
2020-02-04T18:30:17.168Z INFO registrar/migrate.go:104 No registry home found. Create: /tmp/tmp.BXJtfiaEzb/data/registry/filebeat
2020-02-04T18:30:17.179Z INFO registrar/migrate.go:112 Initialize registry meta file
2020-02-04T18:30:17.192Z INFO registrar/registrar.go:108 No registry file found under: /tmp/tmp.BXJtfiaEzb/data/registry/filebeat/data.json. Creating a new re
gistry file.
2020-02-04T18:30:17.193Z INFO registrar/registrar.go:145 Loading registrar data from /tmp/tmp.BXJtfiaEzb/data/registry/filebeat/data.json
2020-02-04T18:30:17.193Z INFO registrar/registrar.go:152 States Loaded from registrar: 0
2020-02-04T18:30:17.193Z WARN beater/filebeat.go:368 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch out
put is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2020-02-04T18:30:17.193Z INFO crawler/crawler.go:72 Loading Inputs: 1
2020-02-04T18:30:17.194Z INFO log/input.go:152 Configured paths: [/tmp/tmp.BXJtfiaEzb/*.log]
2020-02-04T18:30:17.206Z INFO input/input.go:114 Starting input of type: log; ID: 13918413832820009056
2020-02-04T18:30:17.225Z INFO input/input.go:167 Stopping Input: 13918413832820009056
2020-02-04T18:30:17.225Z INFO crawler/crawler.go:106 Loading and starting Inputs completed. Enabled inputs: 1
2020-02-04T18:30:17.225Z INFO log/harvester.go:251 Harvester started for file: /tmp/tmp.BXJtfiaEzb/dcbgw-20200124080032_darkblue.log
2020-02-04T18:30:17.231Z INFO beater/filebeat.go:384 Running filebeat once. Waiting for completion ...
2020-02-04T18:30:17.231Z INFO beater/filebeat.go:386 All data collection completed. Shutting down.
2020-02-04T18:30:17.231Z INFO crawler/crawler.go:139 Stopping Crawler
2020-02-04T18:30:17.231Z INFO crawler/crawler.go:149 Stopping 1 inputs
2020-02-04T18:30:17.258Z INFO pipeline/output.go:95 Connecting to backoff(async(tcp://192.168.41.6:5044))
2020-02-04T18:30:17.296Z INFO pipeline/output.go:105 Connection to backoff(async(tcp://192.168.41.6:5044)) established
... Only metrics here ...
2020-02-04T18:35:55.686Z INFO log/harvester.go:274 End of file reached: /tmp/tmp.BXJtfiaEzb/dcbgw-20200124080032_darkblue.log. Closing because close_eof is enabled.
2020-02-04T18:35:55.686Z INFO crawler/crawler.go:165 Crawler stopped
... MORE METRICS ...
2020-02-04T18:36:26.609Z ERROR logstash/async.go:256 Failed to publish events caused by: read tcp 192.168.41.6:49662->192.168.41.6:5044: i/o timeout
2020-02-04T18:36:26.621Z ERROR logstash/async.go:256 Failed to publish events caused by: client is not connected
2020-02-04T18:36:28.520Z ERROR pipeline/output.go:121 Failed to publish events: client is not connected
2020-02-04T18:36:28.520Z INFO pipeline/output.go:95 Connecting to backoff(async(tcp://192.168.41.6:5044))
2020-02-04T18:36:28.521Z INFO pipeline/output.go:105 Connection to backoff(async(tcp://192.168.41.6:5044)) established
... MORE METRICS ...
From this I'm outputing this to Logstash 7.5.2 running in the same Ubuntu 18 VM. Running Logstash with log level trace does not output any error.

Filebeat not starting TCP server (input)

So I have configured filebeat to accept input via TCP. This is filebeat.yml file.
filebeat.inputs:
- type: tcp
host: ["localhost:9000"]
max_message_size: 20MiB
For some reason filebeat does not start the TCP server at port 9000. I have verified this using wireshark. Wireshark shows nothing at port 9000.
This is output of command "filebeat -e -d "*"" run on terminal
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:468 Home path: [/usr/local/Cellar/filebeat/6.2.4] Config path: [/usr/local/etc/filebeat] Data path: [/usr/local/var/lib/filebeat] Logs path: [/usr/local/var/log/filebeat]
2019-08-14T09:12:40.745-0600 DEBUG [beat] instance/beat.go:495 Beat metadata path: /usr/local/var/lib/filebeat/meta.json
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:475 Beat UUID: 764da0fd-ea93-4777-b1ea-63149be0d6b6
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:213 Setup Beat: filebeat; Version: 6.2.4
2019-08-14T09:12:40.745-0600 DEBUG [beat] instance/beat.go:230 Initializing output plugins
2019-08-14T09:12:40.745-0600 DEBUG [processors] processors/processor.go:49 Processors:
2019-08-14T09:12:40.745-0600 INFO pipeline/module.go:76 Beat name: Ad-MBP.domain
2019-08-14T09:12:40.745-0600 ERROR fileset/modules.go:95 Not loading modules. Module directory not found: /usr/local/Cellar/filebeat/6.2.4/module
2019-08-14T09:12:40.745-0600 INFO [monitoring] log/log.go:97 Starting metrics logging every 30s
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:301 filebeat start running.
2019-08-14T09:12:40.745-0600 DEBUG [registrar] registrar/registrar.go:90 Registry file set to: /usr/local/var/lib/filebeat/registry
2019-08-14T09:12:40.746-0600 INFO registrar/registrar.go:110 Loading registrar data from /usr/local/var/lib/filebeat/registry
2019-08-14T09:12:40.746-0600 INFO registrar/registrar.go:121 States Loaded from registrar: 0
2019-08-14T09:12:40.746-0600 WARN beater/filebeat.go:261 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch output is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2019-08-14T09:12:40.746-0600 INFO crawler/crawler.go:48 Loading Prospectors: 1
2019-08-14T09:12:40.746-0600 DEBUG [registrar] registrar/registrar.go:152 Starting Registrar
2019-08-14T09:12:40.746-0600 DEBUG [cfgfile] cfgfile/reload.go:95 Checking module configs from: /usr/local/etc/filebeat/modules.d/*.yml
2019-08-14T09:12:40.746-0600 DEBUG [cfgfile] cfgfile/reload.go:109 Number of module configs found: 0
2019-08-14T09:12:40.746-0600 INFO crawler/crawler.go:82 Loading and starting Prospectors completed. Enabled prospectors: 0
2019-08-14T09:12:40.746-0600 INFO cfgfile/reload.go:127 Config reloader started
2019-08-14T09:12:40.748-0600 DEBUG [cfgfile] cfgfile/reload.go:151 Scan for new config files
2019-08-14T09:12:40.748-0600 DEBUG [cfgfile] cfgfile/reload.go:170 Number of module configs found: 0
2019-08-14T09:12:40.748-0600 INFO cfgfile/reload.go:219 Loading of config files completed.
I am not sure what I am doing wrong..
I believe filebeat inputs are only available from filebeat 6.3+, anything older used filebeat prospectors.
6.3 TCP input documentation, nothing available for 6.2 or older as it uses prospectors:
https://www.elastic.co/guide/en/beats/filebeat/6.3/filebeat-input-tcp.html
Your logs show that you are on filebeat version 6.24, could you try out your configuration with 6.3+?

Karate: How to implement --no-sandbox header for linux usage with sudo

I want to setup a headless chrome driver for UI Test Automation in jenkins.
But to run the test command
sudo -E java -jar karate-0.9.3.jar karate_GUI.feature
I have to run as root and it requires --no-sandbox, which, if I'm not wrong, it's still not supported in v0.9.3.
If possible, how can I include --no-sandbox option?
I checked https://intuit.github.io/karate/karate-core/ and there is no --no-sandbox option.
My feature configuration:
Feature: message end-point
Background:
* configure driver = { type: 'chrome', executable: '/usr/bin/google-chrome', headless: true }
# Login Url
* def browserManagementUrl = 'http://localhost:8000/login/'
Scenario: GUI Testing for Login page
Given driver browserManagementUrl
And eval driver.input('input[name=name]', 'admin')
And eval driver.input('input[name=password]', 'adminadmin')
And driver.submit('#login-button')
When driver.submit('#login-button')
Then match driver.location == 'http://localhost:8000/select/'
The linux command and it's results
sudo -E java -jar karate-0.9.3.jar karate_GUI.feature
07:15:56.296 [main] INFO com.intuit.karate.Main - Karate version: 0.9.3
07:15:57.345 [ForkJoinPool-1-worker-1] WARN com.intuit.karate - skipping bootstrap configuration: could not find or read file: classpath:karate-config.js
07:15:57.418 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - command: [/usr/bin/google-chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/var/jenkins_home/workspace/my-karate_GUI#2/integrations/target/chrome_1560323757416, --disable-popup-blocking, --headless]
07:15:57.419 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #0 for port to be ready - localhost:9222
07:15:57.420 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - env PATH: /sbin:/bin:/usr/sbin:/usr/bin
07:15:57.423 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:57.674 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #1 for port to be ready - localhost:9222
07:15:57.675 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:57.793 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - [0612/071557.791933:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
07:15:57.810 [chrome_1560323757416] DEBUG c.intuit.karate.shell.CommandThread - command complete, exit code: 1 - [/usr/bin/google-chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/var/jenkins_home/workspace/my-karate_GUI#2/integrations/target/chrome_1560323757416, --disable-popup-blocking, --headless]
07:15:57.926 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #2 for port to be ready - localhost:9222
07:15:57.927 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:58.178 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #3 for port to be ready - localhost:9222
[...]
07:16:02.206 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #19 for port to be ready - localhost:9222
07:16:02.207 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:16:02.848 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - request:
1 > GET http://localhost:9222/json
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Host: localhost:9222
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_212)
07:16:02.862 [ForkJoinPool-1-worker-1] ERROR c.i.k.driver.chrome_1560323757416 - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused), http call failed after 13 milliseconds for URL: http://localhost:9222/json
07:16:02.863 [ForkJoinPool-1-worker-1] ERROR c.i.k.driver.chrome_1560323757416 - http request failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
07:16:02.918 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 1 of 1: karate_GUI.feature
---------------------------------------------------------
feature: karate_GUI.feature
report: target/karate_GUI.json
scenarios: 1 | passed: 0 | failed: 1 | time: 5.4993
---------------------------------------------------------
Karate version: 0.9.3
======================================================
elapsed: 6.39 | threads: 1 | thread time: 5.50
features: 1 | ignored: 0 | efficiency: 0.86
scenarios: 1 | passed: 0 | failed: 1
======================================================
failed features:
karate_GUI: karate_GUI.feature:8 -
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Exception in thread "main" picocli.CommandLine$ExecutionException: there are test failures
at com.intuit.karate.Main$1.handleExecutionException(Main.java:133)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1157)
at com.intuit.karate.Main.main(Main.java:139)
I guess you do know that the UI automation pieces are still experimental and yes I don't think we support --no-sandbox - feel free to open a ticket and help us with some links to why this is needed, what it does etc.
A suggested workaround is you can pass a batch file as the executable key to the configure driver call. In this batch file you can then call the chromedriver executable with whatever custom parameters or arguments you need.
Do let us know if that works. It also sounds to me that a way to pass any custom flags is a needed feature, do add this to your feature request.
EDIT: for those landing here in future, I'm not 100% sure, but maybe the info here will help: https://github.com/intuit/karate/issues/1134#issuecomment-638990087

After sonarqube upgrade 5.2 -> 5.6, WebServer is not operational any more

I'm using WindowsServer2008 and MySql 5.6.31. I wanted to upgrade
SonarQube from version 5.2 to 5.6. After starting SonarQube the
log-file shows the below lines. Everything should be finde, except the WebServer doesn't become operational:
INFO ce[o.s.c.a.WebServerWatcherImpl] Waiting for Web Server to be operational...
INFO ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
When I try to reach the WebServer in the browser, I get the message from ApacheTomcat:
HTTP Status 404 - /sessions/new
type Status report
message /sessions/new
description The requested resource is not available.
Apache Tomcat/8.0.30
Does anyone know why the WebServer doesn't become operational?
Wrapper Manager: JVM #1 Running a 64-bit JVM. Wrapper Manager:
Registering shutdown hook Wrapper Manager: Using wrapper Load native
library. One or more attempts may fail if platform specific libraries
do not exist. Loading native library failed:
wrapper-windows-x86-64.dll Cause: java.lang.UnsatisfiedLinkError: no
wrapper-windows-x86-64 in java.library.path Loaded native library:
wrapper.dll Calling native initialization method. Initializing
WrapperManager native library. Java Executable:
C:\ProgramData\Oracle\Java\javapath\java.exe Windows version: 6.1.7601
Java Version : 1.8.0_91-b15 Java HotSpot(TM) 64-Bit Server VM Java
VM Vendor : Oracle Corporation
Control event monitor thread started. Startup runner thread started.
WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp#38af3868,
args[]) called by thread: main Communications runner thread started.
Open socket to wrapper...Wrapper-Connection Opened Socket from 31000
to 32000 Send a packet KEY : fnnZL60VqJstVqYQ
handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
Received a packet LOW_LOG_LEVEL : 1 Wrapper Manager: LowLogLevel from
Wrapper is 1 Received a packet PING_TIMEOUT : 200 PingTimeout from
Wrapper is 200000 Received a packet PROPERTIES : (Property Values)
Received a packet START : start calling WrapperListener.start()
Waiting for WrapperListener.start runner thread to complete.
WrapperListener.start runner thread started. WrapperSimpleApp:
start(args) Will wait up to 2 seconds for the main method to complete.
WrapperSimpleApp: invoking main method
2016.07.28 13:48:38 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory D:\SonarQube\sonarqube-5.6\temp
2016.07.28 13:48:38 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[es]: C:\Program Files\Java\jre1.8.0_91\bin\java
-Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=D:\SonarQube\sonarqube-5.6\temp -javaagent:C:\Program Files\Java\jre1.8.0_91\lib\management-agent.jar -cp
./lib/common/;./lib/search/ org.sonar.search.SearchServer
D:\SonarQube\sonarqube-5.6\temp\sq-process6103713257744114100properties
Send a packet START_PENDING : 5000 Send a packet START_PENDING : 5000
WrapperSimpleApp: start(args) end. Main Completed=false,
exitCode=null WrapperListener.start runner thread stopped. returned
from WrapperListener.start() Send a packet STARTED : Startup runner
thread stopped. Received a packet PING : ping Send a packet PING : ok
2016.07.28 13:48:41 INFO es[o.s.p.ProcessEntryPoint] Starting es
2016.07.28 13:48:41 INFO es[o.s.s.EsSettings] Elasticsearch listening on 127.0.0.1:9001
2016.07.28 13:48:42 INFO es[o.elasticsearch.node] [sonar-1469706518062] version[1.7.5], pid[3788],
build[00f95f4/2016-02-02T09:55:30Z]
2016.07.28 13:48:42 INFO es[o.elasticsearch.node] [sonar-1469706518062] initializing ...
2016.07.28 13:48:42 INFO es[o.e.plugins] [sonar-1469706518062] loaded [], sites []
2016.07.28 13:48:43 INFO es[o.elasticsearch.env] [sonar-1469706518062] using [1] data paths, mounts [[Data (D:)]], net
usable_space [29.5gb], net total_space [249.9gb], types [NTFS]
Received a packet PING : ping Send a packet PING : ok
2016.07.28 13:48:46 WARN es[o.e.bootstrap] JNA not found. native methods will be disabled.
2016.07.28 13:48:47 INFO es[o.elasticsearch.node] [sonar-1469706518062] initialized
2016.07.28 13:48:47 INFO es[o.elasticsearch.node] [sonar-1469706518062] starting ...
2016.07.28 13:48:47 INFO es[o.e.transport] [sonar-1469706518062] bound_address {inet[/127.0.0.1:9001]}, publish_address
{inet[/127.0.0.1:9001]}
2016.07.28 13:48:47 INFO es[o.e.discovery] [sonar-1469706518062] sonarqube/NDLYofdsQU6dCANZLN0p9w Received a packet PING : ping Send a
packet PING : ok
2016.07.28 13:48:50 INFO es[o.e.cluster.service] [sonar-1469706518062] new_master
[sonar-1469706518062][NDLYofdsQU6dCANZLN0p9w][DEERLA7LRUD10A][inet[/127.0.0.1:9001]]{rack_id=sonar-1469706518062},
reason: zen-disco-join (elected_as_master)
2016.07.28 13:48:50 INFO es[o.elasticsearch.node] [sonar-1469706518062] started
2016.07.28 13:48:50 INFO es[o.e.gateway] [sonar-1469706518062] recovered [0] indices into cluster_state
2016.07.28 13:48:51 INFO app[o.s.p.m.Monitor] Process[es] is up
2016.07.28 13:48:51 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: C:\Program Files\Java\jre1.8.0_91\bin\java
-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=D:\SonarQube\sonarqube-5.6\temp -javaagent:C:\Program Files\Java\jre1.8.0_91\lib\management-agent.jar -cp
./lib/common/;./lib/server/;D:\SonarQube\sonarqube-5.6\lib\jdbc\mysql\mysql-connector-java-5.1.35.jar
org.sonar.server.app.WebServer
D:\SonarQube\sonarqube-5.6\temp\sq-process200048299209178132properties
Received a packet PING : ping Send a packet PING : ok
2016.07.28 13:48:55 TRACE web[o.s.p.Lifecycle] tryToMoveTo from INIT to STARTING => true
2016.07.28 13:48:55 INFO web[o.s.p.ProcessEntryPoint] Starting web
2016.07.28 13:48:56 INFO web[o.s.s.a.TomcatContexts] Webapp directory: D:\SonarQube\sonarqube-5.6\web
2016.07.28 13:48:56 INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-xxx.xxx.x.xxx-xxxx"]
2016.07.28 13:48:56 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read Received a packet PING : ping
Send a packet PING : ok
2016.07.28 13:48:57 INFO web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-xxx.xxx.x.xxx-xxxx"]
2016.07.28 13:48:57 INFO web[o.s.s.a.TomcatAccessLog] Web server is started
2016.07.28 13:48:57 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.07.28 13:48:57 TRACE web[o.s.p.Lifecycle] tryToMoveTo from STARTING to STARTED => true
2016.07.28 13:48:58 INFO app[o.s.p.m.Monitor] Process[web] is up
2016.07.28 13:48:58 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[ce]: C:\Program Files\Java\jre1.8.0_91\bin\java
-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=D:\SonarQube\sonarqube-5.6\temp -javaagent:C:\Program Files\Java\jre1.8.0_91\lib\management-agent.jar -cp
./lib/common/;./lib/server/;./lib/ce/*;D:\SonarQube\sonarqube-5.6\lib\jdbc\mysql\mysql-connector-java-5.1.35.jar
org.sonar.ce.app.CeServer
D:\SonarQube\sonarqube-5.6\temp\sq-process346661778793077863properties
2016.07.28 13:48:59 TRACE ce[o.s.p.Lifecycle] tryToMoveTo from INIT to STARTING => true
2016.07.28 13:48:59 INFO ce[o.s.p.ProcessEntryPoint] Starting ce
2016.07.28 13:48:59 INFO ce[o.s.c.a.WebServerWatcherImpl] Waiting for Web Server to be operational...
2016.07.28 13:49:00 INFO ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer... Received a packet PING : ping Send a packet
PING : ok
2016.07.28 13:49:02 INFO ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer... Received a packet PING : ping Send a packet
PING : ok
There should be a line on the log like this
2017.01.08 23:12:11 WARN web[o.s.s.p.DatabaseServerCompatibility] Database must be upgraded. Please backup database and browse /setup
The server is waiting the user to go to the /setup page to upgrade the DB before continue.
As per below log line
WARN web[o.s.s.p.DatabaseServerCompatibility] Database must be upgraded. Please backup database and browse /setup
Go to http://<sonar-host>:9000/<context path>/setup
and click on Migrate button.
After successful migration, your server will ready to use.