Closed preshit closed 8 years ago
This is the more verbose error message that we added to help troubleshoot issue #92. Can you provide the JSON file that encountered this error and a link to the post on your site?
Thanks.
The most likely scenario here is that your host is doing something to disable file_get_contents
, which is required to get the image file and include it in the bundle. Can you please rule out that possibility first?
@bcampeau Sure thing! I'll contact my host and update this issue with what they have to say.
Thanks!
Specifically they may need to enable allow_url_fopen
in your PHP config.
I am seeing the same error and to test turned on allow_url_fopen
and still getting same error message:
There has been an error with the API. Please make sure your API settings are correct and try again: The attachment IMG_xxxx.png could not be included in the request because it was empty.
Can you please provide a link to the image and the post on your site?
One thing I realized then turning on allow_url_fopen
the error is pointing to the first image instead of the featured image when allow_url_fopen
is off.
OK, we'll need to see the JSON file and a link to the actual post to help you.
Attached the JSON file: article-403.json.zip
And here his the link to the actual post: http://blog.ticoroasters.com/2015/05/quest-for-perfect-coffee-los-andes/
The link to the actual pic for allow_url_fopen
turned on: http://i2.wp.com/blog.ticoroasters.com/wp-content/uploads/2015/05/IMG_5872.png
The link to the pic for allow_url_fopen
off error: http://i2.wp.com/blog.ticoroasters.com/wp-content/uploads/2015/05/IMG_5872-180x300.png
Hope this will help ..
Here's what my host had to say:
file_get_contents is dependent on allow_url_fopen which has been disabled on our [service] for security reasons.
We do support CURL as an alternative to url_fopen. Your plugin author should know if they are using these functions or not.
There are other hosts that don't support cURL, like WordPress.com VIP, so this was the chosen method. Unfortunately at this time, if your host doesn't support this function, you can't use this plugin.
I'll leave this issue open as I think it will be worthwhile reconsidering if there's a better way to handle this.
Did you have a chance to look into my problem? As mentioned I have allow_url_fopen
turned on and still get the following error message:
There has been an error with the API. Please make sure your API settings are correct and try again: The attachment IMG_5872.png could not be included in the request because it was empty.
The JSON file and links are above ... Thanks for your help!
Unfortunately I'm not seeing any reason for the error to occur. I don't have a solution for you at this time.
Well, is there a way to turn on debugging so I can see where it fails? I also tried to just push a text post and I get the following error:
There has been an error with the API. Please make sure your API settings are correct and try again: INVALID_DOCUMENT
Maybe this gives you an idea what it could be? Thanks for any help!
You need to export the JSON file, download the images, and drop them into a folder. That folder can then be dragged into the News Preview tool (https://developer.apple.com/news-preview) which will give you more detailed errors. Once you have those, please feel free to paste them here and I can give more feedback.
Thanks.
@thgoepel are you still looking for assistance here? If not, we'll be closing this issue as there isn't any further action on our end otherwise.
Thanks.
@bcampeau yes I still have not been able to get it to work. The only way it seems I can get it to work is without any pictures. As soon as there is a picture in the blog post, the post does not get exported. I have checked with the new preview and could not find any error. I am wondering if there is a permission issue somewhere in the wordpress filesystem. Is there a temporary folder where the images get saved into before uploaded to apple-news?
We do not use the filesystem because some hosts wouldn't support that. Images are streamed directly to the API from wherever they are located. INVALID_DOCUMENT
however indicates a formatting issue. Have you been able to use the News Preview tool to get the actual error? If not, we did request a sample bundle from you that was failing so we could help troubleshoot. We'll need one of those two things to be able to assist you here.
Thanks.
@bcampeau I have used the News-Preview Tool and when I have images I get the following warning:
Warning: Anchor with targetComponentIdentifier [TextComponent-26] is out of range. Range has been removed.
When it is text only then there is no warning. I guess I have to play more to see what part of the post it is acting up with. You can see the son file and the image in an earlier post that I provided.
Do you have any ideas what it could be?
Are you referring to article-403.zip in https://github.com/alleyinteractive/apple-news/issues/118#issuecomment-202951034?
Here you go. Added one of the articles as a complete package. The weird thing is that is works in the iPad preview and throws an error in the iPhone preview. Would appreciate if you have any ideas ... Thanks so much!
Closing this in favor of #163 which provides a more robust solution using the API directly.
Running v1.0.6 of the plugin, when trying to publish a post, it throws the following error:
There has been an error with the API. Please make sure your API settings are correct and try again: The attachment could not be included in the request because it was empty.