[JAVA-2007] bson:checkstyleMain FAILED when ./gradlew check command is run Created: 07/Oct/15  Updated: 07/Dec/15  Resolved: 13/Oct/15

Status: Closed
Project: Java Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.2.0

Type: Improvement Priority: Major - P3
Reporter: Valencia Serrao Assignee: Ross Lawley
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RHEL ppc64le, OpenJDK Runtime Environment (rhel-2.6.1.2.ael7b_1-ppc64le u85-b01), OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode),


Attachments: PNG File error1.PNG     PNG File error2.PNG     PNG File error3.PNG     Text File gradleCheckResult.txt     Text File gradlewcheckStackTrace.txt     HTML File javaDriverErrorReport.html    

 Description   

I'm trying to build the mongo-java-driver from github repo : https://github.com/mongodb/mongo-java-driver and followed the build steps from "Build" section on the page.

However, after running ./gradlew check i'm getting this errror :

./gradlew check
:bson:compileJava UP-TO-DATE
:bson:compileGroovy UP-TO-DATE
:bson:processResources UP-TO-DATE
:bson:classes UP-TO-DATE
:bson:checkstyleMain FAILED

FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ':bson:checkstyleMain'.

> Unable to create a Checker: cannot initialize module SuppressionFilter - Cannot set property 'file' in module SuppressionFilter to 'config/checkstyle-exclude.xml': unable to find config/checkstyle-exclude.xml

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
Total time: 2.026 secs

Note: the file config/checkstyle-exclude.xml exists at the location

On running the with stacktrace option it shows that there is FileNotFoundException (PFA the stacktrace log)

Please let me know if any dependency needs to be fixed.



 Comments   
Comment by Jeffrey Yemin [ 07/Dec/15 ]

The 3.2.0 driver, which contains a fix for this issue, has been released today.

Comment by Valencia Serrao [ 15/Oct/15 ]

@Jeff: Issue resolved. Thank you!

Comment by Valencia Serrao [ 15/Oct/15 ]

Hi Ross,

I shifted to the master branch and also upgraded mongodb server to 3.1.10. All tests are now passing on the master branch.

I appreciate the dedication you've shown to resolve this JIRA ticket. Thank you!

Regards,
Valencia

Comment by Ross Lawley [ 13/Oct/15 ]

Hi valnci,

Just to let you know the gradlew change has been merged into master. I also updated the readme to ensure that users know about the enableTestCommands setting.

I was unable to replicate the failing test cases with the latest 3.1.9 pre release. Its possible they were caused by compatibility issues with the older pre release version.

Ross

