Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | Mycroft: Skills folder created with incorrect permissons #3905

Closed
Joulinar opened this issue Nov 9, 2020 · 15 comments · Fixed by #3916
Closed

DietPi-Software | Mycroft: Skills folder created with incorrect permissons #3905

Joulinar opened this issue Nov 9, 2020 · 15 comments · Fixed by #3916
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@Joulinar
Copy link
Collaborator

Joulinar commented Nov 9, 2020

@MichaIng
before creating a PR, just like to check with you. There was an issue reported on incorrect permissions for skills folder inside /mnt/dietpi_userdata/mycroft-data. The directory is created by installation script dev_setup.sh and usually it should change permission according the script.

    if [[ ! -d /opt/mycroft/skills ]] ; then
        echo 'This script will create that folder for you.  This requires sudo'
        echo 'permission and might ask you for a password...'
        setup_user=$USER
        setup_group=$(id -gn $USER)
        $SUDO mkdir -p /opt/mycroft/skills
        $SUDO chown -R ${setup_user}:${setup_group} /opt/mycroft
        echo 'Created!'

However it's not gonna do that and directory belongs to root still. Probably setup_user=$USER is not detected correctly.

Basically we would have following options

  1. adjust dietpi-software and change owner after execution of dev_setup.sh
  2. create skills our self before changing folder permissions
  3. adjust dev_setup.sh to change user correctly?

I could create RP if you prefer option 1 or 2.

Related forum post: https://dietpi.com/phpbb/viewtopic.php?f=11&t=8252

EDIT: probably easiest to change

mkdir -p /mnt/dietpi_userdata/mycroft-data

into
mkdir -p /mnt/dietpi_userdata/mycroft-data/skills

@MichaIng
Copy link
Owner

That is strange indeed, let me try to debug. In case it is easiest to re-set mycroft:mycroft owner recursively on all dirs: core, data, log

@Joulinar
Copy link
Collaborator Author

Joulinar commented Nov 10, 2020

We already create mycroft-data ourselves, let's add skills and we are done

mkdir -p /mnt/dietpi_userdata/mycroft-data/skills

@MichaIng
Copy link
Owner

Jep indeed, that'll do it. However, still good to understand what's going wrong with dev_setup.sh as this might produce other issues, if not now then in the future.

@Joulinar
Copy link
Collaborator Author

Joulinar commented Nov 10, 2020

probably it might be related to sudo. We call dev_setup.sh as user mycroft

sudo -u mycroft ./dev_setup.sh -sm

However the directory skills is created as user root. 🤔
Therefore I guess following returns root as well

setup_user=$USER
setup_group=$(id -gn $USER)

and permissions are not changed
$SUDO chown -R ${setup_user}:${setup_group} /opt/mycroft

Or, it's due to the sym link we created to point to dietpi user data?? 🤔

@MichaIng
Copy link
Owner

I was thinking the same first, but that works:

2020-11-10 21:24:02 root@dietpi:~# sudo -u www-data bash -c 'echo $USER'
www-data

@MichaIng
Copy link
Owner

Found it:

$SUDO chown -R ${setup_user}:${setup_group} /opt/mycroft

chown does not follow symlinks, so the above sets the permissions for the /opt/mycroft symlink only, but not for the contained skills directory 😄.

2020-11-12 15:48:18 root@VM-Buster:/mnt/dietpi_userdata/mycroft-core# ls -l /opt
total 0
lrwxrwxrwx 1 mycroft mycroft 33 Nov 12 14:59 mycroft -> /mnt/dietpi_userdata/mycroft-data

It is intended to be a regular directory, so this is not an issue with the Mycroft installer. Pre-creating the directory makes that code block being skipped, which is indeed the cleanest solution.

@Ernstian
Copy link

Ernstian commented Dec 5, 2020

On dev branch:

[ INFO ] DietPi-Software | sudo -u mycroft ./dev_setup.sh -sm, please wait...
sudo: ./dev_setup.sh: command not found
[FAILED] DietPi-Software | sudo -u mycroft ./dev_setup.sh -sm

Setting

root@DietPi:/mnt/dietpi_userdata/mycroft-core# chmod +rx dev_setup.sh

let me continue with the installation.

Besides that, I got it to understand my "Hey Jarvis" as a wakeword once (in about 1 hour of testing), so this probably works.

@MichaIng
Copy link
Owner

MichaIng commented Dec 5, 2020

Besides that, I got it to understand my "Hey Jarvis" as a wakeword once (in about 1 hour of testing), so this probably works.

Lol, I never hot "Hey Mycroft" to work, "Hey Jarvis" not well (probably one of two times, better after some attempts), "Hey Ezra" almost great and "Christopher" by far best. Not sure if the microphone plays a role as well, or if it needs to learn your voice for a while (not sure if it actually learns it or STT is done a static way). I'll fix the permissions issue.


Strange, did you face the missing execute permissions on a fresh install? Since 775 (world read+execute) is what the file has by default 🤔.

@Ernstian
Copy link

Ernstian commented Dec 5, 2020

Ezra didn't work at all (or maybe it did, but with a similar success rate as Jarvis), and I didn't try Christopher (my name is too similiar, and I don't want it to react if I get called :D ) I got it to work it with Jarvis a few more times, but so far, it's not really usable for me. It also always falls back to Pocket Sphinx, because no model for Precise gets found.

Strange, did you face the missing execute permissions on a fresh install?

If uninstalling via Dietpi and reinstalling it (after updating to the dev branch) counts as fresh, it's fresh. I didn't touch any files there myself.

@ravenclaw900
Copy link
Collaborator

I got "Hey Mycroft" to work most of the time, but it never responds to me. I know the sound works, because I get the beep when it hears the wake word. Looking at the CLI, it hears me and responds with text, but that's it.

@MichaIng
Copy link
Owner

MichaIng commented Dec 5, 2020

Interesting how different the experiences are. Pocket Sphinx fallback btw is expected in all cases but "Hey Mycroft", AFAIK.

I got "Hey Mycroft" to work most of the time, but it never responds to me.

You did not install Mimic, did you? I needed to learn that the default British Male voice it the local Mimic instance, there is no online version of it. The other two voices, American Male and Google Voice are online voices which should work OOTB. Check out the docs about how to install local Mimic: https://dietpi.com/docs/software/hardware_projects/#mycroft-ai

@ravenclaw900
Copy link
Collaborator

I used American Male, but I'll try Mimic anyway.

@MichaIng
Copy link
Owner

MichaIng commented Dec 5, 2020

Okay, if American Male fails, then probably the /var/log/mycroft/audio.log will give a hint, or voice.log, I always mix up those two 😄.

@ravenclaw900
Copy link
Collaborator

ravenclaw900 commented Dec 6, 2020

After reinstalling, the audio is working some of the time, and to be honest, this is probably the configuration of my VM messing it up. Don't know why it wasn't working before. Though I am getting errors when I try to use Google Voice, along the lines of GoogleTTS server could not be verified. Please check your internet connection in audio.log.

@MichaIng
Copy link
Owner

MichaIng commented Dec 6, 2020

Seems to be an external issue with GoogleTTS:

Looks like next Home Assistant update will have it fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants