"msm update" full of "permission denied"

On an up-to-date (apt update / apt full-upgrade) Mark 1, lots, but not all, skills are “permission denied”… and an inability to lock a .git/config at the start of it alll:

$ sudo msm update
WARNING - Failed to update repo: GitException(Git command failed: GitCommandError(['git', 'config', 'remote.origin.url', 'https://github.com/MycroftAI/mycroft-skills'], 255, b'error: could not lock config file .git/config: Permission denied', b''))
ERROR - Error running update_skill on mycroft-stop: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-stop\n ! e9f01e8..9bfc249  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-support-helper: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-support\n ! e497b70..5919493  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-wiki: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-wiki\n ! 16bc57c..9894835  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-version-checker: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
ERROR - Error running update_skill on mycroft-reminder: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-reminder\n ! e819948..7623a2e  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-volume: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-volume\n ! a76f94b..d14142c  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-audio-record: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-audio-record\n ! fe59be8..9479337  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on fallback-aiml: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
ERROR - Error running update_skill on mycroft-npr-news: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-npr-news\n ! c256291..688c9e4  18.02      -> origin/18.02  (unable to update local ref)', b''))
INFO - Nothing new for skill-wolfram-alpha
ERROR - Error running update_skill on mycroft-mark-1: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
INFO - Nothing new for mycroft-speak
ERROR - Error running update_skill on mycroft-date-time: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-date-time\n ! 3aa3432..2db18ef  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-configuration: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
ERROR - Error running update_skill on mycroft-installer: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
ERROR - Error running update_skill on mycroft-spelling: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-spelling\n ! af77319..9a50d41  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-naptime: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-naptime\n ! e81ffdd..a294e41  18.02      -> origin/18.02  (unable to update local ref)', b''))
ERROR - Error running update_skill on mycroft-stock: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-stock\n ! 751e075..0be3769  18.02      -> origin/18.02  (unable to update local ref)', b''))
INFO - Nothing new for skill-media
ERROR - Error running update_skill on mycroft-fallback-duck-duck-go: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
ERROR - Error running update_skill on mycroft-spotify: GitException(Git command failed: GitCommandError(['git', 'fetch'], 128, b'error: insufficient permission for adding an object to repository database .git/objects\nfatal: failed to write object\nfatal: unpack-objects failed', b''))
INFO - Nothing new for mycroft-playback-control
INFO - Nothing new for mycroft-timer
INFO - Nothing new for mycroft-joke
ERROR - Error running update_skill on mycroft-alarm: GitException(Git command failed: GitCommandError(['git', 'fetch'], 1, b'error: Unable to append to .git/logs/refs/remotes/origin/18.02: Permission denied\nFrom https://github.com/MycroftAI/skill-alarm\n ! 16e717d..48b9f65  18.02      -> origin/18.02  (unable to update local ref)', b''))
INFO - Nothing new for mycroft-singing
INFO - Nothing new for mycroft-mark-1-demo
INFO - Nothing new for skill-desktop-launcher
INFO - Nothing new for mycroft-ip
INFO - Nothing new for mycroft-pairing
INFO - Nothing new for mycroft-weather
INFO - Nothing new for fallback-wolfram-alpha
INFO - Nothing new for fallback-unknown
INFO - Nothing new for pandora-skill
INFO - Nothing new for mycroft-hello-world
INFO - Nothing new for mycroft-personal

I think you need to run this as sudo?

You shouldn’t run it sudo’d. Looks like that might have been the case at some point previously, and now it no longer has permissions to update as the mycroft user.

I think @baconator is correct. @ubuntourist - are you able to provide an ls -las of /opt/mycrof/skills so we can see filesystem permissions?

Best, Kathy

Everything at the top level is owned by user “mycroft” and has reasonable permissions. However… see the bottom of this message.

total 152
4 drwxrwxrwx 38 mycroft mycroft 4096 Jun 14 18:38 .
4 drwxr-xr-x  6 mycroft mycroft 4096 Jun 14 18:37 ..
4 drwxr-xr-x  5 mycroft mycroft 4096 May 31 14:05 fallback-aiml
4 drwxr-xr-x  4 mycroft mycroft 4096 May 31 14:05 fallback-duckduckgo
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 fallback-unknown
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 14:05 fallback-wolfram-alpha
0 -rw-r--r--  1 mycroft mycroft    0 Jun 15 16:58 .msm
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 mycroft-mark-1
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 mycroft-timer
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 pianobar-skill
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-alarm
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-audio-record
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-configuration
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 14:05 skill-date-time
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-desktop-launcher
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-hello-world
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-installer
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-ip
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 skill-joke
4 drwxr-xr-x  4 mycroft mycroft 4096 May 31 14:05 skill-mark1-demo
4 drwxr-xr-x  4 mycroft mycroft 4096 Aug  1  2017 skill-media
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-naptime
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-npr-news
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 13:59 skill-pairing
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-personal
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 skill-playback-control
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-reminder
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-singing
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-speak
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-spelling
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 14:05 skill-stock
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 skill-stop
4 drwxr-xr-x  7 mycroft mycroft 4096 May 31 14:05 skill-support
4 drwxr-xr-x  6 mycroft mycroft 4096 May 31 14:05 skill-version-checker
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 13:59 skill-volume
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 14:05 skill-weather
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 14:05 skill-wiki
4 drwxr-xr-x  5 mycroft mycroft 4096 Jan  2 23:08 skill-wolfram-alpha
4 drwxr-xr-x  8 mycroft mycroft 4096 May 31 14:05 spotify-skill

Drilling further down with ls -AlR /opt/mycroft/skills shows some files owned by root, deep in the bowels of various /.git/ directories…

Since we have two votes for “Don’t use sudo”, I’ve set the ownership of everything in the tree to mycroft and will see where that leads me.

2 Likes

That (the change of ownership) vastly improved things. I’m now down to a single error:

$ msm update
WARNING - Failed to update repo: GitException(Git command failed: GitCommandError(['git', 'config', 'remote.origin.url', 'https://github.com/MycroftAI/mycroft-skills'], 255, b'error: could not lock config file .git/config: Permission denied', b''))

followed by a bunch of INFO lines telling me most stuff is up-to-date with nothing new. (fallback-aiml had an update – a new requirements.txt file – that updated without incident.)

Mayhaps the ownership of /opt/mycroft/.skills-repo is off?

How much of /opt/mycroft should mycroft own?

1 Like

Mycroft should own all of it.

This should really be in the post about the effect ai will have on society.

4 Likes

How do I fix this? I can use msm install, but then am denied. So I try sudo msm but then it says command not found when adding sudo

Hey Sean,

Can you check the file permissions on your Skills directory at: /opt/mycroft/skills

These need to be writable by the user running Mycroft. To change the permissions of all files in a directory and it’s subdirectory you can use chown with the -R flag, eg:

chown -R user:group /opt/mycroft/skills