Build Failure on Linux - EnforcerRuleException

Developers forum for Univeral Media Server-related development (only for programmers)
User avatar
Sami32
Posts: 817
Joined: Mon Apr 11, 2016 5:09 am

Re: Build Failure on Linux - EnforcerRuleException

Post by Sami32 » Fri May 12, 2017 6:07 am

@J.L.C. Thank you for having take the time to report, test and post logs 8-)
That helped a lot.

Code: Select all

Running net.pms.util.UMSUtilsTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.92 sec <<< FAILURE! - in net.pms.util.UMSUtilsTest
testPlayedDurationStr(net.pms.util.UMSUtilsTest)  Time elapsed: 0.92 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
    at net.pms.util.UMSUtilsTest.setUp(UMSUtilsTest.java:24)
Caused by: java.lang.NullPointerException
    at net.pms.util.UMSUtilsTest.setUp(UMSUtilsTest.java:24

Code: Select all

PMS.get();
@Nadahar I writen to Travis about OpenJDK 8 and shared a link with them, so i'll wait for their answer, or act.
Last edited by Sami32 on Fri May 12, 2017 6:12 am, edited 1 time in total.

User avatar
Nadahar
Developer
Posts: 1179
Joined: Tue Jun 09, 2015 5:57 pm

Re: Build Failure on Linux - EnforcerRuleException

Post by Nadahar » Fri May 12, 2017 6:10 am

@Sami32 It seems like there's no need to write to Travis, look at https://github.com/UniversalMediaServer ... c4e2be7887

What is strange, is that the OpenJDK8 build doesn't fail, so the problem must be something else: https://travis-ci.org/UniversalMediaSer ... tification

User avatar
Sami32
Posts: 817
Joined: Mon Apr 11, 2016 5:09 am

Re: Build Failure on Linux - EnforcerRuleException

Post by Sami32 » Fri May 12, 2017 6:21 am

@Nadahar Cool 8-)
Don't try to be too smart :P Sharing is not a "need", it's our shared responsability/duty, better if it's useful.

Except if you get why a NPE is throwed on this test:

Code: Select all

PMS.get()

User avatar
Nadahar
Developer
Posts: 1179
Joined: Tue Jun 09, 2015 5:57 pm

Re: Build Failure on Linux - EnforcerRuleException

Post by Nadahar » Fri May 12, 2017 6:35 am

This is getting stranger. I checked and found that I actually had a VM with Fedora 24, so I checked out latest master and built without problem:

Code: Select all

Apache Maven 3.3.9 (NON-CANONICAL_2016-04-07T23:15:34Z_mockbuild; 2016-04-08T01:15:34+02:00)
Maven home: /usr/share/maven
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-3.b16.fc24.x86_64/jre
Default locale: nb_NO, platform encoding: UTF-8
OS name: "linux", version: "4.8.7-200.fc24.x86_64", arch: "amd64", family: "unix"
@Sami32 I saw that it failed on PMS.get(), the problem is that what happens inside there is a LOT, so we need a proper trace to be any wiser. What PMS.get() does is to instantiate the PMS class itself, which is the "mother class" of UMS. It runs through a lot of initialization stuff, so there's no way to tell what goes wrong from that alone.

User avatar
Nadahar
Developer
Posts: 1179
Joined: Tue Jun 09, 2015 5:57 pm

Re: Build Failure on Linux - EnforcerRuleException

Post by Nadahar » Fri May 12, 2017 7:08 am

I updated my VM and did a new build, also without problems. I see that I have an older core, but I can't imagine that's the reason for the difference.

Code: Select all

Apache Maven 3.3.9 (NON-CANONICAL_2016-04-07T23:15:34Z_mockbuild; 2016-04-08T01:15:34+02:00)
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-1.b12.fc24.x86_64/jre
Default locale: nb_NO, platform encoding: UTF-8
OS name: "linux", version: "4.8.7-200.fc24.x86_64", arch: "amd64", family: "unix"
@J.L.C Maybe you should try to reinstall Java, it's very strange that I have no issue with such a similar build environment:

Code: Select all

sudo dnf reinstall java-1.8.0-openjdk

J.L.C.
Posts: 9
Joined: Mon May 08, 2017 2:51 am

Re: Build Failure on Linux - EnforcerRuleException

Post by J.L.C. » Fri May 12, 2017 2:54 pm

Nadahar wrote: @J.L.C Maybe you should try to reinstall Java, it's very strange that I have no issue with such a similar build environment:

Code: Select all

sudo dnf reinstall java-1.8.0-openjdk
I reinstalled Java, but the build still failed.

Log here:
https://pastebin.com/6YwftMk9

Since both of you can build fine, it must be something with my environment. Is there any other info I can provide that might help debug it?

Thanks for all your efforts!

User avatar
Sami32
Posts: 817
Joined: Mon Apr 11, 2016 5:09 am

Re: Build Failure on Linux - EnforcerRuleException

Post by Sami32 » Sun May 14, 2017 7:09 am

@J.L.C. In your case, a safer workaround, until this issue found a real solution, should be:

Code: Select all

mvn -Dtest=\!UMSUtilsTest.setUp package
Do any of these builds work for you without workaround ?

Code: Select all

git checkout dcbec3f && mvn package
git checkout a3aa8b7 && mvn package
git checkout f2c1099 && mvn package
git checkout 556f4eb && mvn package
git checkout 9372945 && mvn package
If not, do building under Java 7 make any difference ?

User avatar
Nadahar
Developer
Posts: 1179
Joined: Tue Jun 09, 2015 5:57 pm

Re: Build Failure on Linux - EnforcerRuleException

Post by Nadahar » Mon May 15, 2017 2:21 pm

There is something strange with the build environment. Since the error changed when Maven was upgraded to 3.5, I figured that maybe there was a new and yet unknown problem using that version. I installed Maven 3.5 on my VM and tried, but to no avail. It still builds perfectly fine for me:

Code: Select all

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/share/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-1.b12.fc24.x86_64/jre
Default locale: nb_NO, platform encoding: UTF-8
OS name: "linux", version: "4.8.7-200.fc24.x86_64", arch: "amd64", family: "unix"
..
[INFO] Executing tasks

main:
     [copy] Copying 1 file to /repos/UniversalMediaServer/target
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.559 s
[INFO] Finished at: 2017-05-15T04:07:18+02:00
[INFO] Final Memory: 95M/546M
[INFO] ------------------------------------------------------------------------

User avatar
Sami32
Posts: 817
Joined: Mon Apr 11, 2016 5:09 am

Re: Build Failure on Linux - EnforcerRuleException

Post by Sami32 » Tue May 16, 2017 1:54 am

@Nadahar I have an idea why that happen to him, but as you know i prefer wait for his answer first before saying anything. That's said, that should affect only some Linux OS, AFAIU.

I finally get an answer from Travis, and they will add the missing documentation about OpenJDK 8.
An example of Travis build by it's developper, as you already know:
https://github.com/joepvd/travis-experi ... ff8438e901

User avatar
Nadahar
Developer
Posts: 1179
Joined: Tue Jun 09, 2015 5:57 pm

Re: Build Failure on Linux - EnforcerRuleException

Post by Nadahar » Tue May 16, 2017 1:57 am

@Sami32 Whatever your suspicion is, I have a more or less identical VM set up running the same versions of Java and Maven - which doesn't have these problems, so whatever the problem is I don't think it's the Linux version itself.

Post Reply