forkcms / forkcms

Fork is an easy to use open source CMS using Symfony Components.
http://www.fork-cms.com
MIT License
1.17k stars 322 forks source link

ForkAPI ping services problems #1014

Closed jessedobbelaere closed 9 years ago

jessedobbelaere commented 9 years ago

I believe there's something wrong with the ForkAPI. I launched a new website, but when I add a new blog post I get the following error:

Invalid XML-response.
500 Internal Server Error - ForkAPIException
in /var/vwww/www.wecallitstitch.com/www/library/external/fork_api.php at line 184

I first thought that one of the parameters in add.php of the blog module was incorrect. And yes, I debugged the url and I got a "/404/XXX" url that was sent to the ping services. That was due to this line: BackendModel::getURLForBlock('blog', 'detail') which is supposed to have capitalized module & action names when you call the ping services method. When I capitalize the names, I get the correct url. I'll make a PR for this...

But I kept getting the Invalid XML error. So I debugged some variables during the API call, but they all seemed correct. This is the final URL used by the external library for the api call:

http://api.fork-cms.be/2.0/rest.php?method=ping.getServices&public_key=e6b913e8ecdded0c7aa436e0f648cd70&nonce=1419041511&secret=2d46e1738b7cc39c89a910e469XXXXXX

I debugged the $response and I apparently got the following response: "No input file specified." I also get this message when I visit the url manually. That's why the XML parser is giving the Invalid XML response.

Is there something wrong with the Fork API? Or is the problem on my end? I'm using Fork CMS 3.8.1.

edit: I just tried to add a blog post on a local website on my machine. It gave the same error. But if the ping services data in the db is less than 1 month old, it will skip the get ping services I think.

I tried to add a (hidden ;-) ) blog post on a live 3.6.5 website and it gave me the same error (if I enable debug mode). This seems like an urgent problem? Every Fork website with blog module who creates or edit a blog item and has the ping services enabled, gets an error thrown.

WouterSioen commented 9 years ago

I would just disable the ping_services setting as a temporary fix. I don't know a thing about how that api class and the fork-cms server are working, so I hope somebody else knows something more about this. @forkcms/core-contributors

jessedobbelaere commented 9 years ago

The output of the API is now: "500 Internal Server Error" instead of "No input file specified". Test it here. So this confirms that there is something wrong with the Fork API. Also, when you browse to http://api.fork-cms.be/2.0/ you get the directory index?

WouterSioen commented 9 years ago

I don't have access to the server with the credentials I've found on our intranet. I'm contacting Openminds to see if they changed something or know what caused this issue.

WouterSioen commented 9 years ago

@jessedobbelaere Can you test this please? Should be ok now.

jessedobbelaere commented 9 years ago

The error is gone. I'll take a look tonight to be sure that the services are getting pinged. Thanks!