snipsco / snips-issues

Feel free to share your bugs with us.
14 stars 5 forks source link

Issue with write permission on Raspi #135

Closed andreasdominik closed 5 years ago

andreasdominik commented 5 years ago

Hi Snips developers.

First of all, I must say that snips is a great piece of software! I'd like to say: this is what an home-assistant should be. Only downside: the constrictor snake! For something quick-n-dirty, Python is a good thing (we even teach it to our students). But for serious software it's just a pain!

Therefore I tried to build just for me a (also) VERY quick-and-dirty framework for Julia - which is a real programming language - with some disadvantages that makes it somehow clumsy to write Snips skills. But I'll try (attempto! was the motto of my University). With the QnD framework it takes only 10 Minutes or so to write a skill, so I try different things (btw: there is a -work in progress- documentation: https://andreasdominik.github.io/ADoSnipsTemplate/dev/index.html)

Now I run in a (maybe or not Python)-Issue: I want to get events from my Google-calendar and use a Python script to download a JSON file. Google provides the Python API; this must refresh the access token every hour or so. When python tries to write the file, I get:

IOError: [Errno 30] Read-only file system: '/opt/Snips/ApplicationData/ADoSnipsCalendar/Credentials/token.pickle'

The directory permission is 666:

drwxrwxrwx 2 pi            pi 4096 Mai 11 14:02 .
drwxrwxrwx 3 pi            pi 4096 Mai  6 16:30 ..
-rw-rw-rw- 1 _snips-skills pi  753 Mai 10 14:07 token.pickle

The part of the syslog is appended: snips-issue.log

Although I am pretty experienced with linux, I have no idea what may hinder Python to write the file (token.pickle must be overridden). When I run the action-... as user pi, everything works like charm!

The project is on Github: https://github.com/andreasdominik/ADoSnipsCalendar (if you want to see the sources).

Of course, I ran into strange issues all the time with Julia+Snips (no surprise, and only myself to blame ;) but this is somehow different and I have no idea ....

I hope you can help me! Of course, I still did not give up the plan to publish all the stuff and find more users of my apps^^

Cordially Andreas

PS.: I double-checked may times, if the path is correct!

cpoisson commented 5 years ago

Hi @andreasdominik,

Thanks for your feedbacks!

Everything seems ok with the file ownership policy.

I have re tested your pattern, works for me.

I may be wrong, but looking at your description it seems that the volume you are trying to write on is not writable.

What is the output of the mount command?

andreasdominik commented 5 years ago

Thank you very much for your help - it helps to know, that there is no Python-magick behind, that I am not aware of^^ Actually, I did no research on this in the meantime; instead I spent a night to redesign the framework (I recognised, that the footprint of Julia is too fat, making it impossible to run more than 5 or so Julia instances in parallel on a Pi). I will continue testing the Calendar-thing, when I manage to squeeze all apps into a single Julia process (would remove many issues with Julia and Snips, but still all the management with the console must work). Again thank you very much for looking into it from your side.

Maybe I just made too many dirty things with the Pi in the last weeks. I'll try to set it up from scratch (checking mount is anyway a good idea - however it's the normal file system on the SD-card). Cordially Andreas

cpoisson commented 5 years ago

No problems 👍

Yes indeed, the Pi 3 is a bit limited and frameworks are getting heavier and heavier.

the platform can also be seen as a distributed systems, meaning that it is possible to distribute things on more platforms if one is too limited (two Pi Boards instead of one for example)

You can have:

I'm closing this ticket now but do not hesitate to share your experience with the community on the forum!

Thanks again for your feedbacks.