Asking a more focused question from my recent post about the update – from that post, in response to some errors which prevented skills from loading, KathyReid mentioned:
“The … error is pretty much what it says on the box - msm is trying to update the Skills, but modifications have been made to the Skill it’s trying to update. Can you git commit the changes?”
This seems to be a new feature of the most recent update – it causes me some real problems, so I’m wondering, is there a configuration option to make msm behave as it had before? Either don’t error out when there’s no git repository for a skill, or where there are uncommitted changes – i.e., just load what’s there (preferred) or, don’t try to automatically update skills from github on startup?
My issues are:
- I don’t plan on using github at all (and the MS acquisition sort of re-enforces that)
- When I’m using a source control system for my own projects, I’m not in the habit of committing pre-alpha quality code (unless I’m at work, but I’m not at work, haha).
- I like to try out modifications locally to existing skills that other people created without necessarily ever proposing changes to those skills - especially if my local modification turns out to be bad
- I have at least one skill that I never plan to publish anywhere - an interface to a local home-grown home automation system that would be useless to anyone else (or even to me in a different house, tbh)
Can’t help you with the underlying issue, but just want to mentioned that GIT it self is a protocol. Things like “git commit” are all local and has nothing todo with pushing/releasing any code to remote servers.
So if you changed some files locally, you could easily use;git commit to register your changes on your local git files. Then you could even pull in new remote code if you want and as long as the remote code is not touching the same lines of code, your local changes move along with the remote changes.
to me it would seem like an unnecessary thing to do, but I wouldn’t mind setting up a local git repository if I absolutely had to
But - I don’t see how that would help - msm seems to be looking elsewhere, and I have no idea how it’s deciding what to do, except that it appears to be looking on github for some reason. Again, this appears to be a new thing with the latest update.
Also - I have to ask whether having msm automatically pull from any repository is a good idea. Seems like a nice practice to have that happen for development environments, but most mycrofts are really ‘production’ environments, are they not?
I’m going to flag my colleague @forslund on this one to see if he has some thoughts / suggestions.
Thanks Kathy! Really appreciate it
What exactly are you seeing when it errors out? and which command are you trying?
msm is intended to skip skills that are not a git-repo or has been modified by the user (so it doesn’t overwrite the users modifications)
I have modified and non-git skills in my skills folder and I don’t seem to have any issues. msm logs the failure to update as an error but should keep going anyway.
here’s an example of two local-only skills:
13:24:18.782 - msm.mycroft_skills_manager - ERROR - Error running install_or_update on skill-switch: GitException(Git command failed: GitCommandError([‘git’, ‘rev-parse’, ‘HEAD’], 128, b’fatal: Not a git repository (or any of the parent directories): .git’, b’’))
13:24:18.809 - msm.mycroft_skills_manager - ERROR - Error running install_or_update on skill-feed-reader: GitException(Git command failed: GitCommandError([‘git’, ‘rev-parse’, ‘HEAD’], 128, b’fatal: Not a git repository (or any of the parent directories): .git’, b’’))
and for a stock skill that I had modified locally to make some small changes (I think to add bbc), I get:
13:24:18.930 - msm.mycroft_skills_manager - ERROR - Error running install_or_update on mycroft-npr-news: SkillModified(Uncommitted changes:
I just checked again, and those errors (which came up in mycroft-skills.log on startup, I should have said) aren’t there now. (I had restarted probably at least 10 times over the last few days, and they were completely consistent, but now they’re gone with my last couple of reboots)
Maybe the problem is fixed somehow?
My skills are still not working but now the errors are about missing modules - which is strange because I installed them using pip3 and can run successfully run commandline tests with files which import the modules using python3, even when I’m ‘su’ the mycroft user.
I don’t want to get off topic here, so I’ll start a new thread if I don’t figure out what’s wrong soon. (I noticed this: “As part of this switch we are also migrating from virtualenv to the more lightweight venv. venv was introduced as part of the standard library in Python 3. This offers the same type of features as virtualenv but doesn’t require external dependencies, meaning that it is easier to troubleshoot and support.” - could venv not be loading these modules that I just installed?)
Those error messages you see are expected but shouldn’t be a problem. it is logged as an error but the update procedure should continue. I believe requirements.sh/txt won’t be run for these since they are deemed to be user controlled.
If you install python modules you need to activate the venv first. The user/system python modules will not be available to mycroft
For a git install
in the mycroft-core directory run
source .venv/bin/activate to activate the virtualenv. then you can install python modules using pip.
"When you write “my skills” do you mean the ones you’ve created yourself or the skills on the system?
If the normal skills has problem loading because of missing modules you can try to force a rerun of the requirements installation by running
and then starting mycroft.
awesome - thanks. I will do all that.
Yes, “my” skills are local ones that I wrote
sorry for my confusion, but where would I locate the mycroft-core directory on a Mark 1? I see a few directories named that, but none have a /.venv directory in them.
Sorry I figured this was a git installation for some reason.
On a mark-1 you need to do the following:
then do the pip install.
It’s possible that the following might also work:
sudo /opt/venvs/mycroft-core/bin/pip install MODULE
I did this and it worked - so I’m back in business. Thanks!!!