Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: verify that the downloaded resource is a valid plugin #1210

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

dhoffend
Copy link
Contributor

I came across the issue that the downloaded resources was in fact some kind of html output. Looks like the download failed somehow (in my case the dynmap plugin (274).

Example:

http://api.spiget.org/v2/resources/274/download --> https://dev.bukkit.org/projects/dynmap/files/3561925

Sure ... the owner of dynmap is using a link that points to a webpage instead of the real download.

So the curl download generates a html output which gets saves to 274.jar ... which then creates errors when the server trys to load the plugin. At least we should verify that the downloaded .jar file is a valid minecraft plugin with plugin.yml in it.

@dhoffend
Copy link
Contributor Author

I reuploaded the branch to match the output of unzip -l

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@itzg itzg merged commit cc88527 into itzg:master Dec 20, 2021
@Peterkal2112
Copy link

Peterkal2112 commented Jan 24, 2022

Hello,
I encounterred that error today:

[init] Running as uid=0 gid=0 with /data as 'drwxrwxrwx 1 0 0 8192 Jan 24 08:51 /data'
[init] Resolved version given into 1.18.1
[init] Resolving type given PAPER
[init] Removing old PaperMC versions ...
[init] Downloading PaperMC 1.18.1 (build 175) ...
[init] Getting plugins via Spiget
[init] Downloading resource 274 ...
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/274.zip or
/tmp/274.zip.zip, and cannot find /tmp/274.zip.ZIP, period.
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/274.zip or
/tmp/274.zip.zip, and cannot find /tmp/274.zip.ZIP, period.
[init] ERROR downloaded resource '274' seems to be not a valid plugin

This message is looping ..

I had to delete 274 from enviroment SPIGET_RESOURCES= and download that plugin manually and upload that to folder but that is just a wacky manual workaround.

@itzg
Copy link
Owner

itzg commented Jan 24, 2022

@Peterkal2112 can you double check that you have re-pulled the image that you are using? I tried docker run -it --rm -e EULA=TRUE -e TYPE=PAPER -e SPIGET_RESOURCES=274 -e SETUP_ONLY=true itzg/minecraft-server and it stopped correctly just after the

[init] ERROR downloaded resource '274' seems to be not a valid plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants