leon-ai / leon-cli

⌨️ Command-line interface (CLI) for a better use of Leon, your open-source personal assistant. GNU/Linux, macOS and Windows supported.
https://getleon.ai
MIT License
176 stars 21 forks source link

[Bug] Problem with installing Leon in LXC containers #176

Closed 0xT3chN0 closed 2 years ago

0xT3chN0 commented 2 years ago

Specs

root@LeonAI:/home/leon/leon# leon check

✔ Checking that the setup went well

leon@1.0.0-beta.5 check babel-node scripts/run-check.js


.: CHECKING :.

[It's just that.]

Expected Behavior

Leon should install dependencies with the new "leon create birth" command.

Actual Behavior

It throws out an error if I try to type "Y" on the CLI screen after I executed the leon create birth command, that asks to install dependencies for leon (see screenshot), but if I type "n" on that screen, it just proceeds and installs Leon. Leon does even start using "leon start" but if I try, for example, to type "hello" in the Web UI, it just says "Sorry, I have an issue with the "Greeting" module of my "Leon" package!". I tested multiple NPM and NodeJS versions, all with the same behaviour.

How Do We Reproduce?

Run Leon with the root user in an LXC Container (Enabled features: keyctl and Nesting)

Extra (like a sample repo to reproduce the issue, etc.)

Screenshot 2022-01-30 153417 Screenshot 2022-01-30 153519 Screenshot 2022-02-02 170028 Screenshot 2022-02-02 172629

theoludwig commented 2 years ago

Hey! :wave: @nicholaskoerfer

Thanks for your report! Indeed it is a bug we will need to investigate and to figure out how to fix it. :+1:

Explanations

To install apt packages, we need to be root. To do so, we use a npm package: sudo-prompt.

This allows to prompt the user with a graphical OS dialog to enter the necessary password to be root.

The problematic keyword here is graphical, I'm not familiar with LXC containers but I don't think you are able to run UI.

Problematic line: https://github.com/leon-ai/leon-cli/blob/9da431c5c692d520d13c742bf3f154ce18808d8f/src/services/Requirements.ts#L84

Solution

We should be able to prompt the user to be root directly in the terminal without UI. That should fix the issue.

Workaround/Investigation

Currently to still be able to install Leon, you need to manually install Python and Pipenv.

We will need your help to investigate so hopefully we can fix the issue.

Could you run manually each line of this script and share with us, the output and errors you encounter: https://github.com/leon-ai/leon-cli/blob/develop/scripts/dependencies/install_apt_packages.sh

Thanks! :smile:

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.4.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: