Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
309 stars 412 forks source link

[pleroma] guide seems to be broken #1345

Closed pascoda closed 1 year ago

pascoda commented 1 year ago

we were informed, and could reproduce, that setting up pleroma currently does not work (neither with new, nor with older versions).

@taddydevil - can you help?

taddydevil commented 1 year ago

Do you have some more informations for me? :) Error in compiling, dependencies or something else?

custompyramidfellow commented 1 year ago

pleroma.log Hi @taddydevil At the step of generating the configuration file with mix pleroma.instance gen it fails with a compilation error (full log attached):

== Compilation error in file lib/prometheus/collector.ex == ** (UndefinedFunctionError) function Kernel.Utils.defdelegate/2 is undefined or private. Did you mean:

  • defdelegate_all/3
  • defdelegate_each/2

(elixir 1.14.0) Kernel.Utils.defdelegate({:collect_mf, [line: 87], [{:\, [line: 87], [{:registry, [line: 87], nil}, :default]}, {:collector, [line: 87], nil}, {:callback, [line: 87], nil}]}, []) lib/prometheus/collector.ex:87: (module) could not compile dependency :prometheus_ex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile prometheus_ex", update it with "mix deps.update prometheus_ex" or clean it with "mix deps.clean prometheus_ex"

I already tried

but always results in same compilation error unfortunately. Would be glad if you could help on this one :) If you need any further details, let me know.

taddydevil commented 1 year ago

Oo.

Please try Erlang 22 @custompyramidfellow . On my working instance with Pleroma 2.4.0 I can compile prometheus_ex.

On my other U7 I can't compile idna, maybe a memory issue. But what I saw in your logs is you have no issues with idna, so this should be not a problem for you.

custompyramidfellow commented 1 year ago

🎉 Yay, Erlang 22 surprisingly works :) A bunch of deprecated warnings showed up during compilation though, but it does work with the latest Pleroma release (v2.4.4).

So I guess we should adjust the guide to use uberspace tools version use erlang 22

Although I'm not sure about future releases, will it be safe to use Erlang version 22?

taddydevil commented 1 year ago

Nice!

But how? I am pretty sure that Pleroma once worked with Erlang version 24 - Uberspace itself has adapted the guide to 24, they do not do that without testing. However, there must be a reason why I continue to use 22 on my production instance. I guess 22 is safe until the Uberspace team removes the libraries. Similar to PHP7 - and every damn Pleroma update must be checked for compatibility for that time.

This issue should remain open until 24 is running again.

Never touch a running version :p

taddydevil commented 1 year ago

@pascoda I can reproduce that pleroma 2.4.4 / the compiling of prometheus_ex works only with Erlang 22. The guide should be adapted to Erlang 22 and everything is fine - can you do that?

Background:

There is a active issue in prometheus_ex repo already with a fix: https://github.com/deadtrickster/prometheus.ex/issues/48

Elixir 1.14 changed Kernel.Utils.defdelegate/2 into Kernel.Utils.defdelegate_each/2

There are two ways to "fix" the compiling.

thisven commented 1 year ago

I can confirm that both solutions @taddydevil mentions are working, but this is an issue that should be fixed upstream, soon.

thisven commented 1 year ago

But don't try to switch to Erlang 22 in production as it breaks your installation. I had to learn that the hard way. :unamused:

hikerus commented 1 year ago

Pleroma 2.4.5 is out. Is there a chance to make an upgrade to this new version or does is it fail as well? I wouldn't use my installation to test this.

taddydevil commented 1 year ago

Yep, prometheus_ex source changed to the solution I mentioned before. Line 167 at https://git.pleroma.social/pleroma/pleroma/-/blob/develop/mix.exs

Compiled it "successfully"... but only with mix deps.compile prometheus_ex.

But there is a new error. I`ll check this out.

nevermind. Everything working, error caused by a local edit myself. If you have a error at mix deps.get simply try run mix local.hex.

@hikerus I think you can upgrade to 2.4.5. If you have make changes in mix.exs, remove this file with mix.lock before pulling the stable channel.

thisven commented 1 year ago

I can confirm that updating to 2.4.5 works without errors using Erlang version 22. Is it safe to just switch to v24 now?

taddydevil commented 1 year ago

Erlang 24 is totally safe now. Erlang 25 will be experimental (its working with my instance, so just now "it works" too)

@pascoda Btw the guide is not broken anymore with the latest stable release. Can you undo the hint in the guide and close this issue?

hikerus commented 1 year ago

My upgrade to 2.4.5 failes - with Erlang 24 or Erlang 25

Also a fresh installation of Pleroma fails: mix: Compilation failed due to warnings while using the --warnings-as-errors option

So my instance is dead now.

taddydevil commented 1 year ago

Whats your compilation command? At which application does it fail? Can you show us some more of the log (before, after the fail)?

hikerus commented 1 year ago

I had some merging conflicts in Git - after solving them it compiles the develop version - but there are tons of warning messages. After that the instance is up again.

taddydevil commented 1 year ago

Had the warning messages too but without any known issues now. If your federation won't work, remove the directorys _build & deps and run again mix deps.get and MIX_ENV=prod mix ecto.migrate. Can be related with Erlang 25, or with the different versions you compiled before (your tries with 24 / 25).

Nothing to worry about.

taddydevil commented 1 year ago

Btw, update Pleroma 2.5.0 working perfectly fine. Follow the update instructions in the lab and be happy with the latest major release.

thisven commented 1 year ago

Copy that. I just switched to Erlang 25 and upgraded Pleroma to v2.5.0.

Although I noticed three error messages, they don't seem to impair Pleroma from running.

==> pleroma
Compiling 592 files (.ex)

[error] Loading of /home/$USER/pleroma/_build/prod/lib/gen_smtp/ebin/mimemail.beam failed: :badfile
[error] The following dependencies are required to use Swoosh.Adapters.Sendmail:
- mimemail from :gen_smtp

[error] beam/beam_load.c(86): Error loading module mimemail:
  lambda already defined for label 491. To fix this, please recompile this module with an OTP 25 compiler.