RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.58k stars 236 forks source link

Error Publishing to Wordpress #341

Closed MattHoneycutt closed 6 years ago

MattHoneycutt commented 6 years ago

I'm getting a fairly cryptic error while trying to publish a new post to my Wordpress blog: "Error sending post to Weblog: Error sending post to Weblog: unused."

image

It works fine for a different post, so I think it's something I've done in this particular post, though I'm not sure what.

If I immediately try to publish again, I get a slightly different error: "Error sending post to Weblog: Error posting images to Weblog: unused."

Any suggestions for troubleshooting further?

Thanks!

RickStrahl commented 6 years ago

Can you take a look at your error log and see if there's any additional information?

That said the error message really sounds like an error coming from the server. The message comes from the Image uploads to the server.

I added an additional log point when the image upload fails which should give more info in the next update. Currently only the post level hits the log so if an image upload error occurs that might be lost in the log detail. The update will log both the image failure and the post failing.

60c34e1fb5a0a67baa98582a8a6bc6510bd0ca87

MattHoneycutt commented 6 years ago

There's a bit, but I don't know if it's helpful:

3/22/2018 1:27:32 PM - Error sending post to Weblog at https://<removed>/xmlrpc.php: Error sending post to Weblog: unused
3/22/2018 1:29:47 PM - Error sending post to Weblog at https://<removed>/xmlrpc.php: 
Markdown Monster v1.9.18.0
10.0.16299.15.x86fre.rs3_release.170928-1534 - en-US - NET 4.7.1 - 32 bit
en-US - en-US    
---
CookComputing.XmlRpcV2
   at CookComputing.XmlRpc.XmlRpcClientProtocol.ReadResponse(XmlRpcRequest req, WebResponse webResp, Stream respStm)
   at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters)
   at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] Parameters)
   at XmlRpcProxy7a842666-250c-4dce-b5de-01b7babb9da4.NewPost(Object blogId, String username, String password, XmlRpcPost content, Boolean publish)
   at WebLogAddin.MetaWebLogApi.MetaWeblogWrapper.NewPost(Post post, Boolean publish)
   at WebLogAddin.MetaWebLogApi.MetaWebLogWordpressApiClient.PublishCompletePost(Post post, String basePath, Boolean sendAsDraft, String markdown)          
---------------------------

3/22/2018 1:29:47 PM - Error sending post to Weblog at https://<removed>/xmlrpc.php: Error sending post to Weblog: unused
3/22/2018 1:29:52 PM - Error sending post to Weblog at https://<removed>/xmlrpc.php: Error posting images to Weblog: unused

Probably-definitely related, but I tried removing the very last image that I added from my post, then tried republishing my post it, and it worked fine.

I'm not sure what it didn't like about the image, it was just a normal PNG file, nothing crazy. But for whatever reason, it looks like that was causing Wordpress to reject the post, causing this error.

RickStrahl commented 6 years ago

I wonder if it's a filenaming issue. The error sounds like perhaps the upload image file name and link in the document are perhaps not the same.

If it's repeatable, any chance you can share the post and image that's breaking privately?

MattHoneycutt commented 6 years ago

The dozen or so images in the post all followed the same naming convention:

creating-a-new-project-with-aspnet-core-and-angular-00.png creating-a-new-project-with-aspnet-core-and-angular-01.png creating-a-new-project-with-aspnet-core-and-angular-02.png

And so on.

Removing the -00.png file is what seemed to resolve things.

When I checked, I noticed that file actually existed server-side... it's like it partially uploaded or something.

I've not been able to reproduce the error so far, but I'll keep trying. Thanks for the help!

RickStrahl commented 6 years ago

Could it be a size issue? Or corruption? Wordpress may be checking and post processing uploaded images and failing at verifying the file? If you have the file that fails and you can share I can take a look. What happens if you rename the file and place another file as -00.png?

Sorry - feel free to just go on with your life :-) but if it'd be good to track this down.

MattHoneycutt commented 6 years ago

I love Markdown Monster, so I'm happy to make any small contribution I can, including debugging! :)

Corruption would be my guess. The file was actually smaller than some of the others. I'll dig in to this a bit more this evening and send you the file in question. I'll double-check the file that was uploaded and see if it is still a valid image, too.

MattHoneycutt commented 6 years ago

Ok, here's the image in question. The image does appear to be valid.

image

I did notice something strange and probably relevant.

The first upload does seem to have created the image. It's on there as BlogPostscreating-a-new-aspnet-core-2-1-preview-project-with-angular-00.png...

The second time, it uploaded the image, too! But it named it BlogPostscreating-a-new-aspnet-core-2-1-preview-project-with-angular-00-1.png.

It just kept incrementing that last -# suffix:

BlogPostscreating-a-new-aspnet-core-2-1-preview-project-with-angular-00-2.png BlogPostscreating-a-new-aspnet-core-2-1-preview-project-with-angular-00-3.png BlogPostscreating-a-new-aspnet-core-2-1-preview-project-with-angular-00-4.png

There were about a dozen images on that post, and it looks like it uploaded each of them, each time, following that same pattern!

Anyway, that's what I found. I wish I had more info. I'll keep an eye out, and if the issue occurs again, I'll grab the logs.

RickStrahl commented 6 years ago

It looks to me there's some problem on the WP end since the other images are working. It looks like the image gets there and then something fails on the server so it thinks the image was never uploaded and then renames the image because it exists. MM never gets the image id so there's no way we can track the image against the server since it fails to return a valid response.

So I'm not sure what to do here especially given that all the other images are working fine. Maybe a Fiddler trace will help highlight what's going on.

But - if it works for other posts maybe let it go for now - if the issue comes back maybe take another look with Fiddler and see what actually goes to the server and what the raw server response is.

Thanks for your help...

MattHoneycutt commented 6 years ago

Yup, if it happens again, I won't try to work around it, I'll grab a trace and try to get some additional logs instead.

Keep up the great work on Markdown Monster. You've made blogging great again! :D