Trouble with JIRA plugin

658 views
Skip to first unread message

Karoly Molnar

unread,
Jan 17, 2015, 7:55:12 PM1/17/15
to repo-d...@googlegroups.com
Hello,

I have gerrit 2.9.4 installed from official release with its-jira-2.9-SNAPSHOT.jar plugin downloaded from: http://ci.gerritforge.com/view/Plugins-stable-2.9/

Platform is ubuntu 14.04 with oracle-java-8.
Database is postgresql
Authentication is LDAP via apache proxy.

JIRA is 6.4 hosted by Atlassian cloud. The RPC module is installed correctly on it.

gerrit.config: (only relevant pieces)
[its-jira]
        url = https://xxx.atlassian.net
        username = yyy
        commentOnChangeAbandoned=true
        commentOnChangeCreated=true
        commentOnChangeMerged=true
        commentOnChangeRestored=true
        commentOnCommentAdded=false
        commentOnFirstLinkedPatchSetCreated=true
        commentOnPatchSetCreated=true
        commentOnRefUpdatedGitWeb=true
[commentLink "its-jira"]
        match = JI:([A-Z]+-[0-9]+)
        html = <a href=\"https://xxx.atlassian.net/browse/$1\">$1</a>
        association = MANDATORY

secure.config: (only relevant pieces)
[its-jira]
        password = ...

its/action.config:
[rule "patch-set"]
        event-type = patchset-created
        action = add-comment A new patchset was added to the Gerrit change
        action = log-event
[rule "merged"]
        event-type = change-merged
        action = add-standard-comment
        action = log-event
[rule "verified_no"]
        event-type = comment-added
        approval-Verified = -1
        action = add-comment Verification by Jenkins failed
        action = log-event
[rule "verified_yes"]
        event-type = comment-added
        approval-Verified = +1
        action = add-comment Verification by Jenkins was successful
[rule "ref-updated"]
        event-type = ref-updated
        action = add-standard-comment

For debugging I added log4j config to gerrit.config
[container]
        javaOptions = -Dlog4j.configuration=file:///var/lib/gerrit2/server/etc/log4j.properties

log4j.properties:
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
log4j.rootCategory=DEBUG, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/var/lib/gerrit2/server/logs/my.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.target=System.err
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=[%d] %-5p %c %x: %m%n

log4j.logger.com.google.gerrit=INFO

# Silence non-critical messages from MINA SSHD.
#
log4j.logger.org.apache.mina=WARN
log4j.logger.org.apache.sshd.common=WARN
log4j.logger.org.apache.sshd.server=WARN
log4j.logger.org.apache.sshd.common.keyprovider.FileKeyPairProvider=INFO
log4j.logger.com.google.gerrit.sshd.GerritServerSession=WARN

# Silence non-critical messages from Jetty.
#
log4j.logger.org.eclipse.jetty=INFO

# Silence non-critical messages from mime-util.
#
log4j.logger.eu.medsea.mimeutil=WARN

# Silence non-critical messages from openid4java
#
log4j.logger.org.apache.http=WARN
log4j.logger.org.apache.xml=WARN
log4j.logger.org.openid4java=WARN
log4j.logger.org.openid4java.consumer.ConsumerManager=FATAL
log4j.logger.org.openid4java.discovery.Discovery=ERROR
log4j.logger.org.openid4java.server.RealmVerifier=ERROR
log4j.logger.org.openid4java.message.AuthSuccess=ERROR

# Silence non-critical messages from c3p0 (if used).
#
log4j.logger.com.mchange.v2.c3p0=WARN
log4j.logger.com.mchange.v2.resourcepool=WARN
log4j.logger.com.mchange.v2.sql=WARN

# Silence non-critical messages from Velocity
#
log4j.logger.velocity=WARN

# Silence non-critical messages from apache.http
log4j.logger.org.apache.http=WARN

Log shows that it is connecting to JIRA correctly on startup:
2015-01-17 17:23:41 DEBUG JiraItsFacade:196 - Connecting to jira at URL https://xxx.atlassian.net
2015-01-17 17:23:45 INFO  JiraItsFacade:180 - Connected to https://xxx.atlassian.net as username=yyy, token=zzz

