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

Ejabberd SQLite3: "Error loading sqlite3_drv: cannot open shared object file: No such file or directory" #2592

Closed
vanitasvitae opened this issue Sep 1, 2018 · 8 comments

Comments

@vanitasvitae
Copy link

What version of ejabberd are you using?

18.06-1~bpo9+1

What operating system (version) are you using?

Raspbian Stretch

How did you install ejabberd (source, package, distribution)?

from the stretch-backports repository

What did not work as expected? Are there error messages in the log? What
was the unexpected behavior? What was the expected result?

I changed my ejabberd config to use sqlite3 as database backend, but it appears to crash on startup.
I already installed erlang-sqlite3 and erlang-p1-sqlite3, but it is still crashing.

2018-09-01 16:34:19 =CRASH REPORT====
  crasher:
    initial call: sqlite3:init/1
    pid: <0.501.0>
    registered_name: []
    exception exit: {"Error loading sqlite3_drv: cannot open shared object file: No such file or directory",[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,344}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
    ancestors: [<0.417.0>,'ejabberd_sql_sup_jabberhead.tk',ejabberd_rdbms,ejabberd_sup,<0.62.0>]
    messages: []
    links: [<0.417.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 441
  neighbours:
@zinid
Copy link
Contributor

zinid commented Sep 1, 2018

Looks like a packaging issue to me.
@debalance can you please take a look?

@debalance
Copy link

@vanitasvitae did you make sure that erlang-p1-sqlite3 from stretch-backports is installed?
That's version 1.1.6-2~bpo9+1.

@debalance
Copy link

I quickly tested a clean Debian Stretch with ejabberd+erlang-p1-libs from Stretch-Backports and the following changes to default config:

@@ -291,7 +291,7 @@ auth_password_format: scram
 ## Authentication using SQL
 ## Remember to setup a database in the next section.
 ##
-## auth_method: sql
+auth_method: sql
 
 ##
 ## Authentication using PAM
@@ -393,8 +393,8 @@ auth_password_format: scram
 ##
 ## SQLite:
 ##
-## sql_type: sqlite
-## sql_database: "/path/to/database.db"
+sql_type: sqlite
+sql_database: "/var/lib/ejabberd/database.db"

Then I restarted ejabberd and it seems to be working without issues:

root@stretchtest:/var/log/ejabberd# grep sql ejabberd.log 
2018-09-02 08:50:21.193 [info] <0.31.0> Application sqlite3 started on node ejabberd@localhos

So I assume that @vanitasvitae mixed erlang-p1-sqlite3 from Stretch with ejabberd from Stretch-Backports.

@vanitasvitae
Copy link
Author

Hm, I checked bash_history to verify that I used the command sudo apt-get -t stretch-backports install erlang-p1-sqlite3 to install.

@vanitasvitae
Copy link
Author

@zinid Can you give me a hint, how exactly I can migrate from mnesia to sqlite?

@debalance
Copy link

@vanitasvitae maybe you configured the db-file in a place where ejabberd wasn't allowed to create+access it?

@vanitasvitae
Copy link
Author

Possible. However, an upgrade killed my whole system and I'm now in the process to set everything up again. This time it appears to work :)

@badlop badlop closed this as completed Sep 26, 2018
@lock
Copy link

lock bot commented Sep 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants