Gerrit master with Gitiles and commons-lang3 removal

90 views
Skip to first unread message

Gert van Dijk

unread,
Jun 12, 2018, 5:23:17 PM6/12/18
to Repo and Gerrit Discussion
Hi,

I've upgraded my Gerrit with Gitiles plugin (both master, from gerrit-ci), but it seems I'm running into the issue caused by 183330: Bazel: Remove unused commons-lang3 (gerrit), which I think is catched by 183331: Add dependency on commons-lang3 (gitiles).

Server errors include:
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

However, the latter change is still open pending a test. Could someone please point me out quickly how to build the Gitiles plugin with this change? (I'm familiar with Docker and the Jenkins slave image, but not Bazel and stuff). I would volunteer to test this change then. :)

Thanks,

Gert

Luca Milanesio

unread,
Jun 12, 2018, 5:34:32 PM6/12/18
to Gert van Dijk, Luca Milanesio, Repo and Gerrit Discussion

On 12 Jun 2018, at 22:23, Gert van Dijk <gert...@gmail.com> wrote:

Hi,

I've upgraded my Gerrit with Gitiles plugin (both master, from gerrit-ci)

Running Gerrit master then?
I've retriggered the build of the Gitiles plugin and it succeeded.

See below:

, but it seems I'm running into the issue caused by 183330: Bazel: Remove unused commons-lang3 (gerrit), which I think is catched by 183331: Add dependency on commons-lang3 (gitiles).

Server errors include:
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

However, the latter change is still open pending a test. Could someone please point me out quickly how to build the Gitiles plugin with this change? (I'm familiar with Docker and the Jenkins slave image, but not Bazel and stuff). I would volunteer to test this change then. :)

Thanks,

Gert

--
--
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.

Gert van Dijk

unread,
Jun 12, 2018, 5:55:33 PM6/12/18
to Repo and Gerrit Discussion
On Tuesday, 12 June 2018 23:34:32 UTC+2, lucamilanesio wrote:

Running Gerrit master then?
I've retriggered the build of the Gitiles plugin and it succeeded.

See below:

Yes, running both master.

The issue is still in the code as the change that fixes is, is still open at the time of writing. My question was how to build the pending change manually. *Then* we can submit the change, and build the Gitiles plugin on gerrit-ci again to fix it. :-)

Jonathan Nieder

unread,
Jun 12, 2018, 5:56:14 PM6/12/18
to Gert van Dijk, Repo and Gerrit Discussion


вт, 12 июн. 2018 г. в 14:23, Gert van Dijk <gert...@gmail.com>:
 cd gitiles
 git fetch https://gerrit.googlesource.com/plugins/gitiles refs/changes/31/183331/2 && git checkout FETCH_HEAD
 bazel build gitiles.jar

Then the plugin will be in bazel-genfiles/gitiles.jar. That builds for stable-2.14. If you want a build for "master", you can run

 git pull origin master
 bazel build gitiles.jar

except the "git pull" produces conflicts. Hm.

Thanks and hope that helps,
Jonathan

Gert van Dijk

unread,
Jun 12, 2018, 5:59:08 PM6/12/18
to Repo and Gerrit Discussion
On Tuesday, 12 June 2018 23:56:14 UTC+2, Jonathan Nieder wrote:
 cd gitiles
 git fetch https://gerrit.googlesource.com/plugins/gitiles refs/changes/31/183331/2 && git checkout FETCH_HEAD
 bazel build gitiles.jar

Then the plugin will be in bazel-genfiles/gitiles.jar. That builds for stable-2.14. If you want a build for "master", you can run

 git pull origin master
 bazel build gitiles.jar

except the "git pull" produces conflicts. Hm.

Thanks and hope that helps,
Jonathan

Yes, thanks a lot. :-) Will report tomorrow.

David Pursehouse

unread,
Jun 12, 2018, 8:05:19 PM6/12/18
to Gert van Dijk, Repo and Gerrit Discussion
On Wed, Jun 13, 2018 at 6:23 AM Gert van Dijk <gert...@gmail.com> wrote:
Hi,

I've upgraded my Gerrit with Gitiles plugin (both master, from gerrit-ci), but it seems I'm running into the issue caused by 183330: Bazel: Remove unused commons-lang3 (gerrit), which I think is catched by 183331: Add dependency on commons-lang3 (gitiles).

