Black Duck with Gitlab-CI runner - gitlab-ci

Im trying to integrate BlackDuck in to a gitlab ci script.
Running OpenJDK on Alpine 3.9.2
I get the following error in the logs
2019-10-14 15:19:00 ERROR [main] --- Scanning target /code/sre-web-
portal failed: There was a problem scanning target '/code/sre-web-
portal': Could not find the 'jre' directory in
/root/blackduck/tools.
2019-10-14 15:19:00 INFO [main] --- Signature scanner actions
finished.
and the scan exits with
--- Exiting with code 6 - FAILURE_SCAN
any have this error, or has successfully configured blackduck scan to run in gitlab-ci
command that's being run
bash <(curl -s -L https://detect.synopsys.com/detect.sh) --
detect.project.version.name=1 --blackduck.trust.cert=true --proxy-
insecure --detect.blackduck.signature.scanner.dry.run=true --
blackduck.offline.mode=true --detect.tools.excluded=BINARY_SCAN
I have tried setting the BDS_JAVA_HOME environment variable and it still fails with
--- Exiting with code 6 - FAILURE_SCAN

The cause of your problem is that the required 'Siganture Scanner' tool is yet missing.
Your command tells me, your were running the scan in offline mode.
This means, you have two options to solve this problem:
Either download and install the Signature Scanner tool manually (see https://testing.blackduck.synopsys.com/doc/componentdiscovery/downloadandinstall.htm) and set --detect.blackduck.signature.scanner.local.path= option to scan.
Or run the scan in online mode once as the tool is automatically downloaded and installed only after first establishing a connection to the BlackDuck server. (You can switch back to offline mode after that.)
Credits go to this synopsys community article.

Related

The server exited prematurely with exit code 1 GlassFish 4

I've been trying to start the glassfish server domain with the following command asadmin start-domain domain1 but the result wasn't the expected. This what the outputs is throwing out:
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Command start-domain failed.
Btw I've already tried changing the network-listener-port number located inside glassfish folders C:\glassfish4\glassfish\domains\domain1\config\domain.xml from port 8080 to 4949 and it didn't work. Besides I also tried running the start-domain domain1 command in the asadmin batch file and nothing happened, the output still the same.
Any idea how can I fix this out?
I tried to start it with asadmin.sh and it worked on Windows 10

bluemix java application cannot be deployed anymore

We have had a java application that's been running on bluemix for more than a year that we update periodically (a few times a week). In the last few days however, even though the build is successful, we cannot launch it. The error is the following (we never saw this before):
App/0 Error occurred during initialization of VMJul 10, 2017 12:13:14.002 PM
App/0 Could not find agent library /home/vcap/app/.java-J-buildpack/open_jdk_jre/bin/jvmkill-J-1.9.0_RELEASE in absolute path, with error: /home/vcap/app/.java-J-buildpack/open_jdk_jre/bin/jvmkill-J-1.9.0_RELEASE: cannot open shared object file: No such file or directory
The deploy cmd is
cf push "${CF_APP}" -p target/universal/myapp-SNAPSHOT.zip -b https://github.com/cloudfoundry/java-buildpack.git -k 2G
As you are able to deploy using a previous version of the buildpack, this suggests that a recent change in the buildpack may be a reason for the latest buildpack breaking.
I was going to suggest opening a ticket on the github repo, but I see you have already done that :)

play 2.2.1 application deployment in the background and exit logs without using control+D

I am writing a script to deploy a play 2.2.1 application.However I have noticed after running the application using command play "start 8084", the application is running at 8084 port but I have to do cntrl+D to exit logs and go back to command promt in ubuntu.
Is there a way to go back to console without using cntrl+d....because I have to do this using shell script.
Also I have used stage. but I am getting the following error:
[error] Not a valid command: play (similar: apply, last, alias)
[error] Not a valid project ID: play
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: play (similar: clean)
[error] play
Please help
I use something like this with playframework 2.2:
Run play dist for a project
Unzip the prepared zip archive somewhere (it is located in the target\universal folder of your application). The start script will be located at bin/<app_name>
Run the project like this: bash /path/to/your/app/bin/<app_name> -Dhttp.port=8084 & (note the ampersand in the end)
If you are planning to use ssh consider disowning the process or running it with nohup (you may read the details here: Scala start Play server in production) so that the application does not shutdown when you close the ssh session:
bash /path/to/your/app/bin/<app_name> -Dhttp.port=8084 & disown

Calling Bitkeeper command from telnet

I am calling a perl script in build machine 1 to connect to build machine 2 and call a perl script in build machine 2. The module I am using is Net::Telnet.
Recently I upgraded my bitkeeper in Build machine 2. Since then I am getting the license agreement form of Bitkeeper in the background. So my script is as good as paused till I kill the prompt's process from task manager.
If I kill the process, the bitkeeper clone command will fail and hence my entire build will fail. I am not able to bring this sneaky bkgui.exe process to front and accept the license agreement once and for all.
Can you please help me in solving this problem?
Observations:
I am not getting the license error when I open a command prompt in build machine 2 and call the same script which was called from telnet.
I ran 'whoami' command in my script running in build machine 2 and found it to be administrator.
'C:\WINDOWS\system32\tlntsvr.exe' is running and the USER is 'NT AUTHORITY\SYSTEM'.
When I call telnet from command line of buildmachine 1 and call the script in buildmachine 2, even then the bk command get executed successfully.
I want to run my bitkeeper command in build machine 2 from build machine 1.
You can try the bk legal -pT command. See bk help legal for usage.

Unable to start Active MQ on Linux

I am trying to get ActiveMQ server running on a RaspberryPI Debian Squeeze box and all appears to be installed correctly but when I try and start the service I am getting the following...
root#raspberrypi:/var/www/activemq/apache-activemq-5.7.0# bin/activemq
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/jre1.7.0_07/bin/java'
/usr/jre1.7.0_07/bin/java: 1: /usr/jre1.7.0_07/bin/java:ELF0
4°: not found
/usr/jre1.7.0_07/bin/java: 2: /usr/jre1.7.0_07/bin/java: Syntax error: "(" unexpected
Tasks provided by the sysv init script:
restart - stop running instance (if there is one), start new instance
console - start broker in foreground, useful for debugging purposes
status - check if activemq process is running
setup - create the specified configuration file for this init script
(see next usage section)
Configuration of this script:
The configuration of this script can be placed on /etc/default/activemq or /root/.activemqrc.
To use additional configurations for running multiple instances on the same operating system
rename or symlink script to a name matching to activemq-instance-<INSTANCENAME>.
This changes the configuration location to /etc/default/activemq-instance-<INSTANCENAME> and
$HOME/.activemqrc-instance-<INSTANCENAME>. Configuration files in /etc have higher precedence.
root#raspberrypi:/var/www/activemq/apache-activemq-5.7.0#
It looks like there is an error somewhere but I am a fairly newbie at this and don't know where to look.
Just adding an answer since,becoz as per the documentation , the command is wrong
to start activemqm, use
Navigate to [installation directory/bin] and run ./activemq start or simple bin/activemq start
if you want to see it live in a window use bin/activemq console
To stop, you have to kill the process
The default ActiveMQ "getting started" link sends u here : http://activemq.apache.org/getting-started.html which is the "Getting Started Guide for ActiveMQ 4.x".
If you scroll down main documentation page, you will find this link with the proper commands :
http://activemq.apache.org/version-5-getting-started.html