Declarative plugins fail to load. #108
Replies: 2 comments
-
I just investigated a bit further. Something the module is doing when copying over the jar using the "files" option in the modules doesn't appear to be copying the files properly. (FILE DOWNLOADED FROM WEB USING WGET)
┌─( ❄️ yaro@🌐 deimos at 14:46:40 )─[ 10.60.10.1 ]──────────────( /tmp
├─{ zsh took 53ms
└─< 🧙 😸 > nix-shell -p outils --run "sha256 -b craftbook-3.10.11.jar"
fetching path input 'path:/nix/store/a2gnsay8asfn2kqghz12nhw196cnmf8h-source'
SHA256 (craftbook-3.10.11.jar) = vgZ9epujY0lBhpe7LnE6rRSjFVlnHH2vZNB0klpjp0g=
(FILE IN THE NIX STORE)
┌─( ❄️ yaro@🌐 deimos at 14:47:57 )─[ 10.60.10.1 ]──────────────( /tmp
├─{ zsh took 767ms
└─< 🧙 😸 > nix-shell -p outils --run "sha256 -b /nix/store/m9kyja9cqvjhrb2bzqhp6464gvsfg3qv-craftbook-3.10.11.jar"
fetching path input 'path:/nix/store/a2gnsay8asfn2kqghz12nhw196cnmf8h-source'
SHA256 (/nix/store/m9kyja9cqvjhrb2bzqhp6464gvsfg3qv-craftbook-3.10.11.jar) = vgZ9epujY0lBhpe7LnE6rRSjFVlnHH2vZNB0klpjp0g=
(FILE COPIED BY THE MODULE FROM THE NIX STORE)
┌─( ❄️ yaro@🌐 deimos at 14:47:22 )─[ 10.60.10.1 ]──────────────( /tmp
├─{ zsh took 90ms
└─< 🧙 😸 > nix-shell -p outils --run "sha256 -b CraftBook.jar"
fetching path input 'path:/nix/store/a2gnsay8asfn2kqghz12nhw196cnmf8h-source'
SHA256 (CraftBook.jar) = 2j4ov1n33OkM+78tSQrlalnfOGzlCe+jpoenwe9+aI0= |
Beta Was this translation helpful? Give feedback.
-
Finally dug a bit deeper and found something like this: if [[ -L "plugins/CraftBook.jar" ]]; then
unlink "plugins/CraftBook.jar"
elif /nix/store/wk9vn3lcxqya6a5j17v87x18lrkg2ngy-diffutils-3.10/bin/cmp -s "plugins/CraftBook.jar" "/nix/store/m9kyja9cqvjhrb2bzqhp6464gvsfg3qv-craftbook-3.10.11.jar"; then
rm "plugins/CraftBook.jar"
elif [[ -e "plugins/CraftBook.jar" ]]; then
echo "plugins/CraftBook.jar already exists, moving"
mv "plugins/CraftBook.jar" "plugins/CraftBook.jar.bak"
fi
mkdir -p "$(dirname "plugins/CraftBook.jar")"
/nix/store/g7rq3khf0bnm64amflrc4964b7q57dqv-gawk-5.2.2/bin/awk '{
for(varname in ENVIRON)
gsub("@"varname"@", ENVIRON[varname])
print
}' "/nix/store/m9kyja9cqvjhrb2bzqhp6464gvsfg3qv-craftbook-3.10.11.jar" > "plugins/CraftBook.jar" I'm guessing the rationale is to modify a config file to change environment variables within (Among other things.) but this isn't taking any measures to detect if the file is, in fact, plaintext. This AWK command is actually destroying jars as it copies, which is causing paper to reject the jars. I propose this shell script be updated to check what kind of file is meant to be copied over, so that it won't inappropriately use AWK on a mod/plugin file. |
Beta Was this translation helpful? Give feedback.
-
I tried following the suggestions at the end of the readme and had no success so far getting plugins working for paper. The original solution shown on README first puts them in a folder paper doesn't recognize, but when changing to "plugins" from "mods" just gets "read only file system." Likely because it's symlinking directly to something in the nix store.
So I changed it to files with the following configuration (As using the linkFarmFromDrvs with "files" just created an empty file called "plugins.") This did allow the plugins to be copied into place, but now paper fails to load every last one, complaining about a "missing END header." So I tried unzipping a couple. Unzip did complain about a bad format for one of them, but happily extracted another.
Am I doing declarative plugins wrong? Am I not supposed to try and install them declaratively? I hope that's not the case as this is easily the most tedious and annoying part of any Minecraft server administration.
I honestly can't believe that Nix would botch downloading every single Jar properly, so I'm wondering if I did this wrong.
Beta Was this translation helpful? Give feedback.
All reactions