Mycroft Community Forum

Skill failing to load upon installation

Hey all!

Been beating my head against this wall almost all night, and I’m pretty sure it’s a really simple problem I’m just not seeing. I wrote a skill to interact with a Nextcloud calendar caldav server. I got it “successfully” installed on my Picroft with

(.venv) pi@picroft:~ $ mycroft-msm install https://github.com/markditsworth/mycroft-nextcloud-calendar.git
INFO - building SkillEntry objects for all skills
INFO - Downloading skill: https://github.com/markditsworth/mycroft-nextcloud-calendar
INFO - Installing system requirements...
INFO - Installing requirements.txt for mycroft-nextcloud-calendar
INFO - Successfully installed mycroft-nextcloud-calendar
INFO - invalidating skills cache

However, after a while, my skills on home.mycroft.ai/skills had not updated to include the skill and sure enough, in /var/log/mycroft/skills.log we have

2021-01-05 05:59:17.176 | INFO     |  1635 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-nextcloud-calendar.markditsworth
2021-01-05 05:59:17.188 | INFO     |  1635 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-nextcloud-calendar.markditsworth/settings.json
2021-01-05 05:59:17.259 | ERROR    |  1635 | mycroft.skills.skill_loader:_communicate_load_status:327 | Skill mycroft-nextcloud-calendar.markditsworth failed to load

I’ve seen one other post here that seemed relevant, and that problem ended up being the create_skill() function accidentailly being part of the skill class, and that is not a problem in my code. My settingsmeta.json looks fine to me. In fact my entire skill repository was copied/modified from another skill repository that I already have working. So between that and the fact that the skill isn’t failing to install, it’s got to be some small mistake that I just can’t seem to find. If anyone can take a look to see if they see what’s wrong it’d be much appreciated!

Thanks in advance!

Figured it out. For some reason, uninstalling it and reinstalling it for a 5th or 6th time gave me this error output in the skill.log file:

2021-01-06 05:18:12.618 | ERROR    |   691 | mycroft.skills.skill_loader:_create_skill_instance:289 | Skill initialization failed with error('unknown extension ?<O at position 9')
Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/skills/skill_loader.py", line 278, in _create_skill_instance
    self.instance.load_data_files()
  File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1180, in load_data_files
    self.load_regex_files(root_directory)
  File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1217, in load_regex_files
    regexes = load_regex(regex_dir, self.skill_id)
  File "/home/pi/mycroft-core/mycroft/skills/skill_data.py", line 107, in load_regex
    regexes += load_regex_from_file(join(path, f), skill_id)
  File "/home/pi/mycroft-core/mycroft/skills/skill_data.py", line 68, in load_regex_from_file
    re.compile(regex)
  File "/usr/lib/python3.7/re.py", line 234, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "/usr/lib/python3.7/sre_parse.py", line 731, in _parse
    len(char) + 2)

I had left out the P needed in the name capturing group. Instead of (?P<Owner>.*) I had (?<Owner>.*) in a few lines. Corrected that, and now it looks like the skill is installed just fine! (Jury is still out on how flawless this skill works for the moment).

3 Likes

Hey welcome to Mycroft!

Glad you worked it out and excited to see the Skill when it’s ready to share :slight_smile:

1 Like