snipsco / snips-issues

Feel free to share your bugs with us.
14 stars 5 forks source link

[Platform][skill-server] Do not see debug output for Actions in snips-watch output #141

Closed probonopd closed 4 years ago

probonopd commented 5 years ago

What's the issue? I do not see any debug output for Actions. I see [23:07:19] [Dialogue] New intent detected hass:HassTurnOn with confidence 0.811 but then my action seems to do nothing. How to debug?

Use Cases Impacted Action seems to do nothing

How to reproduce Add HomeAssistant, under "Actions"; select "Code Snippets" and "Python 3", and under "HassTurnOff" add:

import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0',
    'Accept': '*/*',
    'Accept-Language': 'en-US,en;q=0.5',
    'Referer': 'http://192.168.xxx.xxx/',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'X-Requested-With': 'XMLHttpRequest',
    'DNT': '1',
    'Connection': 'keep-alive',
}

data = {
  'brightness': '0'
}

response = requests.post('http://192.168.xxx.xxx/data.esp', headers=headers, data=data)

Then root@snips:~# sam update-assistant.

Expected behavior

Neither happens. How to debug?

Version and Environment

root@snips:~# sam --version
0.0.52

Logs Add any other logs, stack traces, screenshots or even videos that could help for this issue investigation. (e.g. snips-watch -vvv in case of dialogue issues)

Additional information If you have some details you want to share or the root cause seems identified, put it here.

Workaround If a workaround is known, put it here

cpoisson commented 5 years ago

Hi @probonopd,

snips-skill-server error logs are not currently propagated to snips-watch, that is a future improvement. (we also need to re write the trouble shoot guide, also on the backlog)

Meanwhile, there is multiple ways to debug / watch a python script

probonopd commented 5 years ago

Thanks @cpoisson.

snips-skill-server error logs are not currently propagated to snips-watch, that is a future improvement

Yes, this would definitely be very helpful 👍, it is what I (as a new user) had expected to see - that sam watch shows me any Python output coming from an action snippet when it is being executed (including errors).

In my concrete case, I could find out that the venv in which the action is running was missing the requests module, but it was more cumbersome than needed to find that out. Especially for a newcomer it is not obvious in which venv an action is running.

cpoisson commented 4 years ago

Hi @probonopd

We have improved the log output in the version 1.3.0

Now, when a dialog session time out, the culprit component is stated in the logs.

Regarding the injection of snips-skills-server errors, it does not implement in itself hermes-protocol which is quite costly to do on our side.