yarl / pattypan

Upload files to Wikimedia Commons. The Spreadsheet Way.
https://commons.wikimedia.org/wiki/Commons:Pattypan
MIT License
56 stars 37 forks source link

"Login failed" error #138

Closed albertoleoncio closed 2 years ago

albertoleoncio commented 3 years ago

When I try to login, it doesn't work. Maybe is related to #115.

Log:

Sep 30, 2021 2:23:12 PM pattypan.Main main
INFO: Wiki set as: commons.wikimedia.org
Protocol set as: https://
Script path set as: /w
Sep 30, 2021 2:23:12 PM pattypan.Main main
INFO: Operating System: Windows 10
Pattypan Version: 20.04
Sep 30, 2021 2:23:55 PM Wiki getToken
INFO: Fetching URL https://commons.wikimedia.org/w/api.php?format=xml&maxlag=5&action=query&meta=tokens&type=login
Sep 30, 2021 2:24:06 PM Wiki getToken
INFO: Fetching URL https://commons.wikimedia.org/w/api.php?format=xml&maxlag=5&action=query&meta=tokens&type=login
Sep 30, 2021 2:29:17 PM Wiki getToken
INFO: Fetching URL https://commons.wikimedia.org/w/api.php?format=xml&maxlag=5&action=query&meta=tokens&type=login
Sep 30, 2021 2:29:27 PM Wiki getToken
INFO: Fetching URL https://commons.wikimedia.org/w/api.php?format=xml&maxlag=5&action=query&meta=tokens&type=login
geagea1 commented 3 years ago

Any progress?

Aktron commented 3 years ago

I've been watching this page couple of days with a hope of any progress here too :-)

Abbe98 commented 3 years ago

Some people have reported that this has solved itself. If this is not the case feel free to share your Pattypan logs, nothing has changed on Pattypan's side, and "it works on my machine". 😕

Additionally, you can try using a bot password to sign in instead of your regular one.

Battleofalma commented 3 years ago

Same problem, I will try using a different account for now.

geagea1 commented 3 years ago

I have no other account. How I can share my log?

Abbe98 commented 3 years ago

One can generate bot passwords at https://commons.wikimedia.org/wiki/Special:BotPasswords.

In the most recent version of Pattypan, one should be able to see a link to one's log at the start screen.

Battleofalma commented 3 years ago

One can generate bot passwords at https://commons.wikimedia.org/wiki/Special:BotPasswords.

In the most recent version of Pattypan, one should be able to see a link to one's log at the start screen.

Thanks, I generated a bot password and have tried to use that but still face the same problem.

Abbe98 commented 3 years ago

I have now been able to reproduce this error on a Windows computer. There is no indication of what could cause this in the logs.

Two ideas I will be investigating in the coming days:

Two things that should be done/tested anyway and might contribute to a solution:

belett commented 3 years ago

Not sure if it's related but I couldn't login either today.

Here is the error log I had:

