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

Upload from file fails on Java 17 #186

Closed
MER-C opened this issue Jan 22, 2022 · 0 comments
Closed

Upload from file fails on Java 17 #186

MER-C opened this issue Jan 22, 2022 · 0 comments

Comments

@MER-C
Copy link
Owner

MER-C commented Jan 22, 2022

Uploads are broken on Java 17 but work on Java 11.

Non-chunked upload fails with no token.

jshell> test.upload(new File("webb_artists_conception.jpg"), "File:Test1234.jpg", "From https://www.nasa.gov/press-release/nasa-to-discuss-webb-s-arrival-at-final-destination-next-steps", "blah")
Jan 22, 2022 8:17:01 PM Wiki getPageInfo
INFO: Fetching URL https://test.wikipedia.org/w/api.php?&maxlag=5&prop=info&inprop=protection%7Cdisplaytitle%7Cwatchers&format=xml&action=query
Jan 22, 2022 8:17:02 PM Wiki getPageInfo
INFO: [test.wikipedia.org] Successfully retrieved page info for 1 pages.
Jan 22, 2022 8:17:02 PM Wiki getToken
INFO: Fetching URL https://test.wikipedia.org/w/api.php?&maxlag=5&meta=tokens&format=xml&action=query&type=csrf
Jan 22, 2022 8:17:02 PM Wiki upload
INFO: Fetching URL https://test.wikipedia.org/w/api.php?&maxlag=5&format=xml&action=upload
|  Exception java.lang.UnknownError: MW API error. Server response was: <?xml version="1.0"?><api servedby="mw1341"><error code="missingparam" info="The &quot;token&quot; parameter must be set." xml:space="preserve">See https://test.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &amp;lt;https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&amp;gt; for notice of API deprecations and breaking changes.</error></api>
|        at Wiki.detectUncheckedErrors (Wiki.java:8380)
|        at Wiki.checkErrorsAndUpdateStatus (Wiki.java:8456)
|        at Wiki.upload (Wiki.java:4390)
|        at (#6:1)

Chunked upload hangs.

jshell> test.upload(new File("Richard-Wagner-Strasse_2_in_Bayreuth_(2).jpg"), "File:Test1235.jpg", "From https://commons.wikimedia.org/wiki/File:Richard-Wagner-Strasse_2_in_Bayreuth_(2).jpg", "blah")
Jan 22, 2022 8:15:05 PM Wiki getPageInfo
INFO: Fetching URL https://test.wikipedia.org/w/api.php?&maxlag=5&prop=info&inprop=protection%7Cdisplaytitle%7Cwatchers&format=xml&action=query
Jan 22, 2022 8:15:05 PM Wiki getPageInfo
INFO: [test.wikipedia.org] Successfully retrieved page info for 1 pages.
Jan 22, 2022 8:15:05 PM Wiki getToken
INFO: Fetching URL https://test.wikipedia.org/w/api.php?&maxlag=5&meta=tokens&format=xml&action=query&type=csrf
Jan 22, 2022 8:15:06 PM Wiki upload
INFO: Fetching URL https://test.wikipedia.org/w/api.php?&maxlag=5&format=xml&action=upload
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

No branches or pull requests

1 participant