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

Module install error #313

Open
licaon-kter opened this issue Dec 1, 2022 · 5 comments
Open

Module install error #313

licaon-kter opened this issue Dec 1, 2022 · 5 comments

Comments

@licaon-kter
Copy link
Contributor

licaon-kter commented Dec 1, 2022

$ sudo ejabberdctl module_install mod_cron
Error: error
Error: not_available

Umm then how?

ejabberd HEAD (processone/ejabberd@be60263), Debian Bullseye, arm64, Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 13.1.2

@licaon-kter licaon-kter changed the title Install error Module install error Dec 1, 2022
@badlop
Copy link
Member

badlop commented Dec 1, 2022

Is it listed in modules_available? Do other modules install correctly, or all fail?

$ ejabberdctl module_install mod_cron
Error: error
Error: not_available

$ ejabberdctl modules_available

$ ejabberdctl modules_update_specs

$ ejabberdctl modules_available
mod_cron        Execute scheduled commands
...

$ ejabberdctl module_install mod_cron
Module mod_cron has been installed and started.
It's configured in the file:
  /home/vscode/.ejabberd-modules/mod_cron/conf/mod_cron.yml
Configure the module in that file, or remove it
and configure in your main ejabberd.yml

@licaon-kter
Copy link
Contributor Author

Ok, indeed I missed those two commands.

Available comes up empty, as expected I guess.

But

$ sudo ejabberdctl modules_update_specs
Error: {repository,"https://github.com/processone/ejabberd-contrib",
                   {error,enoent}}

@badlop
Copy link
Member

badlop commented Dec 2, 2022

The default configuration in most cases results in something like this:

$ make relive
...

> ext_mod:modules_dir().
"/home/badlop/.ejabberd-modules"

I try to reproduce the error message you get:

$ sudo mkdir /tmp/onlyroot

$ CONTRIB_MODULES_PATH=/tmp/onlyroot make relive
...

> ext_mod:modules_dir().
"/tmp/onlyroot"

> ext_mod:update().
2022-12-02 16:46:26.767934+01:00 [info] Update packages from repo https://github.com/processone/ejabberd-contrib:
 {error, eacces}
 {repository,"https://github.com/processone/ejabberd-contrib",
            {error,eacces}}

The error messages mean:

eacces:
Missing search or write permissions for the parent directories of Dir.

enoent:
The directory does not exist.

It seems the problem in your case is that the parent dir doesn't exist. So I try setting a path with a parent that doesn't exist... and ext_mod succeeds in creating the parent one correctly:

$ CONTRIB_MODULES_PATH=/tmp/abcdefg make relive
...

> ext_mod:modules_dir().
"/tmp/abcdefg"

> ext_mod:update().
2022-12-02 16:51:57.891321+01:00 [info] Update packages from repo https://github.com/processone/ejabberd-contrib: ok
ok

Some ideas for you to check:

  • What's the result of ext_mod:modules_dir() in your case?
  • Does ejabberd have write access to that path?
  • Can you try setting other values to CONTRIB_MODULES_PATH?

@licaon-kter
Copy link
Contributor Author

(ejabberd@localhost)1> ext_mod:modules_dir().
"/var/lib/ejabberd/.ejabberd-modules"

I've checked that path before writing

$ sudo -u ejabberd stat /var/lib/ejabberd/
Access: (0750/drwxr-x---)  Uid: ( 1001/ejabberd)   Gid: ( 1001/ejabberd)

Let's create the folder just in case

$ sudo -u ejabberd mkdir /var/lib/ejabberd/.ejabberd-modules
$ sudo -u ejabberd stat /var/lib/ejabberd/.ejabberd-modules
Access: (0755/drwxr-xr-x)  Uid: ( 1001/ejabberd)   Gid: ( 1001/ejabberd)

Progress, error changed a bit

$ sudo -u ejabberd ejabberdctl modules_update_specs
Error: {repository,"https://github.com/processone/ejabberd-contrib",
                   {error,erofs}}

@badlop
Copy link
Member

badlop commented Dec 12, 2022

erofs - Read-only file system

I couldn't reproduce that exact error, I guess I didn't yet reproduce your exact case

(ejabberd@localhost)3> file:make_dir("/tmp/asd").
ok
(ejabberd@localhost)4> file:make_dir("/asd").    
{error,eacces}
(ejabberd@localhost)5> file:make_dir("/bin/asd").
{error,eacces}
(ejabberd@localhost)8> file:make_dir("/bin/").   
{error,eexist}

Anyway, can you try setting other values to CONTRIB_MODULES_PATH? You can set that option in ejabberdctl.cfg.

Set for example to /tmp, does then work? In that case, what username and permissions does the created path have? If you reproduce those permissions in the initial path, does then the command work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants