Kannan's Jumbled Thoughts Rotating Header Image

HowTo: Fix "The response to the metaWeblog.newMediaObject method received from the weblog server was invalid"

Today I got this error message from WLW: “The response to the metaWeblog.newMediaObject method received from the weblog server was invalid“. Why did WLW think the response was “invalid“?? What exactly did it receive from WordPress??

Luckily, WLW logs a lot more in the background. You can access that log file via Help -> About WLW. Click on the “Show Log Results” link in the dialog box. This will open the log folder.

Mine had this trace dump:

WindowsLiveWriter,21504,Fail,00020,18-Mar-2008 14:00:01.479,"WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response - The response to the metaWeblog.newMediaObject method received from the weblog server was invalid:
Invalid response document returned from XmlRpc server
at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.CallMethod(String methodName, XmlRpcValue[] parameters)
at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.DoBeforePublishUploadWork(IFileUploadContext uploadContext)
at WindowsLive.Writer.PostEditor.WeblogBlogFileUploader.DoUploadWorkBeforePublish(IFileUploadContext uploadContext)
at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.FileUploadWorker.DoUploadWork(BlogFileUploader fileUploader)
at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.LocalFileTransformer.Transform(String reference)
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.LocalFileReferenceFixupFilter.FixReferences(String reference)
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.OnBeginTag(BeginTag tag)
at WindowsLive.Writer.CoreServices.LightWeightHTMLDocumentIterator.Parse()
at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixLocalFileReferences(String html, ReferenceFixer fixer)
at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.LocalSupportingFileUploader.UploadFilesBeforePublish()
at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.DoWork()
at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()"," at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at WindowsLive.Writer.CoreServices.Diagnostics.LogFileTraceListener.Fail(String message)
at System.Diagnostics.TraceInternal.Fail(String message)
at System.Diagnostics.Trace.Fail(String message)
at WindowsLive.Writer.PostEditor.BlogPostEditingManager.UpdateWeblog(Boolean publish)
at WindowsLive.Writer.PostEditor.BlogPostEditingManager.PostToWeblog(Boolean publish)
at WindowsLive.Writer.PostEditor.PostEditorMainControl.commandPostAndPublish_Execute(Object sender, EventArgs e)
at WindowsLive.Writer.ApplicationFramework.Command.RaiseEvent(Object eventKey, EventArgs e)
at WindowsLive.Writer.ApplicationFramework.Command.OnExecute(EventArgs e)
at WindowsLive.Writer.ApplicationFramework.CommandBarButtonLightweightControl.OnMouseUp(MouseEventArgs e)
at WindowsLive.Writer.Controls.LightweightControl.RaiseMouseUp(MouseEventArgs e)
at WindowsLive.Writer.Controls.LightweightControlContainerControl.OnMouseUp(MouseEventArgs e)

Pretty neat stack trace,eh? ;) It clearly shows that DoUploadWork() (Invoked by UpdateWebLog()) method fails for some reason. Armed with this knowledge, I took a look at my post. I had many pictures in that and my WLW was setup to upload pictures through XML RPC. So, obviously that was causing some kind of trouble. I traced down the big picture (size: ~0.7MB) in my post, resized it to 40K and published again. Voila, things worked perfectly!

I googled for the error message, since I wanted to know how other people solved this. Looks like increasing the memory size for PHP in the server side will also help. So, one of the following things should help you to solve this problem:

  1. If you have images embedded that need to be uploaded to the server, make sure they are not big. I don’t have any idea on the *optimal* size. I guess anything less than 100K should be ok.
  2. If still you are getting the same error, try increasing the memory_limit value in php.ini to 12M or 16M. Check this page for info on memory_limit. If you don’t have access to your server, you may have to talk with your host provider.

I believe the first solution will fix this error, in most of the cases. Do let me know in the comments, if you come across any other solutions.

Tags: , , , ,

8 Comments

  1. Thanks for helping out with that one. I thought there was something up with my weblog settings, so great to know it’s just the images that cause the problem.

    Jonathan
    http://jonathanpaston.com

  2. Bradford says:

    This didn’t work for me, but I suspect it’s because I switched to lighttpd from apache. Everything works flawlessly with lighttpd, however this problem is hard to take down.

  3. I was getting similar error on my blog. The problem turned out to be picture size. Thanks!

  4. brettbum says:

    I was getting this error for an image at about .6mb when I reduced the image quality 10% the file size dropped to .287 mb and it uploaded just fine with no error. Thanks for the tip!

  5. The WP Smush it plug-in once triggered this error but it has been fixed in the latest release

  6. Unknown says:

    Very good work and excellent post! Thanks!

  7. [...] change.  That wasn’t an option if I wanted this to work, but forunately I stumbled across this link, which gave me the idea of crafting a new php.ini file.  Being on a hosted account, I put a [...]

Leave a Reply