Incompatibility with Sonar7.7 - sonarqube

Jenkins version:2.204.3
Sonarqube version:7.9.2
sonar-gerrit plugin: 2.30
I meet a issue:starting Sonarqube 7.7 in the preview mode (-Dsonar.analysis.mode=preview) was removed, making it incompatible with the plugin.
How can I fix this issue without downgrading sonarqube version and upgrading Jenkins version?

It's possible to do the following procedure:
Execute the analysis (as usual)
Download the report using the REST API
Generate the sonar-report.json local report using a "jq" script
Call the Sonar-Gerrit plugin (as usual)
This is the command for steps 2 and 3:
curl --user USER:PASS --header 'Content-Type:application/json' --request GET "https://SONAR-SERVER/api/issues/search?componentKeys=PROJECT-KEY&branch=BRANCH&resolved=false" | jq -f sonar-report-builder.jq > sonar-report.json
You can find the sonar-report-builder.jq file used in step 3 and more information about this issue here.

Related

How do I migrate a nifi 1.10.0 flow.xml.gz to 1.14 or newer versions: sensitive properties

I have a dataflow running in NiFi 1.10.0, the relevant properties from this installation is here:
nifi.sensitive.props.key=
nifi.sensitive.props.key.protected=
nifi.sensitive.props.algorithm=PBEWITHMD5AND256BITAES-CBC-OPENSSL
nifi.sensitive.props.provider=BC
nifi.sensitive.props.additional.keys=
I am trying to migrate the flowfile to the 1.15.2 install where the properties are
nifi.sensitive.props.key=<redacted>
nifi.sensitive.props.key.protected=
nifi.sensitive.props.algorithm=NIFI_PBKDF2_AES_GCM_256
nifi.sensitive.props.additional.keys=
Found this section in the NiFi admin guide to help with the migration.
Has anyone done this, what command options did you use?
Also is this a two step process since I am going from a blank key to a non-empty one and also changing the algorithm at the same time?
I used this command and the conversion works fine when you don't change the algorithm. Basically just setting a key when it was not set in the earlier 1.10.0 install.
$ ./nifi-toolkit-1.15.2/bin/encrypt-config.sh -f /path/to/nifi/nifi-1.10.0/conf/flow.xml.gz -g /path/to/nifi/nifi-1.15.2/conf/flow.xml.gz -s new_password -n /path/to/nifi/nifi-1.10.0/conf/nifi.properties -o /path/to/nifi/nifi-1.15.2/conf/nifi.properties -x
How do you change the algorithm and set the key at the same time?
Thanks
Issue can be resolved by following steps
Before migration if you don't have nifi.sensitive.props.key set, set it using following command ${NIFI_TOOLKIT_PAT}/bin/encrypt-config.sh -f /opt/nifi/nifi-current/data/flow.xml.gz -p ${NIFI_HOME}/conf/nifi.properties -s <NEW_KEY_TO_SET> -x
Once key is set upgrade nifi. Since in newer version algorithm is changed set it using command ${NIFI_HOME}/bin/nifi.sh set-sensitive-properties-algorithm <NEW_ALGORITHM>
Once algorithm set, encrypt again using command ${NIFI_TOOLKIT_PAT}/bin/encrypt-config.sh -f /opt/nifi/nifi-current/data/flow.xml.gz -p ${NIFI_HOME}/conf/nifi.properties -s <NEW_KEY_TO_SET> -x
Now you will get all compatible files with respect your latest version

How do I Add User or Edit a Password on Solr 6.6 on Windows

How do I Add User or Edit a Password on Solr 6.6 on Windows for basic authentication plugin using PowerShell's invoke-webrequest command?
Reference: http://lucene.apache.org/solr/guide/6_6/basic-authentication-plugin.html#BasicAuthenticationPlugin-AddaUserorEditaPassword
thanks
Used Curl for Windows as recommended by #MatsLindh
curl --basic --user solrAdmin:adminPassword
--url http://<server>:8983/solr/admin/authentication
--header 'Content-type:application/json'
--data "{'set-user':{'user1':'password1','user2':'password2'}}"
Curl for Windows downloaded at https://curl.haxx.se/dlwiz/?type=bin
Initially, I had a few errors and I had to switch the double and single quotes in the data/body from the example provided on Solr 6.6 documentation (link in question).

