There's a typo up above. Instead of commons.wikipedia.org, it should be commons.wikimedia.org . This is not the problem since it's still not working on either http://en.wikipedia.org or http://commons.wikimedia.org
Also, to be clear, the exception is caught during the page.UploadImage call.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Even though an exception is being thrown, the file is still being uploaded. The exact location where it's being thrown is in the GetMediaWikiMessagesEx(bool forceLoad) method and the exact line is
I can confirm that filePathName contains the file with the html markup.
I've been doing my testing on vgsales.wikia.com, but I'm also getting the exception on Wikimedia Commons.
I'm using ASP.NET 4.0, C#
StackTrace
2010-06-15 10:43:05,895 [20] ERROR [(null)] - The remote server returned an error: (503) Server Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenAndPush(Uri uri)
at System.Xml.XmlTextReaderImpl.PushExternalEntityOrSubset(String publicId, String systemId, String baseUriStr, Uri& baseUri, String entityName)
at System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubset(String systemId, String publicId)
at System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.PushExternalSubset(String systemId, String publicId)
at System.Xml.DtdParser.ParseExternalSubset()
at System.Xml.DtdParser.ParseInDocumentDtd(Boolean saveInternalSubset)
at System.Xml.DtdParser.Parse(Boolean saveInternalSubset)
at System.Xml.DtdParser.System.Xml.IDtdParser.ParseInternalDtd(IDtdParserAdapter adapter, Boolean saveInternalSubset)
at System.Xml.XmlTextReaderImpl.ParseDtd()
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at DotNetWikiBot.Site.GetMediaWikiMessagesEx(Boolean forceLoad)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I deployed my app on a shared hosting webserver and I'm not receiving this error.
Access to the path 'Cache' is denied.
Access to the path 'Cache' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj)
at System.IO.Directory.CreateDirectory(String path)
at DotNetWikiBot.Site.GetPaths() in C:\Users\w3stfa11\Documents\Visual Studio 2010\Projects\video-to-wikipedia.git\Video-to-Wikipedia\Models\DotNetWikiBot.cs:line 340
at DotNetWikiBot.Site.Initialize() in C:\Users\w3stfa11\Documents\Visual Studio 2010\Projects\video-to-wikipedia.git\Video-to-Wikipedia\Models\DotNetWikiBot.cs:line 242
at DotNetWikiBot.Site..ctor(String site, String userName, String userPass, String userDomain) in C:\Users\w3stfa11\Documents\Visual Studio 2010\Projects\video-to-wikipedia.git\Video-to-Wikipedia\Models\DotNetWikiBot.cs:line 198
at DotNetWikiBot.Site..ctor(String site, String userName, String userPass) in C:\Users\w3stfa11\Documents\Visual Studio 2010\Projects\video-to-wikipedia.git\Video-to-Wikipedia\Models\DotNetWikiBot.cs:line 181
at Video_to_Wikipedia.Models.VideoDownloader.UploadFile(String fileToUpload) in C:\Users\w3stfa11\Documents\Visual Studio 2010\Projects\video-to-wikipedia.git\Video-to-Wikipedia\Models\VideoDownloader.cs:line 122
System.Collections.ListDictionaryInternal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm working on the English Wikipedia and Wikimedia Commons.
This is roughly my code.
My filepath is something like this ""C:\\Documents\\Some Files\\image321abc.jpg" . That should still work, right?
Here's the exception that comes up.
{"The remote server returned an error: (503) Server Unavailable."}
at DotNetWikiBot.Site.GetMediaWikiMessagesEx(Boolean forceLoad)
at DotNetWikiBot.Page.UploadImage(String filePathName, String description, String license, String copyStatus, String source)
I also noticed this on the Mediawiki page that the login has changed. I'm not sure if this affects DotNetWikiBot.
http://www.mediawiki.org/wiki/API:Client_code
https://bugzilla.wikimedia.org/show_bug.cgi?id=23076
Thanks,
Gabriel
There's a typo up above. Instead of commons.wikipedia.org, it should be commons.wikimedia.org . This is not the problem since it's still not working on either http://en.wikipedia.org or http://commons.wikimedia.org
Also, to be clear, the exception is caught during the page.UploadImage call.
Ok, here's an update.
Even though an exception is being thrown, the file is still being uploaded. The exact location where it's being thrown is in the GetMediaWikiMessagesEx(bool forceLoad) method and the exact line is
doc.LoadXml(File.ReadAllText(filePathName, Encoding.UTF8));
I can confirm that filePathName contains the file with the html markup.
I've been doing my testing on vgsales.wikia.com, but I'm also getting the exception on Wikimedia Commons.
I'm using ASP.NET 4.0, C#
StackTrace
Yes, thank you for reporting that. It must be one of undiscovered problems connected to excessive .NET XML parser queries (http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic).
You can try the pre-release corrected version at http://dotnetwikibot.cvs.sourceforge.net/viewvc/dotnetwikibot/framework/DotNetWikiBot.cs
More stable solution was introduced in version 2.94.
Thank you.
I deployed my app on a shared hosting webserver and I'm not receiving this error.
Access to the path 'Cache' is denied.
I'm not sure what is the cause of it. Please, checkout the version at http://dotnetwikibot.cvs.sourceforge.net/viewvc/dotnetwikibot/framework/DotNetWikiBot.cs and tell me if it helps.