MycroftAI/mycroft-timer

Cannot set a timer

ndarilek opened this issue · 10 comments

Reliably getting this error with "hey mycroft, set a timer for 10 minutes." Mycroft 18.2.13:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/mycroft_core-18.2.13-py3.5.egg/mycroft/util/lang/format_en.py", line 292, in pronounce_number_en
    last = number_names[int(_num[2:4])]
ValueError: invalid literal for int() with base 10: '.0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/mycroft_core-18.2.13-py3.5.egg/mycroft/skills/core.py", line 646, in wrapper
    handler(message)
  File "/config/mycroft/skills/mycroft-timer.mycroftai/__init__.py", line 171, in handle_start_timer
    timer_name = nice_duration(self, secs, lang=self.lang)
  File "/config/mycroft/skills/mycroft-timer.mycroftai/__init__.py", line 697, in nice_duration
    out += pronounce_number(minutes, lang) + " " + self.translate(
  File "/usr/local/lib/python3.5/dist-packages/mycroft_core-18.2.13-py3.5.egg/mycroft/util/format.py", line 276, in pronounce_number
    scientific=scientific)
  File "/usr/local/lib/python3.5/dist-packages/mycroft_core-18.2.13-py3.5.egg/mycroft/util/lang/format_en.py", line 300, in pronounce_number_en
    print('Exception in pronounce_number_en' + e)
TypeError: Can't convert 'ValueError' object to str implicitly

Replicated under 18.2.13 on Ubuntu 18.04 running stable branch from master


02:21:43.495 - SKILLS - DEBUG - {"type": "mycroft.skill.handler.start", "data": {"name": "TimerSkill.handle_start_timer"}, "context": {}}
02:21:43.496 - mycroft.skills.core:wrapper:655 - ERROR - An error occurred while processing a request in Timer Skill
Traceback (most recent call last):
  File "/home/kathyreid/mycroft-core/mycroft/util/lang/format_en.py", line 292, in pronounce_number_en
    last = number_names[int(_num[2:4])]
ValueError: invalid literal for int() with base 10: '.0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kathyreid/mycroft-core/mycroft/skills/core.py", line 646, in wrapper
    handler(message)
  File "/opt/mycroft/skills/mycroft-timer.mycroftai/__init__.py", line 171, in handle_start_timer
    timer_name = nice_duration(self, secs, lang=self.lang)
  File "/opt/mycroft/skills/mycroft-timer.mycroftai/__init__.py", line 697, in nice_duration
    out += pronounce_number(minutes, lang) + " " + self.translate(
  File "/home/kathyreid/mycroft-core/mycroft/util/format.py", line 276, in pronounce_number
    scientific=scientific)
  File "/home/kathyreid/mycroft-core/mycroft/util/lang/format_en.py", line 300, in pronounce_number_en
    print('Exception in pronounce_number_en' + e)
TypeError: must be str, not ValueError
02:21:43.497 - SKILLS - DEBUG - {"type": "speak", "data": {"utterance": "An error occurred while processing a request in Timer Skill", "expect_response": false}, "context": {}}

Bug confirmed, flagging internally

I tried adding a cast to float() before int() on lines 290 and 292 but this led to
I'm setting a timer for ten zero minutes - ie. it appended the 'zero` word.

Is this still an issue on the 18.08 branches? It seems to be working for me

Yeah, ideally I wouldn't ever have a regression, but going back to fix bugs when an upcoming release (in 48 hours) takes care of it could consume all our time.

We are still working on the testing frameworks. This got broken by a change on mycroft-core, not a change in the skill itself. This really is a complex ecosystem, but we are getting the test bits in place to catch more and more to catch things like this.

No worries at all, I don't feel too raked over the coals. ;-)

There is a reason we are still calling this "beta". Even stable is still in flux. We are racing to get things in shape to really be in shape for the general consumer with the 19.02 release -- which sounds like a long time, but there is a lot to be done.

One of the paradoxes of software development is that I can iterate rapidly on my own, but the moment you have a user base to support you suddenly have to think about upgrade paths, etc. And with Mycroft we are also adding in more complexity due to the skill system which pulls in the work of others -- I can't make a change and go in to change their stuff too, so I am restricted in what changes I can make.

Not complaining or justifying, it is just the way it is. I actually enjoy this kind of challenge 99% of the time.