Page MenuHomePhabricator

AWB log in fails when reading temporarily-empty InitialiseSettings.php.txt
Closed, ResolvedPublic

Description

When I run AWB, it displays this error message:

I go to Options - Preferences - Site tab - language is en instead of ru. I set "ru", click OK and get this error message again. It is even before login procedure. Error confirmed in both AWB 5.10.1. and 6.0.0.1. AWB was worked on my system several days ago, I don't change anything.

Event Timeline

MBH created this task.Sep 17 2019, 4:36 AM
Restricted Application added subscribers: Base, Aklapper. · View Herald TranscriptSep 17 2019, 4:36 AM
Frood added a subscriber: Frood.Sep 17 2019, 4:50 AM

I pulled up AWB in Visual Studio, and it's throwing an exception at line 255 of SiteInfo.cs:

System.ArgumentOutOfRangeException' in mscorlib.dll ("StartIndex cannot be less than zero.") Exception thrown: 'System.ArgumentOutOfRangeException' in mscorlib.dll ("StartIndex cannot be less than zero.")

The line in question is:

catCollationInfo = Tools.GetHTML(@"https://noc.wikimedia.org/conf/InitialiseSettings.php.txt");

T233069 was recently filed mentioning changes to this file, so I'm guessing that's related.

Dinoguy1000 renamed this task from AWB cannot log in to ruwiki to AWB cannot log in.EditedSep 17 2019, 5:43 AM
Dinoguy1000 added a subscriber: Dinoguy1000.

This affects all wikis, since the error is displayed towards the end of startup, well before any logins are even attempted, as well as appearing whenever a login is attempted. I've renamed the task accordingly.

This has also been mentioned on-wiki.

IMO, AWB shouldn't make use of the configuration file at all. Better solution would be to make a MW API exposing the collation, if it is required.

I

