[Dialogue] The session was ended because one of the component didn't respond in a timely manner

I know that the answer “The session was ended because one of the component didn’t respond in a timely manner” from Dialogue has been reported several times. My problem is however slightly different from those mentioned on the forum since it only happens from time to time. In fact, I noticed that it occurs when the callback function takes too much time to do its action (when roughly over 5 seconds). This is typically the case for my radio app which is looking for info on TuneIn. Depending on the time TuneIn takes to answer, my app may or not face the issue from Dialogue.

I tried several workarounds :

  • end the session at the beginning of the callback function (hermes.publish_end_session()) and then continue to run the code to play the radio
  • adjust the parameters “session_timeout” and “lambda_timeout” in /etc/snips.toml (with restart of snips-dialogue service :slightly_smiling_face:)

but none of them did solve the issue. I’m running Snips on a Voice Interaction Kit (Raspberry Pi 3 B+).

Does anybody have a clue?

Thanks and best regards

Hi @job,

This error is displayed when the Snips platform doesn’t get any response from the action code within 5s (this duration is defined in the /etc/snips.toml file). This can happen for 2 main reasons:

  • There is no app installed ;
  • An app is installed, but takes for than 5s to respond (which seems to be your case).

There is no official way to do this. A proper solution would be to ping the platform to add time to the current timeout.

What’s the issue with your first workaround?

To have the TTS being said even after the timeout, I suggest you to use a notification. This will allow you to create a new session of type notification, not linked to any dialogue. Just register a callback to a function creating such a notification in your handler.

these are the correct settings to adjust to extend the timing.

your best bet is to run the action code manually python action-xxxxxxx.py from the action code directory and watch its output directly in the terminal just to make sure there is not some other problem that is occurring… such as html errors 403 etc etc

Hi Thomas,

Thanks for your feedback. I wasn’t aware of the possibilities offered by notifications (I’ll explore them). To answer your question, ending the session at the beginning of the callback function (hermes.publish_end_session()) still causes the issue “The session was ended because one of the component didn’t respond in a timely manner”. In fact, it seems that the issue shows up as soon as the callback function doesn’t give the hand back in a period of 5s, regardless of the session_timeout and lambda_timeout values in the /etc/snips.toml file.

I made some new experiments with an app playing music from youtube which always takes more than 5s to find the right song (basically, it takes around 30s). When I set both “session_timeout” and “lambda_timeout” to 40 in /etc/snips.toml, the app is finding the song and displays its link after 30s and then ends the session and gives the hand back (I commented out the playing of the sound, normally running in a background task, to be sure it does not interact with this experiment). Then I still have to wait 10s to see the session ending in sam watch with the famous “The session was ended because one of the component didn’t respond in a timely manner”. This is annoying because after that, the app is definitively blocked (its callback functions are no more called, including those registered with “subscribe_session_started()” and “subscribe_session_ended()”). It looks like the delay of 5s is hard coded somewhere.

So, I would have two questions for the community:
a) What is the difference between the “session_timeout” and “lambda_timeout” parameters?
b) Is there a way to extend the time slot allocated to the callback functions with these parameters or other means?