When I submit a patch in the log I can see that it is processing the hooks. I don't see any error message, but the comment does not show up in JIRA.

Debug log is attached, containing startup and one connection where I push a new change set to the server.

Anything I missed in the config?

Thanks,
Karoly
my.log

Luca Milanesio

unread,
Jan 19, 2015, 9:34:20 AM1/19/15
to Karoly Molnar, repo-d...@googlegroups.com
Hi Karoly,
see my comments below.

Have you looked carefully?

See below an extract from your debug log:

returnQName: getIssueReturn
returnType:  {http://beans.soap.rpc.jira.atlassian.com}RemoteIssue
returnClass: class com.atlassian.jira.rpc.soap.client.RemoteIssue
elementQName:null
soapAction:  null
style:       rpc
use:         encoded
numInParams: 2
method:null
 ParameterDesc[0]:
  name:       in0
  typeEntry:  null
  mode:       IN
  position:   0
  isReturn:   false
  typeQName:  {http://www.w3.org/2001/XMLSchema}string
  javaType:   class java.lang.String
  inHeader:   false
  outHeader:  false

 ParameterDesc[1]:
  name:       in1
  typeEntry:  null
  mode:       IN
  position:   1
  isReturn:   false
  typeQName:  {http://www.w3.org/2001/XMLSchema}string
  javaType:   class java.lang.String
  inHeader:   false
  outHeader:  false

 FaultDesc[0]:
  name: null
  qname: {http://localhost:8090/jira/rpc/soap/jirasoapservice-v2}fault
  type: {http://exception.rpc.jira.atlassian.com}RemotePermissionException
  Class: com.atlassian.jira.rpc.soap.client.RemotePermissionException

 FaultDesc[1]:
  name: null
  qname: {http://localhost:8090/jira/rpc/soap/jirasoapservice-v2}fault
  type: {http://exception.rpc.jira.atlassian.com}RemoteAuthenticationException
  Class: com.atlassian.jira.rpc.soap.client.RemoteAuthenticationException

 FaultDesc[2]:
  name: null
  qname: {http://localhost:8090/jira/rpc/soap/jirasoapservice-v2}fault
  type: {http://exception.rpc.jira.atlassian.com}RemoteException
  Class: com.atlassian.jira.rpc.soap.client.RemoteException


2015-01-17 17:24:49 DEBUG Call:2045 - operation.getNumParams()=2
2015-01-17 17:24:49 DEBUG Call:2068 - getParamList number of params: 2
2015-01-17 17:24:49 DEBUG Call:2405 - Enter: Call::invoke(RPCElement)
2015-01-17 17:24:49 DEBUG SOAPPart:182 - Enter: SOAPPart ctor(FORM_SOAPENVELOPE)
2015-01-17 17:24:49 DEBUG ProjectResourceBundle:72 - org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
2015-01-17 17:24:49 DEBUG SOAPPart:374 - Setting current message form to: FORM_SOAPENVELOPE (currentMessage is now org.apache.axis.message.SOAPEnvelope)
2015-01-17 17:24:49 DEBUG SOAPPart:188 - Exit: SOAPPart ctor()
2015-01-17 17:24:49 DEBUG ProjectResourceBundle:72 - org.apache.axis.i18n.resource::handleGetObject(addBody00)
2015-01-17 17:24:49 DEBUG SOAPBody:168 - Adding body element to message...
2015-01-17 17:24:49 DEBUG Call:2638 - Enter: Call::invoke()
2015-01-17 17:24:49 DEBUG MessageContext:748 - MessageContext: setTargetService(jirasoapservice-v2)
2015-01-17 17:24:49 DEBUG ProjectResourceBundle:72 - org.apache.axis.i18n.resource::handleGetObject(noService10)
2015-01-17 17:24:49 DEBUG ConfigurationException:110 - Exception: 
org.apache.axis.ConfigurationException: No service named jirasoapservice-v2 is available
org.apache.axis.ConfigurationException: No service named jirasoapservice-v2 is available
at org.apache.axis.configuration.FileProvider.getService(FileProvider.java:233)
at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
at org.apache.axis.MessageContext.setTargetService(MessageContext.java:755)
at org.apache.axis.client.Call.invoke(Call.java:2690)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)



Debug log is attached, containing startup and one connection where I push a new change set to the server.

Anything I missed in the config?

Seems a permissions problem on your Jira server.

Luca.


Thanks,
Karoly

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<my.log>

Karoly Molnar

unread,
Jan 23, 2015, 7:30:55 AM1/23/15
to repo-d...@googlegroups.com, gumic...@gmail.com
Thanks Luca,

I contacted Atlassian and will post back the resolution of the issue if I can figure it out,
Karoly

Karoly Molnar

unread,
Jan 23, 2015, 6:22:31 PM1/23/15
to repo-d...@googlegroups.com, gumic...@gmail.com
Hello Luca,

Atlassian got back to me and they are suggesting that I need the "JIRA Gerrit Plugin on JIRA". Is that true? I did not read it anywhere that I'd need to install that.

Please advise. Thanks,
Karoly

----- Atlassian answer START -----
Hey Karoly,

Thanks for contacting Atlassian Support.

Actually you’d also need to install JIRA Gerrit Plugin on JIRA, but unfortunately it’s not available on our Cloud platform yet, as you can see at:

https://marketplace.atlassian.com/plugins/com.meetme.plugins.jira.gerrit-plugin
At this moment there are no plans of adding new plugins to our Cloud platform, but we do have a new framework called Atlassian Connect, which will enable plugins to provide their services in Cloud. I’d recommend you to contact the plugin developer and ask them about their roadmap regarding Atlassian Connect.

Sorry for not being more helpful and please let me know if there is anything else I could assist you with.

Cheers,
Jose Raupp
Cloud Support
----- Atlassian answer END -----

Luca Milanesio

unread,
Jan 23, 2015, 6:39:07 PM1/23/15
to Karoly Molnar, repo-discuss
Not really :-) they simply don’t really know Gerrit and more importantly their API stack :-(

However, it seems that they don’t expose their SOAP API on their Cloud platform, the ones that are used by Gerrit ITS plugin to communicate with Jira.
For on-premises installation, they are available on Jira … but not on Cloud I’m afraid.

Luca.

Doug Kelly

unread,
Jan 27, 2015, 11:25:10 AM1/27/15
to repo-d...@googlegroups.com, gumic...@gmail.com


On Friday, January 23, 2015 at 5:39:07 PM UTC-6, lucamilanesio wrote:
Not really :-) they simply don’t really know Gerrit and more importantly their API stack :-(

However, it seems that they don’t expose their SOAP API on their Cloud platform, the ones that are used by Gerrit ITS plugin to communicate with Jira.
For on-premises installation, they are available on Jira … but not on Cloud I’m afraid.


More importantly, the SOAP API has been deprecated, and is planned to be removed in JIRA 8.0:

Apparently, they've announced (in some of the comments) the API will remain through 7.x, but by 8.0 the missing features in the REST API should be present (they previously stated that feature parity was a precondition for SOAP API removal), and the SOAP API will be no more.

--Doug

lucamilanesio

unread,
Jan 27, 2015, 11:33:50 AM1/27/15
to repo-d...@googlegroups.com, gumic...@gmail.com
Atlassian at [1] says:
"JIRA 5.0 and later. REST is the recommended and supported remote API in JIRA 5.0 and later."
The ITS-Plugins were born wheb the REST API were just born on Jira 5.0, whilst lots of people were still on version <= 5.0.
Now situation is different and it would make sense to move to REST-APIs ... contributions are more than welcome :-)

Luca.

Luca Milanesio

unread,
Jan 27, 2015, 11:50:11 AM1/27/15
to repo-discuss, Karoly Molnar
… and forgot to add … hooks-jira (the old repo for its-jira) it was actually written even before 5.0 existed at all :-)
Again, its-* architecture is easily extensible: we just need to re-implement the “last-mile” and with REST-API shouldn’t be difficult at all.

Luca.


Karoly Molnar

unread,
Jan 29, 2015, 6:29:26 AM1/29/15
to repo-d...@googlegroups.com, gumic...@gmail.com
Hey Luca,

I've been looking at the JIRA cloud installation and it seems fine. I ended up testing it with perl. It does work with perl using the SOAP API. Here's my jiraclient.pl script:
====
#!/usr/bin/perl

# Sample Perl client accessing JIRA via SOAP using the CPAN
# JIRA::Client module.

use strict;
use warnings;
use Data::Dumper;
use JIRA::Client;

my $jirauser = '***';
my $passwd   = '***';
my $jira = JIRA::Client->new('https://***.atlassian.net/', $jirauser, $passwd);

my $issue = $jira->getIssue('SE-2');
print "Retrieved issue:", Dumper($issue), "\n";

my $baseurl = $jira->getServerInfo()->{baseUrl};
print $baseurl;

print "Adding comment..\n";
# Note: JIRA::Client converts transparently addComment's first
# argument from a RemoteIssue object into an issue key and its second
# argument from a string into a RemoteComment object. This kind of
# implicit conversion is performed for several methods, making it
# easier to use the API.
$jira->addComment($issue, 'Comment added with SOAP');
====

The JIRA:Client is just a SOAP wrapper from CPAN: http://search.cpan.org/~gnustavo/JIRA-Client/

Result clearly shows that everything is working fine on JIRA and I can authenticate, get info and add comments:
====
$ ./jiraclient.pl
Retrieved issue:$VAR1 = bless( {
                 'fixVersions' => [],
                 'duedate' => undef,
                 'resolution' => undef,
                 'id' => '10124',
                 'affectsVersions' => [],
                 'customFieldValues' => [
                                        bless( {
                                                 'customfieldId' => 'customfield_10011',
                                                 'values' => [
                                                             '0|i000aj:'
                                                           ],
                                                 'key' => undef
                                               }, 'RemoteCustomFieldValue' ),
                                        bless( {
                                                 'values' => [
                                                             undef
                                                           ],
                                                 'key' => undef,
                                                 'customfieldId' => 'customfield_10021'
                                               }, 'RemoteCustomFieldValue' )
                                      ],
                 'attachmentNames' => [
                                      'my.log'
                                    ],
                 'environment' => undef,
                 'status' => '10000',
                 'type' => '10001',
                 'updated' => '2015-01-29T11:15:02.704Z',
                 'key' => 'SE-2',
                 'reporter' => '***',
                 'components' => [],
                 'summary' => 'Gerrit install',
                 'description' => undef,
                 'created' => '2015-01-17T17:53:32.731Z',
                 'priority' => '2',
                 'project' => 'SE',
                 'votes' => '0',
                 'assignee' => '***'
               }, 'RemoteIssue' );

https://***.atlassian.net
====

So I started looking at the gerrit log again and where it fails it uses a URL to localhost:
http://localhost:8090/jira/rpc/soap/jirasoapservice-v2

I don't know where this comes from, but I'm thinking that something is wrong with my config and JIRA is actually configured correctly. Any clue what I might be configuring incorrectly? Why does it switch from the JIRA url to this localhost:8090 url?

Thanks,
Karoly

Karoly Molnar

unread,
Jan 29, 2015, 2:36:27 PM1/29/15
to repo-d...@googlegroups.com, gumic...@gmail.com
I'm also a bit confused of which plugin(s) is/are needed.

There are several on the jenkins server:
- its-base-2.9-SNAPSHOT.jar
- original-its-jira-2.9-SNAPSHOT.jar
- its-jira-2.9-SNAPSHOT.jar

Currently I only have its-jira-2.9-SNAPSHOT.jar installed, yet I'm having these issues. Is this OK?

Looking at the its-jira-2.9-SNAPSHOT.jar seems to contain both its-base and original-its-jira and a ton of other things like Apache axis, jira client, etc...

Please clarify what is needed.

In the mean time I'll try using the original-its-jira plugin

Thanks,
Karoly

Luca Milanesio

unread,
Jan 29, 2015, 3:44:22 PM1/29/15
to Karoly Molnar, repo-d...@googlegroups.com
its-jira-* is the one to install.

With regards to the endpoint ... Localhost????

You saw in the logs that was connecting to the server isn't it?

Luca

Sent from my iPhone

Karoly Molnar

unread,
Jan 30, 2015, 9:18:00 AM1/30/15
to repo-d...@googlegroups.com, gumic...@gmail.com
I am testing the beast with mitmproxy and I can see that when gerrit starts it logs in over soap and the gets serverinfo. Then everything is quiet.

When I push a change to gerrit the its plugin fetches the JIRA id from jira, but then there's nothing.
sent to server:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getIssue soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com"><in0 xsi:type="xsd:string">ca18bbf465f156c815e02b5cf11361b448dc9cd4</in0><in1 xsi:type="xsd:string">SE-2</in1></ns1:getIssue></soapenv:Body></soapenv:Envelope>

response from server
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getIssueResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com"><getIssueReturn href="#id0"/></ns1:getIssueResponse><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RemoteIssue" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com"><affectsVersions soapenc:arrayType="ns2:RemoteVersion[0]" xsi:type="soapenc:Array"/><assignee xsi:type="xsd:string">kmolnar</assignee><attachmentNames soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"><attachmentNames xsi:type="xsd:string">my.log</attachmentNames></attachmentNames><components soapenc:arrayType="ns2:RemoteComponent[0]" xsi:type="soapenc:Array"/><created xsi:type="xsd:dateTime">2015-01-17T17:53:32.731Z</created><customFieldValues soapenc:arrayType="ns2:RemoteCustomFieldValue[2]" xsi:type="soapenc:Array"><customFieldValues href="#id1"/><customFieldValues href="#id2"/></customFieldValues><description xsi:type="xsd:string" xsi:nil="true"/><duedate xsi:type="xsd:dateTime" xsi:nil="true"/><environment xsi:type="xsd:string" xsi:nil="true"/><fixVersions soapenc:arrayType="ns2:RemoteVersion[0]" xsi:type="soapenc:Array"/><id xsi:type="xsd:string">10124</id><key xsi:type="xsd:string">SE-2</key><priority xsi:type="xsd:string">2</priority><project xsi:type="xsd:string">SE</project><reporter xsi:type="xsd:string">kmolnar</reporter><resolution xsi:type="xsd:string" xsi:nil="true"/><status xsi:type="xsd:string">10000</status><summary xsi:type="xsd:string">Gerrit install</summary><type xsi:type="xsd:string">10001</type><updated xsi:type="xsd:dateTime">2015-01-30T01:59:40.902Z</updated><votes xsi:type="xsd:long">0</votes></multiRef><multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:RemoteCustomFieldValue" xmlns:ns3="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><customfieldId xsi:type="xsd:string">customfield_10011</customfieldId><key xsi:type="xsd:string" xsi:nil="true"/><values soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"><values xsi:type="xsd:string">0|i000aj:</values></values></multiRef><multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:RemoteCustomFieldValue" xmlns:ns4="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><customfieldId xsi:type="xsd:string">customfield_10021</customfieldId><key xsi:type="xsd:string" xsi:nil="true"/><values soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"><values xsi:type="xsd:string" xsi:nil="true"/></values></multiRef></soapenv:Body></soapenv:Envelope>

All good, but then in the log I can see that it parses the response and a big fat nothing after it. It does not attempt to add a comment. I don't see any log about making a decision which rules to run from the action.config. What do I need to enable on log4j to get some debug log on that?

Based on my its/action.config add-comment action should fire for the patch-set rule. But I don't see why it is not.

[rule "patch-set"]
        event-type = patchset-created
        action = add-comment A new patchset was added to the Gerrit change
        action = log-event
[rule "merged"]
        event-type = change-merged
        action = add-standard-comment
        action = log-event
[rule "verified_no"]
        event-type = comment-added
        approval-Verified = -1
        action = add-comment Verification by Jenkins failed
        action = log-event
[rule "verified_yes"]
        event-type = comment-added
        approval-Verified = +1
        action = add-comment Verification by Jenkins was successful
[rule "ref-updated"]
        event-type = ref-updated
        action = add-standard-comment

Any idea? All seems fine, but there's just no action firing.

Thanks,
Karoly

Luca Milanesio

unread,
Jan 30, 2015, 10:27:20 AM1/30/15
to Karoly Molnar, repo-d...@googlegroups.com
Hi Karoly,
from the XML traces everything is fine with the Jira communication: please enable more Log4J traces on Gerrit.

Luca.

Karoly Molnar

unread,
Jan 30, 2015, 11:00:28 AM1/30/15
to repo-d...@googlegroups.com, gumic...@gmail.com
I have this config:

/var/lib/gerrit2/server/etc/gerrit.config


[container]
        javaOptions = -Dlog4j.configuration=file:///var/lib/gerrit2/server/etc/log4j.properties

/var/lib/gerrit2/server/etc/log4j.properties


log4j.rootCategory=DEBUG, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/var/lib/gerrit2/server/logs/my.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.target=System.err
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=[%d] %-5p %c %x: %m%n

log4j.logger.com.google.gerrit=DEBUG


# Silence non-critical messages from MINA SSHD.
#
log4j.logger.org.apache.mina=DEBUG
log4j.logger.org.apache.sshd.common=DEBUG
log4j.logger.org.apache.sshd.server=DEBUG
log4j.logger.org.apache.sshd.common.keyprovider.FileKeyPairProvider=INFO
log4j.logger.com.google.gerrit.sshd.GerritServerSession=DEBUG


# Silence non-critical messages from Jetty.
#
log4j.logger.org.eclipse.jetty=INFO

# Silence non-critical messages from mime-util.
#
log4j.logger.eu.medsea.mimeutil=WARN

# Silence non-critical messages from openid4java
#
log4j.logger.org.apache.http=DEBUG

log4j.logger.org.apache.xml=WARN
log4j.logger.org.openid4java=WARN
log4j.logger.org.openid4java.consumer.ConsumerManager=FATAL
log4j.logger.org.openid4java.discovery.Discovery=ERROR
log4j.logger.org.openid4java.server.RealmVerifier=ERROR
log4j.logger.org.openid4java.message.AuthSuccess=ERROR

# Silence non-critical messages from c3p0 (if used).
#
log4j.logger.com.mchange.v2.c3p0=WARN
log4j.logger.com.mchange.v2.resourcepool=WARN
log4j.logger.com.mchange.v2.sql=WARN

# Silence non-critical messages from Velocity
#
log4j.logger.velocity=WARN

# Silence non-critical messages from apache.http
log4j.logger.org.apache.http=DEBUG

How do I enhance this to get better logs? Is there a better way to config this?

I can't find anything on this forum for suggestion or best practices regarding more verbose log4j. I searched through the gerrit.war for log4j config, but can't seem to locate it either.

Sorry for being pain ;-)

Thanks,
Karoly

Luca Milanesio

unread,
Jan 30, 2015, 11:09:25 AM1/30/15
to Karoly Molnar, repo-d...@googlegroups.com
According to [1] the Jira Facade logger is:
com.googlesource.gerrit.plugins.hooks.jira. JiraItsFacade

Set this to DEBUG.


HTH

Luca.

Karoly Molnar

unread,
Jan 30, 2015, 10:23:28 PM1/30/15
to repo-d...@googlegroups.com, gumic...@gmail.com

I enabled all its-base and its-jira in logging:

# ITS-Base debug
log4j.logger.com.googlesource.gerrit.plugins.hooks.its.InitIts=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.its.ItsConfig=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.its.ItsFacade=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.its.ItsHookEnabledConfigEntry=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.its.NoopItsFacade=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.ItsHookModule=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.util.IssueExtractor=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.util.PropertyAttributeExtractor=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.validation.ItsAssociationPolicy=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.validation.ItsValidateComment=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.action.Action=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.action.AddComment=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.action.AddStandardComment=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.action.AddVelocityComment=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.action.LogEvent=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.ActionController=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.Condition=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.GerritHookFilter=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.GerritHookFilterAddComment=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.GerritHookFilterAddRelatedLinkToChangeId=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.GerritHookFilterAddRelatedLinkToGitWeb=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.GerritHookFilterChangeState=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.Property=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.Rule=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.workflow.RuleBase=DEBUG

# ITS-JIRA debug
log4j.logger.com.googlesource.gerrit.plugins.hooks.jira.InitJira=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.jira.JiraClient=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.jira.JiraItsFacade=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.jira.JiraModule=DEBUG
log4j.logger.com.googlesource.gerrit.plugins.hooks.jira.JiraSession=DEBUG

Here's the log:
2015-01-30 22:09:19 INFO  JiraModule:49 - JIRA is configured as ITS
2015-01-30 22:09:19 DEBUG JiraItsFacade:196 - Connecting to jira at URL ***
2015-01-30 22:09:21 DEBUG JiraItsFacade:198 - Autenthicating as user ***
2015-01-30 22:09:23 INFO  JiraItsFacade:180 - Connected to *** as username=***, token=***
2015-01-30 22:09:24 INFO  JiraItsFacade:62 - Connected to JIRA at ***, reported version is 6.4-OD-13-026
2015-01-30 22:09:24 INFO  PluginLoader:397 - Loaded plugin its-jira, version 2.9-SNAPSHOT
2015-01-30 22:09:25 INFO  PluginLoader:397 - Loaded plugin singleusergroup, version v2.9.4
2015-01-30 22:09:26 INFO  SshDaemon:290 - Started Gerrit SSHD-CORE-0.9.0-4-G5967CFD on *:29418
2015-01-30 22:09:26 INFO  Server:300 - jetty-9.1.0.v20131115
2015-01-30 22:09:27 INFO  ContextHandler:746 - Started o.e.j.s.ServletContextHandler@a4c88a{/,file:/var/lib/gerrit2/server/tmp/gerrit_8909088248003991596_app/gerrit_war/,AVAILABLE}
2015-01-30 22:09:27 INFO  ServerConnector:265 - Started ServerConnector@56d0cb{SSL-http/1.1}{0.0.0.0:8443}
2015-01-30 22:09:27 INFO  Daemon:213 - Gerrit Code Review 2.9.4 ready

2015-01-30 22:11:41 INFO  GerritServerSession:89 - Session created from /192.168.10.78:59275
2015-01-30 22:11:42 INFO  GerritServerSession:504 - Session kmolnar@/192.168.10.78:59275 authenticated
2015-01-30 22:11:42 INFO  ChannelSession:445 - Executing command: git-receive-pack '/sandbox'
2015-01-30 22:11:42 DEBUG IssueExtractor:52 - Matching 'SE-2 Test n

Change-Id: Ie790896788d692f64bd2027027ffa976a5596d75
' against ([A-Z]+-[0-9]+)
2015-01-30 22:11:43 INFO  GerritServerSession:317 - Session kmolnar@/192.168.10.78:59275 closed

It seems that my rules and events are not even considered. Nothing seems to get triggered other than checking for the existence of the JIRA id. BTW, that works fine. I tested it with a wrong id and then the change is rejected.

I double checked and I have its-jira enabled in All-Projects:
[plugin "its-jira"]
        branch = refs/heads/*
        enabled = true

I'm clueless, ;-)
Karoly
...

Lawrence

unread,
Feb 6, 2015, 2:47:36 PM2/6/15
to repo-d...@googlegroups.com, gumic...@gmail.com


On Friday, January 30, 2015 at 7:23:28 PM UTC-8, Karoly Molnar wrote:

[plugin "its-jira"]
        branch = refs/heads/*
        enabled = true
 
There's a bug in specifying the branch.  Remove it and it should work:

[plugin "its-jira"]
        #branch = refs/heads/*
        enabled = true

Karoly Molnar

unread,
Feb 6, 2015, 11:38:05 PM2/6/15
to repo-d...@googlegroups.com, gumic...@gmail.com
Problem fixed.

Thanks Lawrence
Karoly
Reply all
Reply to author
Forward
0 new messages