Action-xxx.py not executable and config.ini not writable after install with SAM


#1

Hi community

Just a noob question. I’m about to program the first app for Snips. After looking trough a lot of documentation and forum posts I’m still struggling with this issue:

  • I’m installing my assistant with SAM on my PC (Snips is on a Raspberry Pi 3+)
  • Everything seems fine - Skill files are downloaded and installed from GitHub
  • SAM writes out an “permission denied” error (I believe because it tries to write the initial config.ini)

After re-starting all the snips services the following happens

  • hotword is detected fine
  • intent is catched and understood
  • Snips tries to run the action-xxx.py file but cannot because it is not executable

After logging in to the Pi directly and change the permissions off my *.py files in ‘var/lib/skills/snips-app-myapp’ everything works as expected.

Should’nt SAM take care of the permissions while installing the skills?
Do I have to configure something in my Git Repository?

Any hints are welcome.


#2

Hello @cellerich,

There is no noob question, we are here to help :slight_smile: You did everything right and yes, the action-xxx.py file needs to be set as an exectuable file on Github.

To fix the issue, change the permission on the file and commit to Github. Github will keep this setting when the skill is cloned on the Pi and you won’t need to change it manually each time.

The reason why SAM doesn’t do this on it’s own, in short, is to prevent introducing changes that could make the skill non-updatable on the Pi.

Longer explanation: If SAM changes the file permission, it will be seen as a modification by Git. The skill is cloned, if you update your assistant, the skill won’t be erased but rather pulled again from the repo. Thus if you want to update your skill through Sam, Sam won’t be able to git pull because of this modification. And we don’t want to enforce anything, either by deleting the modification or force pushing it on git: it could result in a non-working skill or a unwanted side effect.

Cheers,


#3

Hi Charles

Thanks a lot for the detailed answer! Makes sense.

Here comes a follow-up question:

  • I’m developing on a windows box and in the file system I dont have the same permission levels as I have on the Raspi. How do I make those little buggers executable?
  • I believe same goes with the setup.sh file, which needs to be executable as well.

Another thing I found out yesterday after almost 4h of debugging: setup.sh and all the *.py files need a simple LF at the end of the lines. I’m working with VS-Code and the default for .py files seems a CRLF ending.

Thanks for the help! Will write up my findings in a blog post once I finish my first Snip-App/Skill (what is the right term btw?)


#4

Never mind, found it after a bit looking trough our favorite search engine:

I installed Git Bash on my Windows machine.
Leave it here as reference!


#5

Good find @cellerich! The right term is a Snips app that got actions. I’m still using the word skills as it was used for a long time at Snips and it got changed recently.

Happy coding!