This should not be causing a problem on master.  The removal of commons-lang3 was reverted during the merge up from stable-2.15:


 

Server errors include:
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

However, the latter change is still open pending a test.

I've just confirmed that change on gerrit's latest stable-2.14 and submitted it.
 
Could someone please point me out quickly how to build the Gitiles plugin with this change? (I'm familiar with Docker and the Jenkins slave image, but not Bazel and stuff). I would volunteer to test this change then. :)

Thanks,

Gert

--

Gert van Dijk

unread,
Jun 13, 2018, 2:27:58 AM6/13/18
to Repo and Gerrit Discussion
On Wednesday, 13 June 2018 02:05:19 UTC+2, David Pursehouse wrote:
On Wed, Jun 13, 2018 at 6:23 AM Gert van Dijk <gert...@gmail.com> wrote:
Hi,

I've upgraded my Gerrit with Gitiles plugin (both master, from gerrit-ci), but it seems I'm running into the issue caused by 183330: Bazel: Remove unused commons-lang3 (gerrit), which I think is catched by 183331: Add dependency on commons-lang3 (gitiles).

This should not be causing a problem on master.  The removal of commons-lang3 was reverted during the merge up from stable-2.15:



Oh, interesting. Why do I see this error when using Gitiles master on Gerrit master? I should not. Am I running into something else? Full traceback here: http://paste.openstack.org/show/723368/

(I also noticed that the release.war has shrunk from 83MB -> 69MB.)


 
However, the latter change is still open pending a test.
 
I've just confirmed that change on gerrit's latest stable-2.14 and submitted it.
 
Thanks :)

David Pursehouse

unread,
Jun 13, 2018, 3:30:08 AM6/13/18
to Gert van Dijk, Repo and Gerrit Discussion
On Wed, Jun 13, 2018 at 3:28 PM Gert van Dijk <gert...@gmail.com> wrote:
On Wednesday, 13 June 2018 02:05:19 UTC+2, David Pursehouse wrote:
On Wed, Jun 13, 2018 at 6:23 AM Gert van Dijk <gert...@gmail.com> wrote:
Hi,

I've upgraded my Gerrit with Gitiles plugin (both master, from gerrit-ci), but it seems I'm running into the issue caused by 183330: Bazel: Remove unused commons-lang3 (gerrit), which I think is catched by 183331: Add dependency on commons-lang3 (gitiles).

This should not be causing a problem on master.  The removal of commons-lang3 was reverted during the merge up from stable-2.15:



Oh, interesting. Why do I see this error when using Gitiles master on Gerrit master? I should not. Am I running into something else? Full traceback here: http://paste.openstack.org/show/723368/

Not sure what's going on there.  Have you tried locally building the plugin's master branch?

 

(I also noticed that the release.war has shrunk from 83MB -> 69MB.)


This is probably due to several dependencies being removed with the refactoring of Elasticsearch.


 

 
However, the latter change is still open pending a test.
 
I've just confirmed that change on gerrit's latest stable-2.14 and submitted it.
 
Thanks :)

Gert van Dijk

unread,
Jun 13, 2018, 4:18:02 AM6/13/18
to Repo and Gerrit Discussion

On Wednesday, 13 June 2018 09:30:08 UTC+2, David Pursehouse wrote:
Oh, interesting. Why do I see this error when using Gitiles master on Gerrit master? I should not. Am I running into something else? Full traceback here: http://paste.openstack.org/show/723368/

Not sure what's going on there.  Have you tried locally building the plugin's master branch?

One more clue here: Gitiles is working pretty OK *until* it has to format Markdown and I have enabled three extensions in my configuration: blocknote, multicolumn, namedanchor. This causes all repositories with a README.md/navbar.md to fail currently.

I've tried building locally and it fails for me (output below) for I guess this is the "standalone" build approach from here. This happens as root inside the Docker container started with e.g.

$ docker run --rm -it --entrypoint /bin/bash gerritforge/jenkins-slave-bazel

and just verified that this is the latest version of the Docker image.

