Hi,
After updating my Mark 1 to mycroft-core 0.8.21 (with nightly updates), the skill-weather has stopped working.
As a greybeard former Unix sysadmin and software engineer, I have two goals here:
- Help report and trace a bug
- Learn and document the debug process - perhaps something to add to a FAQ?
After a look around resource, I’m unsure what the best workflow is for skill bugs, so hope someone can point me in the right direction.
Thanks!
Issue Description
After a recent update, the weather skill has stopped working. The utterance is recognised, but Mycroft does not reply.
###Environment
- Mycroft Mark 1
- mycroft-core 0.8.21
- Nightly cron job to ‘
apt-get update
’ active
Steps to Reproduce
- Say ‘Hey Mycroft, What’s the weather?’
- Say ‘Hey Mycroft, What’s the weather in Austin?’
###Expected result - A spoken weather forecast for my local area, as pre-configured some time ago.
- Weather symbols on the LED matrix
###Actual Result - Mouth changes to listening
- After a few seconds, the mouth goes blank (or back to the time skill clock display)
- No speech, no response.
##Investigation
After some poking around the forums, I found how to check the Mark 1 software version, and fixed the auto-update roof cron job. I also found the main log files, and noticed errors appeared about the same time as the main skill-weather Python script timestamp.
I know a little of GitHub from FOSS tinkering, but don’t know the preferred workflow to report / diagnose skill issues.
Some basic checks:
pi@mark_1:~ $ apt list --installed |grep mycroft-core WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts. mycroft-core/unknown,now 0.8.21 armhf [installed] pi@mark_1:~ $ ls -la /opt/mycroft/skills/skill-weather total 96 drwxr-xr-x 7 mycroft mycroft 4096 Aug 24 16:22 . drwxrwxrwx 30 mycroft mycroft 4096 Aug 21 16:37 .. drwxr-xr-x 3 mycroft mycroft 4096 May 17 01:30 dialog drwxr-xr-x 8 mycroft mycroft 4096 Aug 24 16:22 .git -rw-r--r-- 1 mycroft mycroft 21875 Aug 21 14:04 __init__.py -rw-r--r-- 1 mycroft mycroft 16685 Aug 24 16:22 __init__.pyc -rw-r--r-- 1 mycroft mycroft 9141 Aug 21 14:04 LICENSE.md -rw-r--r-- 1 mycroft mycroft 125 May 17 01:30 README.md drwxr-xr-x 3 mycroft mycroft 4096 May 17 01:30 regex -rw-r--r-- 1 mycroft mycroft 52 May 17 01:30 requirements.txt -rw-r--r-- 1 mycroft mycroft 2 Aug 24 16:22 settings.json drwxr-xr-x 3 mycroft mycroft 4096 May 17 01:30 test drwxr-xr-x 3 mycroft mycroft 4096 May 17 01:30 vocab
Mycroft logs appears to live in /var/log, and I found the test console which also reproduces the issue:
python -m mycroft.client.text.main --quiet tail -f /var/log/mycroft-* vim /var/log/mycroft-skills.log
So, tracing the skill-weather failure gives an error mesage:
2017-08-24 16:03:58,236 - Skills - DEBUG - {"type": "recognizer_loop:utterance", "data": {"lang": "en-US", "session": "3c447d2c-1974-48a9-9625-c6c61f4ad80e", "utterances": ["what's the weather"]}, "context": null} 2017-08-24 16:03:58,280 - Skills - DEBUG - {"type": "WeatherSkill:CurrentWeatherIntent", "data": {"confidence": 0.5, "target": null, "intent_type": "WeatherSkill:CurrentWeatherIntent", "Weather": "weather", "__tags__": [{"end_token": 2, "start_token": 2, "from_context": false, "entities": [{"confidence": 1.0, "data": [["weather", "Weather"], ["Weather", "Concept"]], "key": "weather", "match": "weather"}], "key": "weather", "match": "weather"}], "utterance": "what's the weather"}, "context": {"target": null}} 2017-08-24 16:03:58,287 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai 2017-08-24 16:03:58,763 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/weather?q=Cramlington%2C+England%2C+United+Kingdom&lang=en HTTP/1.1" 200 451 2017-08-24 16:03:58,778 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai 2017-08-24 16:03:59,226 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/forecast/daily?q=Cramlington%2C+England%2C+United+Kingdom&lang=en HTTP/1.1" 200 1978 2017-08-24 16:03:59,237 - skill-weather__init__ - ERROR - Error: 'NoneType' object has no attribute 'to_JSON' 2017-08-24 16:04:05,698 - Display Manager (mycroft.client.enclosure) - DEBUG - Setting active skill to TimeSkill
This suggests to me either the HTTPS call is failing, and/or the skill isn’t catching the return data.
I have seen some reports of issues with web configuration of custom locations (I’ve used the Mycroft.ai WWW settings to setup Cramlington, England), so I also tried an explicit US location picked from other register_vocab calls in the log - Austin:
> 2017-08-24 16:51:04,747 - Skills - DEBUG - {“type”: “WeatherSkill:CurrentWeatherIntent”, “data”: {“confidence”: 0.6666666666666666, “target”: null, “intent_type”: “WeatherSkill:CurrentWeatherIntent”, “Weather”: “weather”, “Location”: “austin”, “tags”: [{“end_token”: 2, “start_token”: 2, “from_context”: false, “entities”: [{“confidence”: 1.0, “data”: [[“weather”, “Weather”], [“Weather”, “Concept”]], “key”: “weather”, “match”: “weather”}], “key”: “weather”, “match”: “weather”}, {“end_token”: 4, “start_token”: 4, “confidence”: 1.0, “from_context”: false, “entities”: [{“confidence”: 1.0, “data”: [[“austin”, “Location”]], “key”: “austin”, “match”: “austin”}], “key”: “austin”, “match”: “austin”}], “utterance”: “what’s the weather in austin”}, “context”: {“target”: null}}
> 2017-08-24 16:51:04,753 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
> 2017-08-24 16:51:05,287 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/owm/weather?q=austin&lang=en HTTP/1.1” 200 444
> 2017-08-24 16:51:05,302 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
> 2017-08-24 16:51:05,763 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/owm/forecast/daily?q=austin&lang=en HTTP/1.1” 200 1989
> 2017-08-24 16:51:05,775 - skill-weather__init__ - ERROR - Error: ‘NoneType’ object has no attribute ‘to_JSON’
So - pre-configured, or explicit locations give the same 'ERROR - Error: ‘NoneType’ object has no attribute ‘to_JSON’ in what is probably
I don’t know if the installed skill code is the latest version in GitHub, but I think the error is thrown in ‘/opt/mycroft/skills/skill-weather/init.py’:
My thought is to backup the skill files and then start adding LOG.info() calls into the Python code to get a feel for where the error is occurring, but don’t see other text in ‘/var/log/mycroft-skills.log’ suggesting there may be a log level setting or another file.
Any ideas please?