Author Topic: Import Error  (Read 1408 times)

vinull

  • Newbie
  • Posts: 4
Import Error
« on: January 05, 2013, 08:50:24 pm »
Trying to setup an existing podcast on Wordpress with PowerPress.  The only method for import I could find was to append a link to the podcast file in the body of the posts, and then use PowerPress "Import from other Blogging Platform".  (I have an RSS file with length and size already set for the enclosures, but I don't see any support to import this info).

PowerPress finds all the linked MP3s correctly, but for every episode returns:

Quote
Error importing "GM-114-Holiday-Hangover.mp3" for blog post GameMarx EP114 - Holiday Hangover: HTTP return code 505.

I can go to an individual post and put the episode in the podcast form manually and auto detection of the length and size works just fine.  The above MP3 is at http://static.gamemarx.com/assets/podcast/GM-114-Holiday-Hangover.mp3

I get the error with or without "detect duration" checked, though obviously I want it checked.

I'm running WP 3.5 and PowerPress 4.0.5

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #1 on: January 06, 2013, 08:11:53 pm »
This is a web hosting issue, the 505 error you can read about, Google "HTTP 505" to learn more, but it has to do with your server not supporting HTTP/1.1 protocol, which is important if you want this media to be available on any Apple devices or iTunes.

vinull

  • Newbie
  • Posts: 4
Re: Import Error
« Reply #2 on: January 06, 2013, 08:41:18 pm »
The podcast is already on iTunes, etc. and the webhost is Microsoft Azure, which fully supports HTTP/1.1.

And again, this works from the post form, but not from the import wizard in PowerPress/BluBrry.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #3 on: January 06, 2013, 09:07:01 pm »
Microsoft Azure is a cloud storage service, not a CDN service your not given any guarantee that it is fully 1.1 compliant.

The code for detecting the file exists is the same for verify or from the import, it relies on the http library built into wordpress, it may be that your latest media is on a different silo than your older media.  Check with Microsoft, use http header tools to verify http/1.1 compliance on the urls that failed.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #4 on: January 07, 2013, 10:53:21 am »
I saw your tweet (https://twitter.com/ViNull/status/288138271274442752). I can assure you the above answer is the correct diagnosis for the problem you are having.

I looked at the PowerPress code for a possible bug last night before I answered this reply. Here are more specifics so you understand what is happening. Consult an Internet Engineer for confirmation if you do not want accept my expertise on this matter.

PowerPress code uses the WordPress function wp_get_http_headers(), looking at WordPress source code, it will first use cURL library, if that's not enabled on your blog then it will try the fopen functions built into PHP. Either way, this is not my control. It appears WordPress is using the latest HTTP protocol 1.1. In most all cases, this is fine, but if the server it connects to only supports HTTP 1.0 then the server will report the HTTP error 505.

Now some details on the HTTP protocol. The most popular standard is HTTP/1.1, and all web servers support HTTP/1.0 (I Don't know of any web server that does not support 1.0 protocol at minimum). In the RFC for HTTP/1.0 and HTTP/1.1, the HTTP error code 505 is clearly documented, if you get a 505 error from a server, it means that server cannot handle the requested HTTP protocol. In English, if cURL or fopen in PHP use the newer (1.1) version of HTTP and the server doesn't accept it, it will return the 505 error. That is what you indicated above.

Keep in mind the HTTP/1.1 protocol is not new, it was released in 1999. But there are reasons for servers to downgrade themselves to HTTP 1.0, and that's something Microsoft Engineers of the cloud service you are using would be better to answer. My only guess is that once a file has bee in the cloud for more than x days the files are archived on servers that have some HTTP 1.1 features turned off to save on bandwidth costs.

HTTP/1.1 is very important for media and other large files, it includes options for getting extensive header information and more importantly, includes "byte serving" which is required for iTunes, among other applications/phones.

We do not recommend using cloud based services to host podcast media. A cloud storage service is not the same as  CDN (Content Delivery Network), cloud services are not concerned about redistributing the files via the web, the primary concern is to store and backup your files that you put in such a service. In most cases, using cloud storage service as a CDN violates the terms of service. The only cloud storage service that I know of that will gladly allow you to host your files and serve them unlimited is Amazon S3, but that service you pay for your bandwidth you consume.

vinull

  • Newbie
  • Posts: 4
Re: Import Error
« Reply #5 on: January 07, 2013, 03:24:56 pm »
Azure is not only okay for content, it offers a CDN with world wide caching options.

I'm on a plane for CES so this will be short.

You can verify the podcast mp3 above is fine and http 1.1

It works now from our current site; I am a developer and understand the Internet.

It works from the post form, but not the import.  Same file.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #6 on: January 07, 2013, 03:27:55 pm »
I am at NMC/CES working as well. I would try the import again, may have been a fluke.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #7 on: January 07, 2013, 03:34:54 pm »
Except for the initial and detailed reply, I've been keeping up with the thread with my phone.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #8 on: January 08, 2013, 10:05:05 am »
Send me a screenshot if you have the error again, maybe the 505 error is not with the media URL, the screen shot may clear things up if that's the case. cio [at] rawvoice dot com.

vinull

  • Newbie
  • Posts: 4
Re: Import Error
« Reply #9 on: January 30, 2013, 09:30:09 pm »
Finally able to get back to this issue after CES and a bunch of other things; I've found the bug in the plugin.

Line 169 of powerpressadmin-mt.php:
$response = wp_remote_head( $url );

Should be:
$response = wp_remote_head( $url, array('httpversion' => 1.1) );

If you read the Codex for wp_remote_head (http://codex.wordpress.org/Function_API/wp_remote_head) you'll see that by default it's http/1.0 not http/1.1. 

After fixing this line, all 115 episodes imported without further issue.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #10 on: January 31, 2013, 02:03:31 pm »
Another smack in the face by WordPress code. There's absolutely no reason to not be using HTTP 1.1 for getting headers, since the protocol is backwards compatible. Either way, I've updated PowerPress to include HTTP 1.1 anywhere wp_remote_head function is used. Fix will be in the next update.

Still, the server should support a 1.0 request, I guess Microsoft thinks that if you're using an older client you wouldn't want to use their newer services.

Thanks,
Angelo

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Import Error
« Reply #11 on: January 31, 2013, 02:20:21 pm »
Just to be clear, the opposite of what I thought is happening, your Microsoft CDN service does not support 1.0 requests, which is why it was giving you the 505 error code. It is understandable that Microsoft CDN does not support the older 1.0 protocol, the 1.1 protocol is required to host multiple domain names on one server (Host: header parameter), so doing so means they can provide alias DNS names.

In the opposite token, there's absolutely no reason for WordPress core function wp_remote_head() not to be using HTTP 1.1 protocol in head requests, it's actually bad practice for them not to assume 1.1 since their other functions that use cURL/fopen automatically do use HTTP 1.1, plus HTTP 1.1 has been the standard for more than 15 years.