Comment by Githook User [ 13/Oct/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Updated build instructions

Fixed exotic bug with checkstyle configuration

JAVA-2007
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4f21dff3840979dd020244ef568e7cb7b3b17ec9

Comment by Valencia Serrao [ 13/Oct/15 ]

Hi Ross

Waiting for your updates on the fixes.

Thanks for the insight into the "skipped tests".

Regards,
Valencia

Comment by Ross Lawley [ 13/Oct/15 ]

Hi Valencia,

I see you are running a development version of MongoDB, this is a likely cause for some of the test errors as support for 3.2 is still in active development. So changes regarding FindOperation have already hit the master branch but may not be in my branch yet. I'll look into those shortly and will update this ticket with any specific findings and fixes.

There are various reasons for skipping tests all to do with the topology of the database that they are running. The common cases are testing specific versions of MongoDB, testing specific topologies; replicaSets and sharded clusters and other tests test authentication. As such no single configuration will run all the test cases. The test matrix for the master branch can be seen here: https://jenkins.10gen.com/job/mongo-java-driver-test-3.x/

Ross

Comment by Valencia Serrao [ 13/Oct/15 ]

Hi Jeff,

Output of above mentioned commands is as follows:

------------------------------------------------------------------------------------------------------------------------------------------------------
> db.runCommand('buildinfo')
{
"version" : "3.1.8-pre-",
"gitVersion" : "6ce1ce2aeb1c7d5ac72cb5de21801a5aa15953ee",
"allocator" : "system",
"javascriptEngine" : "mozjs",
"sysInfo" : "deprecated",
"versionArray" : [
3,
1,
8,
-100
],
"openssl" :

{ "running" : "OpenSSL 1.0.1e-fips 11 Feb 2013", "compiled" : "OpenSSL 1.0.1e-fips 11 Feb 2013" }

,
"buildEnvironment" :

{ "build_command" : "", "cc" : "gcc: gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)", "ccflags" : "-fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fno-builtin-memcmp", "cflags" : "-std=c99", "cxx" : "g++: g++ (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)", "cxxflags" : "-Wnon-virtual-dtor -Woverloaded-virtual -std=c++11", "linkflags" : "-fPIC -pthread -Wl,-z,now -rdynamic", "modules" : [ ], "target_arch" : "PowerPC", "target_os" : "linux" }

,
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"storageEngines" : [
"devnull",
"inMemoryExperiment",
"mmapv1",
"wiredTiger"
],
"ok" : 1
}

---------------------------------------------------------------------------------------------------------------------------------------------------

> db.isMaster()

{ "ismaster" : true, "maxBsonObjectSize" : 16777216, "maxMessageSizeBytes" : 48000000, "maxWriteBatchSize" : 1000, "localTime" : ISODate("2015-10-13T04:32:25.185Z"), "maxWireVersion" : 4, "minWireVersion" : 0, "ok" : 1 }

-------------------------------------------------------------------------------------------------------------------------------------------
Please let me know if any other information is required.

Regards,
Valencia

Comment by Jeffrey Yemin [ 12/Oct/15 ]

Hi Valencia,

Please run the following two commands in a mongo shell and post the output to this ticket:

db.runCommand('buildinfo')
db.isMaster()

Comment by Valencia Serrao [ 12/Oct/15 ]

Hi Ross,

Thank you, indeed the documentation helped a lot. I've been able to proceed further. Most of the failures are now resolved.

However, there are 3 failures that still persists as follows:
1. testSettingACommentInsertsCommentIntoProfileCollectionWhenProfilingIsTurnedOn
file: driver/src/test/functional/com/mongodb/DBCursorTest.java

2. should apply comment
file: driver-core/src/test/functional/com/mongodb/operation/FindOperationSpecification.groovy

3. should pass miscallaneous flags through
file: driver-core/src/test/functional/com/mongodb/operation/FindOperationSpecification.groovy

PFA screenshot of each of the above failures after ./gradlew check

Please guide me on these errors.

Also there are some "skipped" tests, can you please tell why they are being skipped ?

Regards,
Valencia

Comment by Valencia Serrao [ 12/Oct/15 ]

Screenshot for error 3

Comment by Valencia Serrao [ 12/Oct/15 ]

Screenshot for error 2

Comment by Valencia Serrao [ 12/Oct/15 ]

Screenshot for error 1

Comment by Ross Lawley [ 09/Oct/15 ]

Hi Valencia,

Good news that has fixed the gradle issue.

The test failures look to be caused because mongodb doesn't have the test commands enabled, it looks like this has been missed out of the documentation and I'll update.

In meantime here is a the enableTestCommands documentation.

Ross

Comment by Valencia Serrao [ 09/Oct/15 ]

Hi Ross,

Thanks for the fix. Yes, after cloning new copy of the mongo-java-driver and doing a 'git checkout j2007', I'm able to proceed on the ./gradle check command. (with the mongod server up and running)

However, it has reported 13 failures. I have attached the console output and the .html file showing the test report.

Please let me know if any other dependencies need to resolved.

Regards,
Valencia

Comment by Valencia Serrao [ 09/Oct/15 ]

Error Report generated in .html

Comment by Valencia Serrao [ 09/Oct/15 ]

Output of ./gradlew check

Comment by Ross Lawley [ 08/Oct/15 ]

Hi valnci,

Thanks for opening this ticket and chasing the issue up. I haven't been able to replicate it locally on OSX or on our Jenkins machines which I believe are Ubuntu. However, if I change the checkstyle.xml suppression filter rule I can get the same error.

My hypothesis is that checkstyle.xml uses relative paths to the process running checkstyle, I'm not sure why that is causing an error for you but I hope I have a fix by setting the absolute path. Can you test the j2007 branch and see if that fixes the issue.

Thanks for your patience with this issue,

Ross

Comment by Githook User [ 08/Oct/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Gradle: Updated checkstyle configuration

JAVA-2007
Branch: j2007
https://github.com/mongodb/mongo-java-driver/commit/4db708e6cb1c0b4e89d73fee6433f69b528fd20d

Comment by Jeffrey Yemin [ 07/Oct/15 ]

The mongodb-dev thread that spawned this issue.

Generated at Thu Feb 08 08:56:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.