ndex: SiteInfo.cs
===================================================================
@@ -252,7 +252,7 @@
             // web lookup if not in cache
             if (string.IsNullOrEmpty(catCollationInfo))
             {
-                catCollationInfo = Tools.GetHTML(@"https://noc.wikimedia.org/conf/InitialiseSettings.php.txt");
+                catCollationInfo = Tools.GetHTML(@"https://noc.wikimedia.org/conf/VariantSettings.php.txt");
 
                 // remove text before wgCategoryCollation section
                 catCollationInfo = catCollationInfo.Substring(catCollationInfo.IndexOf("wgCategoryCollation", StringComparison.Ordinal));
Aklapper renamed this task from AWB cannot log in to AWB cannot log in as it pulls non-existing https://noc.wikimedia.org/conf/InitialiseSettings.php.txt instead of using MW API.Sep 17 2019, 9:38 AM
Reedy added a subscriber: Reedy.Sep 17 2019, 12:58 PM

I

ndex: SiteInfo.cs
===================================================================
@@ -252,7 +252,7 @@
             // web lookup if not in cache
             if (string.IsNullOrEmpty(catCollationInfo))
             {
-                catCollationInfo = Tools.GetHTML(@"https://noc.wikimedia.org/conf/InitialiseSettings.php.txt");
+                catCollationInfo = Tools.GetHTML(@"https://noc.wikimedia.org/conf/VariantSettings.php.txt");
                 // remove text before wgCategoryCollation section
                 catCollationInfo = catCollationInfo.Substring(catCollationInfo.IndexOf("wgCategoryCollation", StringComparison.Ordinal));

That will work as nothing more than a workaround, until https://gerrit.wikimedia.org/r/#/c/operations/mediawiki-config/+/537220/ is deployed, when the code moves back to InitialiseSettings.php :)

Reedy added a comment.Sep 17 2019, 1:04 PM

IMO, AWB shouldn't make use of the configuration file at all. Better solution would be to make a MW API exposing the collation, if it is required.

Which is great, when the API can/does expose the information. Sometimes, getting it exposed is not an easy task

AWB has been using IS.php to get this information for 2 years before than MW was exposed the information through the API

https://github.com/reedy/AutoWikiBrowser/commit/c61bd09d64b935a8179adbccb60261ef1fffe629
https://github.com/wikimedia/mediawiki/commit/b9b1e863d9eddf15fd8c7f7b7f61ecb781bb6823

Needs migrating over

Reedy added a comment.Sep 17 2019, 2:52 PM

Also, the title is wrong. https://noc.wikimedia.org/conf/InitialiseSettings.php.txt does exist, it just doesn't have the same contents as before

Reedy added a comment.Sep 17 2019, 3:15 PM

Oh. No. I misspoke

AWB does already get this from the API for the current wiki - https://github.com/reedy/AutoWikiBrowser/blob/master/WikiFunctions/SiteInfo.cs#L196

So I honestly don't see any point keeping the code around that tries to read from InitialiseSettings...

https://github.com/reedy/AutoWikiBrowser/blob/29a9069604f3e4bc32e8be50497b0674118d8837/WikiFunctions/Session.cs#L280

For it's usage it's just looking up the wiki name in a filtered list to see if it's UCA

We just need to do the uca check on the value we pulled from the API...

Jdforrester-WMF renamed this task from AWB cannot log in as it pulls non-existing https://noc.wikimedia.org/conf/InitialiseSettings.php.txt instead of using MW API to AWB cannot log in as it tries to screen-scrape temporarily-empty https://noc.wikimedia.org/conf/InitialiseSettings.php.txt instead of using MW API.Sep 17 2019, 3:37 PM
Reedy added a comment.Sep 17 2019, 6:30 PM

SVN rev 12343 fixes this, seen in https://github.com/reedy/AutoWikiBrowser/commit/296bcb09ba1043961962c9b20a969b9d6eb8ed2e

I've released 6.1.0.0 - https://sourceforge.net/projects/autowikibrowser/files/autowikibrowser/AutoWikiBrowser6100/AutoWikiBrowser6100.zip/download

I'm not sure if I need to backport this (and various other changes) to 5.10.x.x too... Are people still using 5.10? or is everyone on 6.0?

Thanks. I'm still using 5.10, I didn't notice there was a version 6.0 (shame on me).

Reedy added a comment.Sep 17 2019, 6:34 PM

Thanks. I'm still using 5.10, I didn't notice there was a version 6.0 (shame on me).

That's not completely your fault... I've not been very.. forceful at pushing that version to people as it bumps the .NET version requirements to needing 4.5.

I don't know how many people that may or may not cause problems for if I did :)

Reedy added a comment.Sep 17 2019, 6:44 PM

That's a completely different error message that isn't/wasn't mentioned here...

I don't know how many people that may or may not cause problems for if I did :)

After testing it: AWB 6.0 works fine for me :).

Reedy added a comment.Sep 17 2019, 7:22 PM

Which looks like it's a different failure from before (if that was a separate error)

It's falling over some WIP code I was writing a year ago for transitioning to using JSON for stuff, rather than wikitext

Jules78120 removed a subscriber: Jules78120.
Reedy renamed this task from AWB cannot log in as it tries to screen-scrape temporarily-empty https://noc.wikimedia.org/conf/InitialiseSettings.php.txt instead of using MW API to AWB cannot log in as it tries to screen-scrape temporarily-empty https://noc.wikimedia.org/conf/InitialiseSettings.php.txt.Sep 17 2019, 9:06 PM
Reedy closed this task as Resolved.
Reedy claimed this task.

I've released 6.1.0.0 -
https://sourceforge.net/projects/autowikibrowser/files/autowikibrowser/AutoWikiBrowser6100/AutoWikiBrowser6100.zip/download

Downloaded the latest version and got the below error while login.


Restarted the application multiple times but got the same error. Applied updates too.
I could change the site from en.wikipedia.org to te.wikipedia.org, populate the list box with pages and save the settings without any errors.
Version statement is here:

MBH added a comment.Sep 18 2019, 2:50 AM

I'm not sure if I need to backport this (and various other changes) to 5.10.x.x too... Are people still using 5.10? or is everyone on 6.0?

@Reedy is 6.0 is official, legitimate version of AWB? The fact is that AWB updater on version 6.0.0.1 "updates" AWB to 5.10.1 version.

With v6.1.0.1, the login issue is resolved and the application is working fine. @Reedy, thanks for for the quick actions. Great help!

SVN rev 12343 fixes this, seen in https://github.com/reedy/AutoWikiBrowser/commit/296bcb09ba1043961962c9b20a969b9d6eb8ed2e
I've released 6.1.0.0 - https://sourceforge.net/projects/autowikibrowser/files/autowikibrowser/AutoWikiBrowser6100/AutoWikiBrowser6100.zip/download
I'm not sure if I need to backport this (and various other changes) to 5.10.x.x too... Are people still using 5.10? or is everyone on 6.0?

Yes please, backport it to 5.10
Some of us would prefer not to have to install the additional bloat of .NET 4.5 that is required by AWB v6. (What extra functionality would I get in v6? The release notes don't tell me anything.)

SVN rev 12343 fixes this, seen in https://github.com/reedy/AutoWikiBrowser/commit/296bcb09ba1043961962c9b20a969b9d6eb8ed2e
I've released 6.1.0.0 - https://sourceforge.net/projects/autowikibrowser/files/autowikibrowser/AutoWikiBrowser6100/AutoWikiBrowser6100.zip/download
I'm not sure if I need to backport this (and various other changes) to 5.10.x.x too... Are people still using 5.10? or is everyone on 6.0?

Yes please, backport it to 5.10
Some of us would prefer not to have to install the additional bloat of .NET 4.5 that is required by AWB v6. (What extra functionality would I get in v6? The release notes don't tell me anything.)

https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/History#Current_6.x_series

The biggest thing is TLS 1.1 and 1.2 support. While this isn't currently required for Wikipedia/Wikimedia Wikis (where Wikia, and other wikis you do), there will become a point where it is required

There was no way to add this support without bumping .NET version, so hence doing so

I imagine the actual "bloat" of installing .NET 4.5 aswell isn't actually that high, so unless you're very space constrained on your machine...

MBH added a comment.Sep 19 2019, 1:15 PM

When you use Windows 8 and newer, it's better if AWB require .NET 4.5 instead of 3.5, because 4.5 comes out of the box, while 3.5 should be installed separately. It's great that new AWB version no longer requires .NET 3.5 installation.

Xaosflux renamed this task from AWB cannot log in as it tries to screen-scrape temporarily-empty https://noc.wikimedia.org/conf/InitialiseSettings.php.txt to AWB log in fails when reading temporarily-empty InitialiseSettings.php.txt.Sep 19 2019, 5:22 PM
Xaosflux updated the task description. (Show Details)
Bdijkstra added a subscriber: Bdijkstra.