[Solved] Trouble with OTP install: can't generate config.exs

Hi everyone! Thank you for clicking on this post. I am a newbie and am trying to build akkoma instance on Ubuntu 22. I followed official guide and everything is OK until I try to generate the instance config file.

[root@cyou akkoma]# su akkoma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/akkoma/config.exs --output-psql /tmp/setup_db.psql"
!!! Config path is not declared! Please ensure it exists and that AKKOMA_CONFIG_PATH and/or PLEROMA_CONFIG_PATH is unset or points to an existing file
What domain will your instance use? (e.g akkoma.example.com) [] cyou.cc
What is the name of your instance? (e.g. The Corndog Emporium) [cyou.cc]
What is your admin email address? [] cyou@gmail.com
What email address do you want to use for sending email notifications? [cyou@gmail.com]
Do you want search engines to index your site? (y/n) [y] n
Do you want to store the configuration in the database (allows controlling it from admin-fe)? (y/n) [n] y
What is the hostname of your database? [localhost]
What is the name of your database? [akkoma]
What is the user used to connect to your database? [akkoma]

18:47:32.511 [error] Unable to load crypto library. Failed with error:
":load_failed, Failed to load NIF library /opt/akkoma/lib/crypto-5.1.2/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.

18:47:32.533 [warning] The on_load function for module crypto returned:
  'Failed to load NIF library /opt/akkoma/lib/crypto-5.1.2/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)
    (pleroma 3.9.3-0-g9d7c877) lib/mix/tasks/pleroma/instance.ex:118: Mix.Tasks.Pleroma.Instance.run/1
    nofile:1: (file)
    (stdlib 4.2) erl_eval.erl:748: :erl_eval.do_apply/7
    (elixir 1.14.3) lib/code.ex:425: Code.validated_eval_string/3

I made some efforts to fix the glitch:

  • input echo $AKKOMA_CONFIG_PATH and return null
  • apt-get install libssl-dev
  • check access authority of libcryto.so.1.1
[root@cyou akkoma]# ls -l /snap/core20/1974/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
-rw-r--r-- 1 root root 2954080 May 24 17:14 /snap/core20/1974/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1

Anyone know what I’m doing wrong? Please let me know if I need to add any information

with love,

You probably used the wrong flavour.

# Set the flavour environment variable to the string you got in Detecting flavour section.
# For example if the flavour is `amd64` the command will be
export FLAVOUR="amd64"

In your case the flavour is amd64-ubuntu-jammy. You’re not the first to have this problem, there’s already a PR to make this more clear.

YEAH it’s the mistake I have done, I fixed flavour environment variable then my instance run. Thank you soooo much!!