sept. 28, 2021 10:33:00 AM pattypan.Main main
INFOS: Wiki set as: http://commons.wikimedia.org
Protocol set as: https://
Script path set as: /w
sept. 28, 2021 10:33:00 AM pattypan.Main main
INFOS: Operating System: Windows 10
Pattypan Version: 20.04
sept. 28, 2021 10:33:00 AM pattypan.panes.StartPane checkVersion
GRAVE: null
http://javax.net.ssl.SSLHandshakeException: http://sun.security.validator.ValidatorException: PKIX path building failed: http://sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at http://sun.security.ssl.Alerts.getSSLException(Unknown Source)
at http://sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at http://sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at http://sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at http://sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at http://sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at http://sun.security.ssl.Handshaker.processLoop(Unknown Source)
at http://sun.security.ssl.Handshaker.process_record(Unknown Source)
at http://sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at http://sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at http://sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at http://sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at http://sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at http://sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at http://sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at http://sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at http://sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at http://java.net.URL.openStream(Unknown Source)
at pattypan.Util.readUrl(http://Util.java:261)
at pattypan.panes.StartPane.getVersions(http://StartPane.java:159)
at pattypan.panes.StartPane.checkVersion(http://StartPane.java:137)
at pattypan.panes.StartPane.<init>(http://StartPane.java:64)
at pattypan.Main.start(http://Main.java:40)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(http://LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(http://PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(http://PlatformImpl.java:295)
at http://java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(http://PlatformImpl.java:294)
at http://com.sun.glass.ui.InvokeLaterDispatcher$Future.run(https://t.co/559aStqlBy)
at http://com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at http://com.sun.glass.ui.win.WinApplication.lambda$null$147(https://t.co/7ksYaIPQaX)
at http://java.lang.Thread.run(Unknown Source)
Caused by: http://sun.security.validator.ValidatorException: PKIX path building failed: http://sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at http://sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at http://sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at http://sun.security.validator.Validator.validate(Unknown Source)
at http://sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at http://sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at http://sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 28 more
Caused by: http://sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at http://sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at http://sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at http://java.security.cert.CertPathBuilder.build(Unknown Source)
... 34 more

It may come from the network of the organisation where I work. And this is the error I've got last week, after closing and restarting Pattypan, it worked but today it didn't worked (with the same error) even after restart.

albertoleoncio commented 3 years ago
  • Have there been changes on the Wikimedia side?

Probably not. There is a movement to deprecate old methods of requesting tokens on MediaWiki, but Pattypan already uses the current method to make these requests.

Aktron commented 3 years ago

Hi, since it would be a bit more useful to provide you guys with more data, here is from me:

OS: Ubuntu 20.04.

java version "1.8.0_301" Java(TM) SE Runtime Environment (build 1.8.0_301-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)

Log:

aktron@aktron-ntb:~/Stažené$ java -jar p20.jar Říj 06, 2021 11:45:42 ODP. pattypan.Main main INFO: Wiki set as: commons.wikimedia.org Protocol set as: https:// Script path set as: /w Říj 06, 2021 11:45:42 ODP. pattypan.Main main INFO: Operating System: Linux Pattypan Version: 20.04 Říj 06, 2021 11:45:56 ODP. Wiki getToken INFO: Fetching URL https://commons.wikimedia.org/w/api.php?format=xml&maxlag=5&action=query&meta=tokens&type=login Říj 06, 2021 11:46:07 ODP. Wiki getToken INFO: Fetching URL https://commons.wikimedia.org/w/api.php?format=xml&maxlag=5&action=query&meta=tokens&type=login

higa4 commented 3 years ago

My last upload using pattypan was on 28th/Sep and I encountered the same problem probably on 1st/Oct. Isn't something expired on 30th/Sep?

Abbe98 commented 3 years ago

I have been able to track down a solution(#139) but not the exact cause. It seems to me like something changed on the Wikimedia side of things.

It will still take me an evening or two to get a release out as my Pattypan environment isn't made for Java 8 which releases are currently based on.

Abbe98 commented 3 years ago

Another update. The solution doesn't support Java 8 which is currently used to build Pattypan.

Two potential ways forward:

Aktron commented 3 years ago

Another update. The solution doesn't support Java 8 which is currently used to build Pattypan.

Two potential ways forward:

  • backport wiki.java with Java 8 support
  • figure out how to bundle openjfx with Pattypan and drop support for versions < Java 11

Is there any way how can I (as a non-programmer) help? I tried to compile the updated code but I failed (clearly well yes, but at least I tried ;-

Aktron commented 3 years ago

One question though: Given the similarity of Pattypan to other two uploaders (Vicuna and Commonist) and given the fact that their users reported difficulties with uploading (while logging in works just fine afaik) – shouldn't we be also affected by this? I am trying to foresee a new issue here (https://github.com/ritschwumm/commonist/issues/26)

hartman commented 3 years ago

Here is the error log I had:

http://javax.net.ssl.SSLHandshakeException: http://sun.security.validator.ValidatorException: PKIX path building failed: http://sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at http://sun.security.ssl.Alerts.getSSLException(Unknown Source)
at http://sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at http://sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at http://sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at http://sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)

This is almost certainly the Letsencrypt issue indicating outdated Certificate Authority files being used by the Java environment of the person running the code (whom should probably just update their Java installation or possibly even their OS, as sometimes JAVA uses the CAs of the Operating System)

I'm not saying there might not also be a token issue, but PKIX path building failed means "cannot build and validate the certificate chain", which is exactly what you would expect in case of the Lets Encrypt problem.

Abbe98 commented 3 years ago

There appear to be two behaviors reported here, one that results in an SSL error in the log and one which is completely silent. If it is caused by the Letsencrypt issue one should be able to resolve it by updating Java 8 to 8u141 or later. I however have similar issues with Java 11+.

I'm working on porting Pattypan to Java 11+ to resolve this but it includes several migrations(wiki-java, openjfx) and there are some major changes needed to deal with distubrations as Java 11 no longer supports JavaFX which Pattypan is built upon.

Hansmuller2 commented 3 years ago

My Windows 10 Pattypan fails on login and simply logs this since two weeks:

Oct 15, 2021 6:39:22 AM pattypan.Main main
INFO: Wiki set as: commons.wikimedia.org
Protocol set as: https://
Script path set as: /w
Oct 15, 2021 6:39:22 AM pattypan.Main main
INFO: Operating System: Windows 10
Pattypan Version: 20.04

(Alternative to Pattypan is the cumbersome GlamWikiToolset? University etc. system managers resented it.) Thanks !

Abbe98 commented 3 years ago

I have published an experimental relsease migrating Pattypan to Java 11+, OpenJFX, and mainstream Wiki.java.

This release is currently a little harder to run as it requires a separate installation of OpenJFX and can only be executed from the command line. The aim is that this shouldn't be necessary but I wanted to have something for those of you who depend on Pattypan as soon as possible.

The work is happening in #142 and the next steps are:

  1. Figure out how to bundle OpenJFX with Pattypan
  2. Test on various platforms
  3. Release
mrjohnc commented 3 years ago

Also experiencing the same error on Windows, Mac and Ubuntu. Unfortunately I can't work out how to install OpenJFX to try the new version.

I would really appreciate this being fixed as I'm waiting on it to upload a 10,000+ file image donation from a national museum which has a time limit.

Thanks

mrjohnc commented 3 years ago

@Abbe98 please could you add the commands you need to run in Ubuntu to install the experimental release to the page linked above? I'd love to test it and have a big upload waiting to do but I don't understand how to run it without some very clear step by step instructions.

Thanks

Abbe98 commented 3 years ago

@mrjohnc assuming a non-modified and somewhat recent base system:

sudo apt install openjfx
java --module-path "/usr/share/openjfx/lib/" --add-modules javafx.web -jar pattypan.jar

Note that while logging in appears to work in the experimental build uploads seems not to(#144 #143). However, because I only got time to work on this during some weekends I appreciate anyone who tries it. Knowing as many details as possible saves me a lot of time and allows me to focus on the root issues.

mrjohnc commented 2 years ago

@Abbe98 Thanks, what's the equivalent to install it of:

git clone https://github.com/yarl/pattypan.git cd pattypan ant package-for-store

Abbe98 commented 2 years ago

@mrjohnc in the time of writing:

git clone --branch java-11 https://github.com/Kartkod/pattypan.git
cd pattypan
ant compile && ant jar
mrjohnc commented 2 years ago

@Abbe98 thanks very much. I had to work out how to install ant and git, unfortunately the ant compile step says it failed, I'll just wait for the next stable release, this is way above my technical ability :)

Thanks

mrjohnc commented 2 years ago

@Abbe98 I tried using Ubuntu on Windows 10 after trying a fresh Ubuntu install on an old laptop and I get the same error message, it says comiling failed when I do ant compile && ant jar, attached it the error message, it failed at the same point on both laptops so maybe it is the same error?

error.txt

Abbe98 commented 2 years ago

There is now a second experimental release available aimed at resolving the upload issues reported in #144 and #133. Thanks @Aktron and @Emilius123 for testing the last experimental release!

https://github.com/Kartkod/pattypan/releases/tag/v20.10-experimental-2

My aim is to get a stable release out by next weekend but I can't make promises. I have also been in discussions with various Wikimedia actors regarding how this type of disruption caused by upstream changes could be avoided in the future.

geagea1 commented 2 years ago

no solution?

Aktron commented 2 years ago

no solution?

This fixes the issue https://github.com/Kartkod/pattypan/releases/tag/v20.10-experimental-2 I've uploaded couple of hundreds of images since Friday with this one ;-)

geagea1 commented 2 years ago

I was unsuccessful installing Java 17 and also OpenJFX.

geagea1 commented 2 years ago

I need simple guide to install java 11+

Abbe98 commented 2 years ago

This issue is also discussed in T293543, although WMF has decided to close it.

reedy commented 2 years ago

This issue is also discussed in T293543, although WMF has decided to close it.

Noting the closer does not work for the WMF.

Abbe98 commented 2 years ago

@reedy my bad, sorry. I miss interpreted the "we".

VinayarajVR commented 2 years ago

Any progress?

mrjohnc commented 2 years ago

@yarl do you know how much work this is to fix? Is it an hour/day/week/year for a developer? There are a lot of uploads from partner orgs which are stalled because we rely on this great tool

Aktron commented 2 years ago

Hey! There is already an update to fix the problem https://github.com/Kartkod/pattypan/releases/tag/v20.10-experimental-2 It works, however only in linux and it is still buggy. I'd suggest contacting @Abbe98 who made a great work fixing the tool and thus releasing some of the blocked uploads.

mrjohnc commented 2 years ago

This release doesn't work for me unfortunately. I understand that Abbe won't be working on this. Is there anyone else who might be able to work on it? I may possibly be able to find some funding to get this fixed if someone knows how to do it

albertoleoncio commented 2 years ago

This release doesn't work for me unfortunately. I understand that Abbe won't be working on this. Is there anyone else who might be able to work on it? I may possibly be able to find some funding to get this fixed if someone knows how to do it

The current problem is @Abbe98 is the only one who is actively working on it and is a volunteer... Anyway, the code is open-source. It was never prohibited to fork the tool and fix/refit/improve it or even create a new tool from scratch, as the MediaWiki API is also open. If money is not an issue, it might be possible to hire someone or even a team that is proficient in Java programming to work on it.

mrjohnc commented 2 years ago

Oh it wouldn't be 'team' money, more like a grant, a couple of questions:

What skills would they need to work on it? How much time would it be to fix it? Who might have enough knowledge of the tool and Wikimedia to be able to do the work

higa4 commented 2 years ago

Or it may be easier if someone can share the detail steps of how to run current one that could be understood for non-tech persons. I also have not succeeded running on my Windows. Is there anyone who have succeeded?

mrjohnc commented 2 years ago

Oh yes having more detailed steps to run it would be super helpful

geagea1 commented 2 years ago

I tried to operate Pattypan from computer in National Library of Israel. I get "GO AWAY" meassge, which is different from my home computer. I asked another user to operate Pattypan in Linux and it was unsuccessful. He tried also Ubuntu but failed.

Battleofalma commented 2 years ago

I tried to operate Pattypan from computer in National Library of Israel. I get "GO AWAY" meassge, which is different from my home computer. I asked another user to operate Pattypan in Linux and it was unsuccessful. He tried also Ubuntu but failed.

GOAWAY issue is being discussed here https://github.com/yarl/pattypan/issues/144 AFAIK

geagea1 commented 2 years ago

Even though it's look like different issue, the GO AWAY issue and upload stuck caused from the same problem. I tried nicer file names 1001.jpg, 1002.jpg ... etc but was unsuccessful. It's look like there is some limitation on the amount of files that can be uploaded. Kind of protection.

andihofm commented 2 years ago

Hey! There is already an update to fix the problem https://github.com/Kartkod/pattypan/releases/tag/v20.10-experimental-2 It works, however only in linux and it is still buggy. I'd suggest contacting @Abbe98 who made a great work fixing the tool and thus releasing some of the blocked uploads.

Did someone test this experimental version for now? Did it work for someone? Whit wich Linux should i work? Would it maybe work better with 2 factor login? I will test it on school if it maybe works. Just have 14 Pictures to upload. (The University, were i work, is waiting for a fix or solution for windows too)

Aktron commented 2 years ago

Hey! There is already an update to fix the problem https://github.com/Kartkod/pattypan/releases/tag/v20.10-experimental-2 It works, however only in linux and it is still buggy. I'd suggest contacting @Abbe98 who made a great work fixing the tool and thus releasing some of the blocked uploads.

Did someone test this experimental version for now? Did it work for someone? Whit wich Linux should i work? Would it maybe work better with 2 factor login? I will test it on school if it maybe works. Just have 14 Pictures to upload. (The University, were i work, is waiting for a fix or solution for windows too)

Yes, I did and yes it works for me (Ubuntu 21.04, Chrome 96.0.4664.45). I heard however that many still struggle with this. As about smaller uploads there is a fork of Vicuna which works in Windows: https://commons.wikimedia.org/wiki/Commons_talk:Vicu%C3%B1aUploader#New_version_ready_to_use but it requests of course a different workflow :-(

VinayarajVR commented 2 years ago

I am raising this issue at Community Wishlist Survey 2022 of Wikimedia here. Please have your say there too. https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2022/Multimedia_and_Commons/Mass_uploader

VinayarajVR commented 2 years ago

A comment there:

The root cause of this is that a MediaWiki change broke my bot framework, which all three of these tools use a legacy version of. This was fixed three months ago but cannot be easily backported - I rewrote that part of the code to use the new HTTP client in Java 11 some time ago. The solution is to port all three tools to Java 11 (and 17) so that they can use the latest version. MER-C 20:37, 13 January 2022 (UTC)