Code took too long to return result

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
zoic22
Posts: 45
Joined: 04 Apr 2014 14:21

Code took too long to return result

Post by zoic22 »

Hi,

I used zway application only by api and I have often this return message :

Code: Select all

Error 500: Internal Server Error
Code took too long to return result
Why I get that ? And how to solve it ? I empty automation folder (and restart rasberry) but I still have the error.

Did know how to solve that ?


Thank in advance
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Code took too long to return result

Post by pofs »

What kind of requests are you executing which give you such response?
There's a timeout on waiting for response if it is executing too long. Also this might happen if you're making too much simultaneous requests.
zoic22
Posts: 45
Joined: 04 Apr 2014 14:21

Re: Code took too long to return result

Post by zoic22 »

My request it's like
/ZWaveAPI/Run/devices[24].instances[2].commandClasses[0x25].Set(0)

Maybe it's due to simultaneous request, I do 1 resquest each minute to know change on zwave, and some other request to do action. What is the limit ?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Code took too long to return result

Post by pofs »

Requests executing once a minute are hardly considered simultaneous :)
HA UI makes approximately 2 requests a second, and server handles it fine.

I still think something is polling your RaZberry wa-a-ay more often.
Another option is some heavy JS code which is blocking server on either timer, event or web request. But you say you deleted automation folder (and restarted z-way-server after that?), so timers and events shouldn't be an issue.

Look in the log. Every JS request is logged there with a timestamp.
Post Reply