Does setting sonar.timemachine.period1 from config or command line work?

I am attempting to set the leak period in SonarQube 5.6.5 using Sonar Scanner with a properties file or command line argument, but I am having no success.
I would like to set the sonar.timemachine.period1 property to a specific version, e.g., 1.0.0, as is mentinoned in solution 2 (using sonar-project.properties) or solution 3 (using command line paramter, e.g., -Dsonar.timemachine.period1=1.0.0) of the accepted answer for Sonar runner, seeonly newly introduced issues.
Here is the scenario that reproduces my issue.
Run analysis with sonar.projectVersion=1.0.0.
Run analysis with sonar.projectVersion=2.0.0 and sonar.timemachine.period1=1.0.0.
Run analysis with sonar.projectVersion=3.0.0 and sonar.timemachine.period1=1.0.0.
After the second and third analysis I would expect the leak period to be "since 1.0.0" (which is the behavior if I manually set the leak period in the SonarQube admin section to 1.0.0). Instead, for the third analysis the leak period is being set to 2.0.0.
What am I missing? Is this a bug?
Setting the sonar.timemachine.period1 via 'normal' property is not sufficient, you will need to set properties via REST Api - note you'll need admin rights.
Had the same problem when using the Sonarqube Ant Task and created a macrodef for that purpose.
See :
Sonarqube Wep API documentation
Sonarqube set leak period to specific version other than previous version
Rebse is correct, you must use the API to set the sonar.timemachine.period1 property. I'm not using Ant. I used a curl command from Bamboo.
curl
-X POST
-u MY_USERNAME:MY_PASSWORD
-d resource=MY_PROJECT_KEY
-d id=sonar.timemachine.period1
-d value=1.0.0
http://localhost:9000/api/properties

Elasticsearch 1.5 can't find the plugin manager

I'm currently trying to install the JDBC river on an 1.5 elasticsearch instance.
When running:
/bin/plugin --install jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.0/elasticsearch-river-jdbc-1.5.0.0.zip
I obtain the following error:
Error: Could not find or load main class org.elasticsearch.plugins.PluginManager
Do you have any idea of the origin of the problem?
EDIT: I tried
bin/plugin
And get the same error, so it's not related to the url.
EDIT2: I'm using Windows.
The url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.0/elasticsearch-river-jdbc-1.5.0.0.zip is incorrect.
If you check the url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.0/ in your browser, you will see there is no elasticsearch-river-jdbc-1.5.0.0.zip file there. There is however a jar file of the same name. Perhaps you meant to use that one instead?
./bin/plugin --install river-jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.4/elasticsearch-river-jdbc-1.5.0.4.jar

Running Cassandra on Mac OS X

I am trying to run Cassandra on my mac.
I installed it following the steps detailed here: http://www.datastax.com/docs/1.0/getting_started/install_singlenode_root
but when I run:
bin/nodetool ring –h localhost
I get the following error message:
Class JavaLaunchHelper is implemented in both
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java and
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
How can I make cassandra work?
Many thanks
You are using ancient docs. On a recent version of Cassandra, run the command like this:
bin/nodetool -h localhost ring (see http://www.datastax.com/documentation/cassandra/2.1/cassandra/tools/toolsRing.html)
If you installed vnodes (the default), use nodetool status for an easier-to-read output.
Please use these docs or the docs that match your installation, I doubt you installed Cassandra 1.0. Please check the installation instructions that match the version you downloaded.
CORRECTION: the nodetool ring command worked for me using options in any position on 2.0.10:
bin/nodetool -h localhost ring
bin/nodetool ring -h localhost
and using --h instead of -h
It is a known bug in the JDK but it is not going to stop you from running Cassandra.
What you can do is to set JAVA_HOME variable explicitly.
It will not solve the bug, but it might remedy the error.
This is problem with jdk version, so you have to do the following
unset JAVA_HOME from your terminal.
edit nodetool and assign JAVA variable with jdk version less than jdk7.
JAVA = /Library/Java/JavaVirtualMachines/jdk1.6.0_xx.jdk/Contents/Home/bin/java
then run nodetool, you should be able to go without any issue.

Resources