Menu

#111 Bot fail to login

closed-invalid
nobody
None
2016-02-19
2016-02-14
No

All my DotNetWikiBots fail to login. That is what they write:

Logging in...

Unhandled exeption: WikiBotException:

Login failed. Check your username and password.

in Site.LogIn()
in Site.Initialize()
in MyBot.Main()

Three days ago it worked perfectly. Password was not changed.

Discussion

  • Anton Obozhyn

    Anton Obozhyn - 2016-02-14

    All my DotNetWikiBots fail to login. That is what they write:

    Logging in...
    Unhandled exeption: WikiBotException:
    Login failed. Check your username and password.
    in Site.LogIn()
    in Site.Initialize()
    in MyBot.Main()

    Three days ago it worked perfectly. Password was not changed.

     

    Last edit: Anton Obozhyn 2016-02-14
  • CodeDriller

    CodeDriller - 2016-02-14

    What is your DotNetWikiBot version? Did you upgrade to version 3.15?

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-14

    I am using 3.5 now. I did not upgrade, did not know there is a new version. Anyway, I can't find 3.15 version on net. Can you, please, give me a link?

     
  • CodeDriller

    CodeDriller - 2016-02-14
    • status: open --> closed-duplicate
     
  • CodeDriller

    CodeDriller - 2016-02-14

    Here it is: v3.15

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-14

    Обновил. Всё еще не работает. Пишет:

    csc BotScript.cs /debug:full /o- /reference:DotNetWikiBot.dll
    Компилятор Microsoft (R) Visual C# 2008 версии 3.5.30729.8693
    для Microsoft (R) .NET Framework версии 3.5
    (C) Корпорация Майкрософт (Microsoft Corp.). Все права защищены.

    C:\Users\OBO\Desktop\DotNetWikiBot_3.15>BotScript.exe
    DotNetWikiBot 3.15
    Copyright (c) Iaroslav Vassiliev, 2006-2016, GNU General Public License 2.0

    Localized messages not found for language "uk".
    You can help DotNetWikiBot project by translating the messages in
    "DotNetWikiBot.i18n.xml" file and sending it to developers for distribution.

    Logging in...

    Необработанное исключение: System.Xml.XmlException: Отсутствует корневой элемент.
    в System.Xml.XmlTextReaderImpl.Throw(Exception e)
    в System.Xml.XmlTextReaderImpl.ParseDocumentContent()
    в System.Xml.XmlReader.MoveToContent()
    в System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
    в System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
    в DotNetWikiBot.Site.LogIn()
    в DotNetWikiBot.Site.Initialize()
    в DotNetWikiBot.Site..ctor(String address, String userName, String userPass, String userDomain)
    в DotNetWikiBot.Site..ctor(String address, String userName, String userPass)
    в MyBot.Main() в c:\Users\OBO\Desktop\DotNetWikiBot_3.15\BotScript.cs:строка 86
    Для продолжения нажмите любую клавишу . . .

     
  • CodeDriller

    CodeDriller - 2016-02-14

    What site are you working with? What is its MediaWiki version?

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-14

    сommons.wikimedia.org - 1.27.0-wmf.13 (d446f54)
    uk.wikipedia.org - 1.27.0-wmf.13 (d446f54)

     
  • CodeDriller

    CodeDriller - 2016-02-14

    I just logged to uk.wikipedia.org successfully using v3.15.
    Please check your build environment once again.

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-15

    I have reinstalled Microsoft.NET Framework. The same error occured. I even installed it on the other computer a launched the bot. The result was exactly the same.

     
  • CodeDriller

    CodeDriller - 2016-02-17

    I still can't reproduce this.

    If you use Visual Studio could you please set a breakpoint and copy that XML that doesn't have root element.

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-17

    I never used Visual Studio. I am trying to compile it by Compile & Run.bat which uses csc of Microsoft.NET framework v3.5

     
  • CodeDriller

    CodeDriller - 2016-02-18

    Ok. Please, uncomment the following line in Compile & Run.bat file:

    csc /t:library /debug:full /o- DotNetWikiBot.cs
    

    Then launch this file again and copy the error information here. New error info will contain line numbers so the error source could be found.

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-18

    Done exactly as you said. It wrote this:

    C:\Users\OBO\Desktop\DotNetWikiBot_3.15>path=C:\Windows\Microsoft.NET\Framework\v3.5\

    C:\Users\OBO\Desktop\DotNetWikiBot_3.15>csc /t:library /debug:full /o- DotNetWikiBot.cs
    Компилятор Microsoft (R) Visual C# 2008 версии 3.5.30729.8693
    для Microsoft (R) .NET Framework версии 3.5
    (C) Корпорация Майкрософт (Microsoft Corp.). Все права защищены.

    C:\Users\OBO\Desktop\DotNetWikiBot_3.15>csc BotScript.cs /debug:full /o- /reference:DotNetWikiBot.dll
    Компилятор Microsoft (R) Visual C# 2008 версии 3.5.30729.8693
    для Microsoft (R) .NET Framework версии 3.5
    (C) Корпорация Майкрософт (Microsoft Corp.). Все права защищены.

    C:\Users\OBO\Desktop\DotNetWikiBot_3.15>BotScript.exe
    DotNetWikiBot 3.15
    Copyright (c) Iaroslav Vassiliev, 2006-2016, GNU General Public License 2.0

    Localized messages not found for language "uk".
    You can help DotNetWikiBot project by translating the messages in
    "DotNetWikiBot.i18n.xml" file and sending it to developers for distribution.

    Logging in...

    Необработанное исключение: System.Xml.XmlException: Отсутствует корневой элемент.
    в System.Xml.XmlTextReaderImpl.Throw(Exception e)
    в System.Xml.XmlTextReaderImpl.ParseDocumentContent()
    в System.Xml.XmlReader.MoveToContent()
    в System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
    в System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
    в DotNetWikiBot.Site.LogIn() в c:\Users\OBO\Desktop\DotNetWikiBot_3.15\DotNetWikiBot.cs:строка 585
    в DotNetWikiBot.Site.Initialize() в c:\Users\OBO\Desktop\DotNetWikiBot_3.15\DotNetWikiBot.cs:строка 302
    в DotNetWikiBot.Site..ctor(String address, String userName, String userPass, String userDomain) в c:\Users\OBO\Desktop\DotNetWikiBot_3.15\DotNetWikiBot.cs:строка 204
    в DotNetWikiBot.Site..ctor(String address, String userName, String userPass) в c:\Users\OBO\Desktop\DotNetWikiBot_3.15\DotNetWikiBot.cs:строка 185
    в MyBot.Main() в c:\Users\OBO\Desktop\DotNetWikiBot_3.15\BotScript.cs:строка 86
    Для продолжения нажмите любую клавишу . . .

     
  • CodeDriller

    CodeDriller - 2016-02-19

    Ok, now one more thing. Please, open the DotNetWikiBot.cs file and insert the following line

    File.WriteAllText("C:\debugdata.txt", tokenXmlSrc+"|"+address+"|"+apiPath+"|"+userDomain, Encoding.UTF8);
    

    before the following line:

    XElement tokenXml = XElement.Parse(tokenXmlSrc);
    

    in LogIn() method. That's line #585.

    Then launch Compile & Run.bat file, you will see new file "C:\debugdata.txt" on your disk. Please send me or copy its content here.

     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-19

    |http://commons.wikimedia.org|http://commons.wikimedia.org/w/api.php|

     
  • CodeDriller

    CodeDriller - 2016-02-19
    • status: closed-duplicate --> closed-invalid
     
  • CodeDriller

    CodeDriller - 2016-02-19

    Commons site is not accessible through HTTP, only through HTTPS. You must write:

    new Site("https://commons.wikimedia.org" ...
    
     
  • Anton Obozhyn

    Anton Obozhyn - 2016-02-19

    I corrected all http in my programm to https, and it is working. Thank you a lot!

     
  • CodeDriller

    CodeDriller - 2016-02-19

    No problem!

     

Log in to post a comment.