UniversalMediaServer icon indicating copy to clipboard operation
UniversalMediaServer copied to clipboard

Cannot build 11.5.0

Open Zishan-Rahman opened this issue 3 years ago • 5 comments
trafficstars

Hi! I'm trying to build version 11.5.0 of UMS on my Linux Mint 21 system (by running mvn package -P linux-x86_64), with everything I need installed (JDK, MediaInfo, Git and Maven), but I'm getting the following error(s?):

23:55:14.959 [main] INFO net.pms.network.mediaserver.handlers.SearchRequestHandlerTest - 
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SearchResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<Result>&lt;DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:sec="http://www.sec.co.kr/" xmlns:pv="http://www.pv.com/pvns/"&gt;&lt;/DIDL-Lite&gt;</Result>
<NumberReturned>0</NumberReturned>
<TotalMatches>0</TotalMatches>
<UpdateID>1</UpdateID>
</u:SearchResponse>
</s:Body>
</s:Envelope>

Killed
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.519 s
[INFO] Finished at: 2022-10-03T23:55:15+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project ums: 
[ERROR] 
[ERROR] Please refer to /home/zfr/Programs/UniversalMediaServer/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd '/home/zfr/Programs/UniversalMediaServer' && '/home/zfr/.sdkman/candidates/java/17.0.4.fx-librca/bin/java' '-Dfile.encoding=UTF-8' '-jar' '/home/zfr/Programs/UniversalMediaServer/target/surefire/surefirebooter-20221003235509786_3.jar' '/home/zfr/Programs/UniversalMediaServer/target/surefire' '2022-10-03T23-55-09_422-jvmRun1' 'surefire-20221003235509786_1tmp' 'surefire_0-20221003235509786_2tmp'
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 137
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd '/home/zfr/Programs/UniversalMediaServer' && '/home/zfr/.sdkman/candidates/java/17.0.4.fx-librca/bin/java' '-Dfile.encoding=UTF-8' '-jar' '/home/zfr/Programs/UniversalMediaServer/target/surefire/surefirebooter-20221003235509786_3.jar' '/home/zfr/Programs/UniversalMediaServer/target/surefire' '2022-10-03T23-55-09_422-jvmRun1' 'surefire-20221003235509786_1tmp' 'surefire_0-20221003235509786_2tmp'
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 137
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:714)
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:311)
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:268)
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1334)
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1167)
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:931)
[ERROR] 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] 	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:294)
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960)
[ERROR] 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
[ERROR] 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

What do I do and how do I fix this?

Zishan-Rahman avatar Oct 04 '22 13:10 Zishan-Rahman

I did a search online and it seems like others have had that problem when they didn't have enough memory allocated. Do you have swap memory set up on your machine? Some also say to use a lower number for -xmx https://stackoverflow.com/questions/6773726/command-mvn-package-fails-with-status-137 https://stackoverflow.com/questions/36218635/maven-fails-with-error-process-exited-with-code-137?lq=1

SubJunk avatar Oct 05 '22 01:10 SubJunk

I did a search online and it seems like others have had that problem when they didn't have enough memory allocated. Do you have swap memory set up on your machine?

I have a 2097148kB (~2.1GB) swap partition that was created on the day I installed Mint into my laptop (20.2, to be exact). I have 8GB RAM, at least half of which is in constant use, and around 590GB left in my 1TB SSD. ~~Do I need to increase the size of my swap file or create a new one? If so, where do you suggest I look up on how to do that?~~ I tried increasing the size of the swap file, increasing it to 4GB and then 8GB, and I still get the same error.

Some also say to use a lower number for -xmx

I have not heard of -xmx before so I did some searching and found that it correlated to the maximum heap size, which on my machine is 2053111808 bytes, or ~2.05GB. From this, I assume that the build process (or something related to it) seems to take up the overwhelming majority of my swap partition, which is where I can also assume this memory issue arises.

With that knowledge, I tried running the build process with -Xmx1024m, -Xmx512m, -Xmx256m and even -Xmx128m, running it thusly:

mvn package -P linux-x86_64 -Xmx1024m

Neither of them worked, and Maven throws the following error saying it doesn't recognise "mx1024m", "mx512m" et cetera:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.318 s
[INFO] Finished at: 2022-10-05T11:29:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "mx1024m". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.LifecyclePhaseNotFoundException: Unknown lifecycle phase "mx1024m". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy.
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:248)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:217)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144)
    at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:98)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException

From the top posts on the SO links you sent here, this didn't seem to be an issue, so I'm just wondering if I'm doing something wrong here or if I'm completely missing something.

Zishan-Rahman avatar Oct 05 '22 10:10 Zishan-Rahman

@Zishan-Rahman can you try appending -DskipTests to the mvn command? That might workaround the bug

SubJunk avatar Oct 07 '22 01:10 SubJunk

@Zishan-Rahman can you try appending -DskipTests to the mvn command? That might workaround the bug

@SubJunk I did that and UMS 11.5.0 was built! I tried that with UMS 11.6.0 and that worked as well! Thanks!

But how will the issues with the tests themselves be resolved (if you have any solutions in mind at this moment)? Just asking out of interest as a Computer Science student looking to go into software engineering!

Zishan-Rahman avatar Oct 07 '22 11:10 Zishan-Rahman

It seems likely it is related to your operating system and maybe one of our third-party dependencies interacting with each other. I say that because every pull request on here runs the tests on Windows, macOS, and two versions of Ubuntu, so I am confident that the test suite is stable on those operating systems. Maybe you can look into it further as practice for your future career :) we welcome contributions

SubJunk avatar Oct 07 '22 21:10 SubJunk