Build Errors with Spigot Build Functionality
Closed this issue · 6 comments
Running MineOS installed on Ubuntu 16.02 LTS
When using the WebUI to build the spigot Jar's, the build fails about 2/3rds of the way through with the errors pasted below.
If I log into the console and run buildtools jar manually from the same directory, on the same user account, the build runs just fine.
[INFO] Dependency-reduced POM written at: /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/dependency-reduced-pom.xml [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ craftbukkit --- [INFO] Installing /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/target/craftbukkit-1.10.2-R0.1-SNAPSHOT.jar to /root/.m2/repository/org/bukkit/craftbukkit/1.10.2-R0.1-SNAPSHOT/craftbukkit-1.10.2-R0.1-SNAPSHOT.jar [INFO] Installing /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/dependency-reduced-pom.xml to /root/.m2/repository/org/bukkit/craftbukkit/1.10.2-R0.1-SNAPSHOT/craftbukkit-1.10.2-R0.1-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 45.976 s [INFO] Finished at: 2016-11-22T01:00:16-08:00 [INFO] Final Memory: 24M/449M [INFO] ------------------------------------------------------------------------ Rebuilding Forked projects.... applyPatches.sh: 7: applyPatches.sh: function: not found
fatal: ambiguous argument '': unknown revision or path not in the working tree. Use '--' to separate paths
from revisions, like this: 'git [...] -- [...]' Resetting to ... error: Could not remove config section 'remote.upstream' fatal: ambiguous argument 'upstream/upstream': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' Applying patches to ... fatal: Resolve operation not in progress, we are not resuming. fatal: could not open '/var/games/minecraft/profiles/spigot_1.10.2/Spigot/-Patches/*.patch' for reading: No such file or directory Something did not apply cleanly to . Please review above details and finish the apply then save the changes with rebuildPatches.sh Error compiling Spigot. Please check the wiki for FAQs. If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support. java.lang.RuntimeException: Error running command, return status !=0: [/bin/sh, applyPatches.sh] at org.spigotmc.builder.Builder.runProcess(Builder.java:552) at org.spigotmc.builder.Builder.main(Builder.java:434)
Couldn't reproduce this on my install (albeit it was a Debian 7 install, rather than Ubuntu 10).
Can you provide any details on the steps you took to do this?
- I see you were logged in as root. Can you delete your build attempt and try building it from a non-root user?
- What was the exact command you used when you built it manually? (I'll check it against the command I have MineOS execute in the background)--and when possible, best practices say you shouldn't do that as root either.
- Were you building 1.10.2? This is also the build I tried making and it ran with no issues.
- What commit are you on?
EDIT: Updated post, as a full system reboot fixed some things.
-
Sorry, to clarify: I installed MineOS via the wiki instructions. I am running Ubuntu 16.02 LTS, so it sets it up with systemd running by default as root (for the daemon processes). I am logged into the web interface via a non-root account - the "root" error is from the web interface.
-
When I build locally, I am using a non-root account to build, and it works fine. The command I am using is the one suggested in the spigot wiki (https://www.spigotmc.org/wiki/buildtools/)
-
In this instance I tried both 1.10.2, and 1.11, as well as older versions. All have the same results.
-
I will need to check when I have ssh access, but I have a cron job that runs every night to run the mineos web interface update scripts, so in theory I should always be on the latest. EDIT According to interface, running commit: hexparrot/mineos-node@d9a604b
Is there any kind of verbose logging I can do to try and track the errors?
As a side note: When I run the build via the interface and it fails, it fails near the last couple of steps - on the server in the created profile folder, I can see it manages to clone all the source files without issue, pulls down maven, etc etc. It gets as far as the craftbukkit.jar file but fails when creating the spigot jar (I think). If I leave everything intact, I can go and manually run the build, and everything succeeds, and it creates the files in that folder. After that point, I can use the interface to "copy the files to server" and so forth, or even delete them.
All that said, there does seem to be some wacky permissions issues, because now archiving is broken too - If I delete my archive and backup folders, I can perform an archive or backup fine once - but anytime I try and archive or backup for the same server again, it fails without giving me an actual error message. I have tried the same with the spigot folders (removing them entirely), but that doesnt seem to make a difference. It follows the same path and fails at the same point.
I guess I am not sure at this point why anything would be broken permissions wise, when I haven't really done anything to the system itself, other than manually install spigot. I can backup the servers to another location and try and do a fresh and clean install to see if that helps, but I am not sure how to make 100% sure all remnants are gone - which directories do I need to rm -rf after uninstalling the packages to be sure its all gone?
EDIT: Here is the log after a fresh reboot, delete of the profile folder, and attempt to rebuild
This is from the interface:
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/target/craftbukkit-1.10.2-R0.1-SNAPSHOT.jar with /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/target/craftbukkit-1.10.2-R0.1-SNAPSHOT-shaded.jar [INFO] Dependency-reduced POM written at: /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/dependency-reduced-pom.xml
[INFO] Dependency-reduced POM written at: /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/dependency-reduced-pom.xml
[INFO] Dependency-reduced POM written at: /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/dependency-reduced-pom.xml
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ craftbukkit ---
[INFO] Installing /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/target/craftbukkit-1.10.2-R0.1-SNAPSHOT.jar to /root/.m2/repository/org/bukkit/craftbukkit/1.10.2-R0.1-SNAPSHOT/craftbukkit-1.10.2-R0.1-SNAPSHOT.jar
[INFO] Installing /var/games/minecraft/profiles/spigot_1.10.2/CraftBukkit/dependency-reduced-pom.xml to /root/.m2/repository/org/bukkit/craftbukkit/1.10.2-R0.1-SNAPSHOT/craftbukkit-1.10.2-R0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 46.435 s
[INFO] Finished at: 2016-12-02T13:10:13-08:00
[INFO] Final Memory: 22M/441M [INFO] ------------------------------------------------------------------------
Rebuilding Forked projects....
applyPatches.sh: 7: applyPatches.sh: function: not found
fatal: ambiguous argument '': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'
Resetting to ...
error: Could not remove config section 'remote.upstream'
fatal: ambiguous argument 'upstream/upstream': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'
Applying patches to ...
fatal: Resolve operation not in progress, we are not resuming.
fatal: could not open '/var/games/minecraft/profiles/spigot_1.10.2/Spigot/-Patches/*.patch' for reading: No such file or directory
Something did not apply cleanly to . Please review above details and finish the apply then save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [/bin/sh, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess(Builder.java:552) at org.spigotmc.builder.Builder.main(Builder.java:434)
Here is the FULL build log:
Same issue here, with 1.11.2
This was identified and a fix was found here: hexparrot/mineos-node#227
Looks like it's because you're using systemd and the init script needs an additional line to indicate that bash
must be used, rather than the user's default shell (whatever it may be set to).
Environment="SHELL=/bin/bash"
This line needs to be added to your MineOS systemd init file.
Thanks everyone for figuring this out.
It should be noted, even if your default shell IS bash, this is still an issue. I found the following:
GNU Bash is the shell used by default in terminals on Ubuntu. However when scripts are executed on system boot then dash is used, as it is dash that is /bin/sh
http://askubuntu.com/questions/87853/what-is-default-shell-for-terminal
I will validate this weekend!
Can confirm, editing the systemd Unit file fixed this issue.
For anyone else with an existing non-Turnkey install using systemd, steps I took to fix:
sudo systemctl stop mineos.service
sudo systemctl edit --full mineos.service
Added the following to the bottom of the [Service] Directive (no quote marks):
Environment=SHELL=/bin/bash
Save and Exit
sudo systemctl daemon-reload
sudo systemctl start mineos.service