Hi,

I am retrieving JSON from my Drupal Site to show content on an external Device. I am using Drupanium/REST/Services to do so.

Now the problem is weird.

When I try to access this URL, it works fine:-

http://myurl.com/api/rest/views/region.json

But when I try to run this URL, it gives me a big, shiny and horrendous Internal Server Error (500)

http://myurl.com/api/rest/views/content.json

I am using Fields in the region.json and Content in content.json within views. I am also attaching a screenshot for both corresponding views, as it might help.

Region View
Region View Picture

Content View
Content View Picture

P.S. Content.json just have to load all of the articles, whereas regions just show the region field.

Do you have any idea what might be wrong.

Many Many Thanks.

Comments

stephane.saussier’s picture

So I've been trying to find possible fixes and found out that there is something in the Articles that is creating problem.

As an example I randomly unpublished 4 of the articles and showed only them through View.

It then worked fine.

The problem now is that there are 100 of articles and I'd have to find the exact problem/character or something which creates this problem.

Alternatively, may be a script to ignore it.

Thanks a lot for any feedback.

EDIT : My Bad, it's the number of posts. Any number of posts greater than 39 create this error. I don't know how and where to set it ... Any idea?

alotropico’s picture

I know the post is pretty old, but I currently have the same problem. Did you solve it any how? Thank you

Amberdine’s picture

I use cPanel and CentOS 7, and I get 500 errors all the time. It's almost always a permissions issue for me.

Look at your apache log to see the details. Mine is at /usr/local/apache/logs/error_log . Yours might be different, but try the page that gives the error, then use tail on the log, and you should get a better clue.

helios.drupal’s picture

I got the same error for my views wherever we have json data using views_data_export(). It uses mb_check_encoding() and in my error log, I had found this function is undefined. So, please enable this PHP extension php_mbstring on your server. Hope you get your json data working. Otherwise you have to check your server's error logs.