Problems with mobilizon installation on Ubuntu 22.04

I tried to install a precompiled mobilizon release on Ubuntu 22.04 (i.e. Jellyfish) LTS, but it failed:

chriger@server:/opt/mobilizon$ sudo -u mobilizon ./bin/mobilizon_ctl instance gen --output /etc/mobilizon/config.exs --output-psql /tmp/setup_db.psql
!!! /etc/mobilizon/config.exs not found! Please ensure it exists and that MOBILIZON_CONFIG_PATH is unset or points to an existing file
What domain will your instance use? (e.g mobilizon.org) [] 192.168.0.204
What is the name of your instance? (e.g. Mobilizon) [] Mobilizon
What’s the address email will be send with? [noreply@192.168.0.204] webmaster@gerstenmayer.net
What is the hostname of your database? [localhost] localhost
What is the name of your database? [mobilizon_prod] mobilizon_prod
What is the user used to connect to your database? [mobilizon] mobilizon
12:39:34.434 [error] Unable to load crypto library. Failed with error:
« :load_failed, Failed to load NIF library /opt/mobilizon/lib/crypto-5.0.6/priv/lib/crypto: ‹ libcrypto.so.1.1: cannot open shared object file: No such file or directory › »
OpenSSL might not be installed on this system.

12:39:34.482 [warning] The on_load function for module crypto returned:
{:error,
{:load_failed,
‹ Failed to load NIF library /opt/mobilizon/lib/crypto-5.0.6/priv/lib/crypto: ‹ libcrypto.so.1.1: cannot open shared object file: No such file or directory › ›}}

** (UndefinedFunctionError) function :crypto.strong_rand_bytes/1 is undefined (module :crypto is not available)
:crypto.strong_rand_bytes(64)
(mobilizon 2.1.0) lib/mix/tasks/mobilizon/instance.ex:124: Mix.Tasks.Mobilizon.Instance.run/1
(stdlib 3.17.1) erl_eval.erl:685: :erl_eval.do_apply/6
(elixir 1.13.4) lib/code.ex:404: Code.validated_eval_string/3

Ubuntu Jellyfish is adding OpenSSL 3.0.2 by default on installation. It is located on /usr/lib/ssl.

I also tried to remove OpenSSL 3.0.2 and installed 1.1.1m, but then I get errors when installing postgresql.

Is there a way to install mobilizon with OpenSSL 3.0.2?

Please help.
Kind regards
Christine Gerstenmayer
Computer Cat e.U.

Hi,

Indeed, there’s issues with the openssl version Mobilizon is compiled against and the openssl version on your system really differ.

I had written a few thoughts here a while ago (a similar issue happens when the host system’s openssl version doesn’t have the same features as the one Mobilizon is build against):

However the solution mentionned isn’t really easily doable (would need a lot of toolchain compiling).

Ubuntu 22.04 doesn’t seem to support installing both openssl 3.0 and openssl 1.1 at the same time, so you’re blocked here, apart from building openssl yourself.
Otherwise, the simplest way would be to build Mobilizon from source:
https://docs.joinmobilizon.org/administration/install/source/

We tried to have a look to build specific packages for all the systems we wanted to support for Mobilizon version 2.1, but it’s not really worth it until we can build proper packages (.deb, .rpm, …) instead of just binaries.

Installing Mobilizon through Docker is of course another possibility.

Hi,
Ok, I tried to install from Source, but installation of NodeSource already failed:

Fehl:6 Index of debian jammy Release
** 404 Not Found [IP: 13.32.110.6 80]**
Reading package lists… Done
E: The repository xxxx does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error executing command, exiting
chriger@server:~$

I googled this error message and found that this problem occurred first with Ubuntu 21.04 and still is not solved by erlang-solutions. So install from source also is not possible on Ubuntu 22.04.

But I think there also is an error in release install procedure:

First there is this error message:

!!! /etc/mobilizon/config.exs not found! Please ensure it exists and that MOBILIZON_CONFIG_PATH is unset or points to an existing file

I searched this file over all directories - it is not present.

I found a file name libcrypto.so.1.1. in 2 snap-directories :
chriger@server:/opt/mobilizon/lib$ sudo find / -iname ‹ libcrypto* ›
/snap/core20/1494/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
/snap/core20/1405/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
/usr/lib/x86_64-linux-gnu/libcrypto.so.3

I added one of these directories both to PATH and to environment, but still no success, the same error occurs:
chriger@server:/opt/mobilizon/lib$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
chriger@server:/opt/mobilizon/lib$ export PATH=$PATH:/snap/core20/1494/usr/lib/x86_64-linux-gnu
chriger@server:/opt/mobilizon$ sudo vi /etc/environment
chriger@server:/opt/mobilizon$ source /etc/environment

Finally I will try to install Docker and install your Docker image but I am afraid that there will be problems too.

I will report my results.
Kind regards
Christine

Hi,
I decided to leave Ubuntu installation, it seems that mobilizon is not installable on Ubuntu Jellyfish.
Now I tried to install precompiled version to Debian Bullseye.
Seems to be the better solution, because there is a pre-installed OpenSSL 1.1.1n.
PostgreSQL and Postgis installations were successful without errors.