root@e0398daf1868:~/gitiles# bazel build gitiles.jar
Extracting Bazel installation...
...........
ERROR: /root/.cache/bazel/_bazel_root/9dbf83323c06dcaacb6289a72ed0dfd9/external/com_googlesource_gerrit_bazlets/gerrit_api_maven_local.bzl:37:3: no such package '@gerrit_plugin_api//jar': failed /usr/bin/python /root/.cache/bazel/_bazel_root/9dbf83323c06dcaacb6289a72ed0dfd9/external/com_googlesource_gerrit_bazlets/tools/download_file.py -o /root/.cache/bazel/_bazel_root/9dbf83323c06dcaacb6289a72ed0dfd9/external/gerrit_plugin_api/jar/gerrit-plugin-api-2.16-SNAPSHOT.jar -u MAVEN_LOCAL:/com/google/gerrit/gerrit-plugin-api/2.16-SNAPSHOT/gerrit-plugin-api-2.16-SNAPSHOT.jar: Download file:///root/.m2/repository/com/google/gerrit/gerrit-plugin-api/2.16-SNAPSHOT/gerrit-plugin-api-2.16-SNAPSHOT.jar
error using curl: Command '['curl', '--proxy-anyauth', '-ksfo', '/root/.gerritcodereview/bazel-cache/downloaded-artifacts/gerrit-plugin-api-2.16-SNAPSHOT.jar-a6cf043c8712b39b43739ffe82e53a1923b81630', 'file:///root/.m2/repository/com/google/gerrit/gerrit-plugin-api/2.16-SNAPSHOT/gerrit-plugin-api-2.16-SNAPSHOT.jar']' returned non-zero exit status 37
 and referenced by '//external:gerrit-plugin-api-neverlink'
ERROR: Analysis of target '//:gitiles.jar' failed; build aborted: Loading failed
INFO: Elapsed time: 4.041s
FAILED: Build did NOT complete successfully (11 packages loaded)
root@e0398daf1868:~/gitiles# git rev-parse HEAD
fd51b3f2b95d392b54da9d0c87c302c851ef78b2

Also tried with Docker image gerritforge/gerrit-ci-slave-bazel, but fails with the same error.

I noticed this though:

root@e0398daf1868:~/gerrit# bazel version
Build label: 0.7.0

So it seems a Bazel-out-of-date issue. How is Gerritforge building this then? I assumed it was using their own Docker images...

Then I noticed the 'latest' tag of the Docker image hasn't been pushed for over 6 months..., but the 'debian' tag is. Hmm. With that image I indeed have a bazel 0.14.0, but it still fails to build:

root@12fffeb88959:~/gitiles# bazel build gitiles.jar
Starting local Bazel server and connecting to it...
........
ERROR: /root/.cache/bazel/_bazel_root/9dbf83323c06dcaacb6289a72ed0dfd9/external/com_googlesource_gerrit_bazlets/gerrit_api_maven_local.bzl:37:3: no such package '@gerrit_plugin_api//jar': failed /usr/bin/python /root/.cache/bazel/_bazel_root/9dbf83323c06dcaacb6289a72ed0dfd9/external/com_googlesource_gerrit_bazlets/tools/download_file.py -o /root/.cache/bazel/_bazel_root/9dbf83323c06dcaacb6289a72ed0dfd9/external/gerrit_plugin_api/jar/gerrit-plugin-api-2.16-SNAPSHOT.jar -u MAVEN_LOCAL:/com/google/gerrit/gerrit-plugin-api/2.16-SNAPSHOT/gerrit-plugin-api-2.16-SNAPSHOT.jar: Download file:///root/.m2/repository/com/google/gerrit/gerrit-plugin-api/2.16-SNAPSHOT/gerrit-plugin-api-2.16-SNAPSHOT.jar
error using curl: Command '['curl', '--proxy-anyauth', '-ksfo', '/root/.gerritcodereview/bazel-cache/downloaded-artifacts/gerrit-plugin-api-2.16-SNAPSHOT.jar-a6cf043c8712b39b43739ffe82e53a1923b81630', 'file:///root/.m2/repository/com/google/gerrit/gerrit-plugin-api/2.16-SNAPSHOT/gerrit-plugin-api-2.16-SNAPSHOT.jar']' returned non-zero exit status 37
 and referenced by '//external:gerrit-plugin-api-neverlink'
ERROR: Analysis of target '//:gitiles.jar' failed; build aborted: Loading failed
INFO: Elapsed time: 2.934s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (7 packages loaded)
    currently loading: @bazel_tools//tools/jdk
