luvit/luvit

"EACCES: permission denied" while installing on any non-root account, even through sudo.

Opened this issue · 5 comments

Hello,
today I tried installing Luvit on a non-root account through sudo, but I saw this:

lit version: 3.8.5
luvi version: v2.14.0
command: make lit.zip lit luvi
load config: /home/username/.litconfig
fail: [string "bundle:deps/git/db.lua"]:176: EACCES: permission denied: /root/.litdb.git/objects
stack traceback:
        [C]: in function 'assert'
        [string "bundle:deps/git/db.lua"]:176: in function 'gitMount'
        [string "bundle:libs/db.lua"]:68: in function 'makeDb'
        [string "bundle:libs/core.lua"]:102: in function 'makeCore'
        [string "bundle:libs/core.lua"]:96: in function <[string "bundle:libs/core.lua"]:93>
        [string "bundle:commands/make.lua"]:2: in function <[string "bundle:commands/make.lua"]:1>
        [string "bundle:main.lua"]:69: in function <[string "bundle:main.lua"]:56>
        [C]: in function 'xpcall'
        [string "bundle:main.lua"]:56: in function <[string "bundle:main.lua"]:48>

The script doesn't seem to check for proper permissions while it works, it doesn't try to sudo in this case (for using sudo), and that results in this error. Manually executing commands from Luvit's get-lit.sh with sudo prefix is a workaround for this issue.

I don't get it. Why are you installing it with root permissions if it is not being installed on the root account? You wouldn't need sudo if it is not root.

I don't get it. Why are you installing it with root permissions if it is not being installed on the root account? You wouldn't need sudo if it is not root.

The thing is, I can't install without using sudo too.

username:~/test# curl -L https://github.com/luvit/lit/raw/master/get-lit.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   610  100   610    0     0    844      0 --:--:-- --:--:-- --:--:--  2961
Downloading https://github.com/luvit/luvi/releases/download/v2.14.0/luvi-regular-Linux_x86_64 to luvi
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 5174k  100 5174k    0     0  4393k      0  0:00:01  0:00:01 --:--:-- 12.6M
Downloading https://lit.luvit.io/packages/luvit/lit/v3.8.5.zip to lit.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  226k  100  226k    0     0   228k      0 --:--:-- --:--:-- --:--:--  228k
lit version: 3.8.5
luvi version: v2.14.0
command: make lit.zip lit luvi
load config: /home/username/.litconfig
fail: [string "bundle:deps/git/db.lua"]:176: EACCES: permission denied: /root/.litdb.git/objects
stack traceback:
        [C]: in function 'assert'
        [string "bundle:deps/git/db.lua"]:176: in function 'gitMount'
        [string "bundle:libs/db.lua"]:68: in function 'makeDb'
        [string "bundle:libs/core.lua"]:102: in function 'makeCore'
        [string "bundle:libs/core.lua"]:96: in function <[string "bundle:libs/core.lua"]:93>
        [string "bundle:commands/make.lua"]:2: in function <[string "bundle:commands/make.lua"]:1>
        [string "bundle:main.lua"]:69: in function <[string "bundle:main.lua"]:56>
        [C]: in function 'xpcall'
        [string "bundle:main.lua"]:56: in function <[string "bundle:main.lua"]:48>

what does your /home/username/.litconfig look like? do cat /home/username/.litconfig and post the results.

defaultUpstream: wss://lit.luvit.io/
database: /root/.litdb.git
upstream: wss://lit.luvit.io/

Okay, now I understand. It may've been that I moved files from root to this user and the database field stayed the same, in the old, root directory.

Your .litconfig is invalid. The path it points to for the database is under the root user, while you are not a root. You should either delete the .litconfig so it creates a proper default one, or manually change the database path to something sane.