At migration step I had some errors:
12:40:57.639 [error] Task #PID<0.673.0> started from Mobilizon.Supervisor terminating
** (Postgrex.Error) FEHLER 42P01 (undefined_table) Relation »admin_settings« does not exist

query: SELECT a0."id", a0."group", a0."name", a0."value", a0."inserted_at", a0."updated_at" FROM "admin_settings" AS a0 WHERE ((a0."group" = $1) AND (a0."name" = $2))
(ecto_sql 3.8.1) lib/ecto/adapters/sql.ex:932: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql 3.8.1) lib/ecto/adapters/sql.ex:847: Ecto.Adapters.SQL.execute/6
(ecto 3.8.3) lib/ecto/repo/queryable.ex:221: Ecto.Repo.Queryable.execute/4
(ecto 3.8.3) lib/ecto/repo/queryable.ex:19: Ecto.Repo.Queryable.all/3
(ecto 3.8.3) lib/ecto/repo/queryable.ex:147: Ecto.Repo.Queryable.one/3
(mobilizon 2.1.0) lib/mobilizon/admin/admin.ex:85: Mobilizon.Admin.get_admin_setting_value/3
(mobilizon 2.1.0) lib/web/views/error_view.ex:69: Mobilizon.Web.ErrorView.render/2
(phoenix_view 1.1.2) lib/phoenix/view.ex:475: Phoenix.View.render_to_iodata/3

Function: &Mobilizon.Service.ErrorPage.init/0
Args: []
12:41:02.329 [error] Task #PID<0.671.0> started from Mobilizon.Supervisor terminating
** (Postgrex.Error) FEHLER 42P01 (undefined_table) Relation »actors« does not exist

query: SELECT a0."id", a0."url", a0."outbox_url", a0."inbox_url", a0."following_url", a0."followers_url", a0."shared_inbox_url", a0."members_url", a0."resources_url", a0."posts_url", a0."events_url", a0."todos_url", a0."discussions_url", a0."type", a0."name", a0."domain", a0."summary", a0."preferred_username", a0."keys", a0."manually_approves_followers", a0."openness", a0."visibility", a0."suspended", a0."last_refreshed_at", a0."avatar", a0."banner", a0."user_id", a0."physical_address_id", a0."inserted_at", a0."updated_at" FROM "actors" AS a0 WHERE (a0."url" = $1)
(ecto_sql 3.8.1) lib/ecto/adapters/sql.ex:932: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql 3.8.1) lib/ecto/adapters/sql.ex:847: Ecto.Adapters.SQL.execute/6
(ecto 3.8.3) lib/ecto/repo/queryable.ex:221: Ecto.Repo.Queryable.execute/4
(ecto 3.8.3) lib/ecto/repo/queryable.ex:19: Ecto.Repo.Queryable.all/3
(ecto 3.8.3) lib/ecto/repo/queryable.ex:147: Ecto.Repo.Queryable.one/3
(mobilizon 2.1.0) lib/mobilizon/actors/actors.ex:115: Mobilizon.Actors.get_actor_by_url/2
(mobilizon 2.1.0) lib/mobilizon/actors/actors.ex:979: Mobilizon.Actors.get_or_create_internal_actor/1
(mobilizon 2.1.0) lib/federation/activity_pub/relay.ex:31: Mobilizon.Federation.ActivityPub.Relay.get_actor/0

Function: &Mobilizon.Federation.ActivityPub.Relay.init/0
Args: []

And I got this error when doing this instruction:

sudo journalctl -fu mobilizon.service

ai 26 12:42:35 server mobilizon[10845]: 12:42:35.682 [info] Source for database :city not found: « /var/lib/mobilizon/geo/GeoLite2-City.mmdb »

Mai 26 12:42:35 server mobilizon[10845]: 12:42:35.781 [info] Running Mobilizon.Web.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
Mai 26 12:42:35 server mobilizon[10845]: 12:42:35.805 [info] Access Mobilizon.Web.Endpoint at https://192.168.0.204

I think this will lead to errors with Geo functions!

And the last question:
I am trying this on a server at home with no domain and certificate. I want to call Mobilizon with 192.168.0.xxx:a.
Is it possible to do so? If yes, what do I have to configure in mobilizon.conf?

Pleas help.
Thanks in advance.
Kind regards
Christine

Thanks for reporting these issues !

It seems the server is incorrectly started during migrations. Not an issue, but generates lots of output. Tracking this in the following issue :

Currently this is not being used but it will be in the future, yes. See the docs to install such a database.

It should, yes, if you edit the Mobilizon config file like this:

config :mobilizon, Mobilizon.Web.Endpoint,
  http: [
    port: 8080 # Server will run on this port
  ],
  url: [
    host: "192.168.0.xxx:a",
    port: 8080,
    scheme: "http" # Make sure URLs are generated without https
  ]

If you’re started the server already with previous settings, you need to TRUNCATE the actors table in the database as it may have been populated with internal actors needed for Mobilizon federation to work, but with wrong domain information.