root@12fffeb88959:~/gitiles# bazel version
Build label: 0.14.0

curl seems to be failing in the above error. I guess it's because this gerrit-plugin-api-2.16-SNAPSHOT.jar does not exist on the file system. Perhaps this is not available for master?

So I tried an in-tree build and that build worked.

But still, all Markdown formatting fails with the same traceback. I should file an issue I guess?

Gert van Dijk

unread,
Jun 13, 2018, 4:45:08 AM6/13/18
to Repo and Gerrit Discussion
On Wednesday, 13 June 2018 10:18:02 UTC+2, Gert van Dijk wrote:

But still, all Markdown formatting fails with the same traceback. I should file an issue I guess?

Done in Issue 9253.

(At least I know how to build Gerrit and its plugins. Thanks!)

David Ostrovsky

unread,
Jun 13, 2018, 4:51:18 AM6/13/18
to Repo and Gerrit Discussion

Am Mittwoch, 13. Juni 2018 10:18:02 UTC+2 schrieb Gert van Dijk:

On Wednesday, 13 June 2018 09:30:08 UTC+2, David Pursehouse wrote:
Oh, interesting. Why do I see this error when using Gitiles master on Gerrit master? I should not. Am I running into something else? Full traceback here: http://paste.openstack.org/show/723368/

Not sure what's going on there.  Have you tried locally building the plugin's master branch?

One more clue here: Gitiles is working pretty OK *until* it has to format Markdown and I have enabled three extensions in my configuration: blocknote, multicolumn, namedanchor. This causes all repositories with a README.md/navbar.md to fail currently.

I've tried building locally and it fails for me (output below) for I guess this is the "standalone" build approach from here.

We don't publish SNAPSHOTs for a while. So to build against snapshot,
you would need to publish the snapshot first to your local Maven
repository while building gerrit core, e.g.:

  $ tools/maven/api.sh install

Regarding to

NoClassDefFoundError: org/apache/commons/lang3/StringUtils

are you actually sure and double checked you are using gerrit master and not
2-15.2 releases, where commons-lang3 was in fact removed? But re-added
later? See also https://github.com/google/gitiles/issues/140 and discussion
on the this mailing list in another thread.

Gert van Dijk

unread,
Jun 13, 2018, 4:58:15 AM6/13/18
to Repo and Gerrit Discussion
On Wednesday, 13 June 2018 10:51:18 UTC+2, David Ostrovsky wrote:

We don't publish SNAPSHOTs for a while. So to build against snapshot,
you would need to publish the snapshot first to your local Maven
repository while building gerrit core, e.g.:

  $ tools/maven/api.sh install

Ah, okay, thanks for the clarification. I'm such a noob with all the Java build tooling. :)


Regarding to

NoClassDefFoundError: org/apache/commons/lang3/StringUtils

are you actually sure and double checked you are using gerrit master and not
2-15.2 releases, where commons-lang3 was in fact removed? But re-added
later? See also https://github.com/google/gitiles/issues/140 and discussion
on the this mailing list in another thread.


Yes, very sure all is master. I copied/pasted the exact versions from the Gerrit server startup message in my issue: Issue 9253.

David Ostrovsky

unread,
Jun 14, 2018, 2:18:03 AM6/14/18
to Repo and Gerrit Discussion
You are right, sorry for confusion. commons-lang3 was only used in
tests on master and thus plugins must ship it in plugin jar. gitiles plugin
should be fixed now. 

Gert van Dijk

unread,
Jun 14, 2018, 2:40:54 AM6/14/18
to Repo and Gerrit Discussion
On Thursday, 14 June 2018 08:18:03 UTC+2, David Ostrovsky wrote:
You are right, sorry for confusion. commons-lang3 was only used in
tests on master and thus plugins must ship it in plugin jar. gitiles plugin
should be fixed now. 

(also posting here for completeness)
Seems solved with your change in plugins/gitiles. Thanks again, all! :)

Gert van Dijk

unread,
Jun 20, 2018, 6:13:35 AM6/20/18
to Repo and Gerrit Discussion
Another, seemingly related issue with "java.lang.NoClassDefFoundError: org/apache/commons/[...]" appeared to me today. Perhaps not fully tackled yet? Filed as Issue 9317.
Reply all
Reply to author
Forward
0 new messages