Unable to restart fail2ban and install apps

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.11
How are you able to access your server: SSH

Describe your issue

Hello,

a friend helped me to install the newest YH on a VPS. Diagnostics is telling me that ‘Service fail2ban is failed’, but when I go to Services and open the fail2ban details, the page never loads.

When I try to install apps, they fail and give an error message claiming it’s due the fail2ban not working.
I’m not sure if it’s related to another issue, so I post it here:
You are running inconsistent versions of the YunoHost packages… most probably because of a failed or partial upgrade.

yunohost version: 12.0.11 (stable)
yunohost-admin version: 12.0.5 (stable)
yunohost-portal version: ? (stable)
moulinette version: 12.0.4 (stable)
ssowat version: 12.0.3 (stable)

And a third issue, which is that I can’t get the sso running and istead receive a 403: https://martins.fyi/yunohost/sso/

I’m very new to YH and this is my first support ticket. Pls let me know if you need more details. The documentation is amazing and I read through it as well as looked for forum questions like this, but didn’t find anything recent on the topic. Have a good day!

Share relevant logs or error messages

https://paste.yunohost.org/raw/kucirumezo

I was also thinking to reinstall YH, since there is no content that would get lost this way, but I wasn’t able to find relevant information about how to do it safely. If you thought that should be the first step, please let me know what is the best way. Some older posts here mentioned reinstalling created issues for them, but those posts are about older versions of YH. Thank you!

In that case please share that message (or even better, the full log)

You can also dump information regarding why fail2ban is “failed” using something like sudo journalctl -u fail2ban --no-hostname --no-pager -n 50 from the command line

That sounds unrelated to the other issue but yeah, yunohost-portal is missing somehow … You should be able to solve this just by running sudo apt install yunohost-portal

1 Like

hello, i tried the command, and the following came in return

when i tried reload:
image

the full log is on the link: https://paste.yunohost.org/raw/kucirumezo

the yunohost portal command fixed the sso issue!
thank you!!

Zmlerf alright so the issue is about fail2ban having not found any file related to postfix …

Not sure why neither yunohost-portal was installed and now this suggests that postfix ain’t installed too ? Or that it wasnt started for some reason idk … Sounds like there’s something funky in the way yunohost was installed in the first place

Does running sudo apt install postfix installs postfix somehow ?

What about systemctl status postfix --no-pager --no-hostname ?

I really appreciate your help. Thank you
Postfix seems to be already in place.

Try sudo yunohost tools regen-conf --with-diff
And instead of screenshot copy-paste the output inside two ```

Success! Configuration updated for ‘dnsmasq’
dnsmasq:
applied:
/etc/resolv.dnsmasq.conf:
diff: @@ -1,20 +1,20 @@
-nameserver 2001:67c:28a4::
+nameserver 2001:1608:10:25::9249:d69b
+nameserver 185.233.100.100
+nameserver 195.160.173.53
+nameserver 80.67.169.40
+nameserver 185.233.100.101
+nameserver 2a01:3a0:53:53::
+nameserver 2a0c:e300::101
nameserver 89.234.141.66
-nameserver 195.160.173.53
+nameserver 84.200.69.80
nameserver 2a00:5881:8100:1000::3
-nameserver 84.200.69.80
+nameserver 2001:1608:10:25::1c04:b12f
+nameserver 80.67.169.12
+nameserver 84.200.70.40
+nameserver 89.233.43.71
nameserver 2001:910:800::40
-nameserver 89.233.43.71
-nameserver 194.150.168.168
-nameserver 2001:910:800::12
-nameserver 2001:1608:10:25::9249:d69b
-nameserver 80.67.169.40
-nameserver 84.200.70.40
-nameserver 185.233.100.101
nameserver 91.239.100.100
nameserver 2a0c:e300::100
-nameserver 185.233.100.100
-nameserver 2a01:3a0:53:53::
-nameserver 80.67.169.12
-nameserver 2001:1608:10:25::1c04:b12f
-nameserver 2a0c:e300::101
+nameserver 2001:67c:28a4::
+nameserver 2001:910:800::12
+nameserver 194.150.168.168
status: updated
pending:

I ran the disgnostics again, and fail2ban still has the same issue. When I click to go to the Services menu to restart it, its details page never finishes loading.

Here is the log from diagnostics: https://paste.yunohost.org/raw/oturavaway

ls /var/log/mail.* -lha
journalctl -u postfix --no-hostname --no-pager -n 50

1 Like

to the ls it says no such file or directory

to the second command: No entries

Hmmm maybe there’s no “–no-hostname” option for this one so let’s try systemctl status postfix --no-pager

martins@martins:~$ systemctl status postfix --no-pager
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/lib/systemd/system/postfix.service; enabled; preset: enabled)
Active: active (exited) since Sat 2025-02-15 22:21:23 UTC; 3 days ago
Docs: man:postfix(1)
Process: 48297 ExecReload=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 1597 (code=exited, status=0/SUCCESS)
CPU: 990us

Warning: some journal files were not opened due to insufficient permissions.

If anyone had tips on what issues with fail2ban I should look into documentation elsewhere, please let me know. I’m happy to learn new stuff to find a solution for this, but I don’t even know where to exactly start rn.

martins is not your admin user. Is this the case? If not, give groups

Here is the output in my server of

ls /var/log/mail.* -lha
-rwxr-x--x 1 root adm 5,7K 27 déc.  23:04 /var
/log/mail.err
-rwxr-x--x 1 root adm 295K 27 déc.  23:04 /var
/log/mail.info
-rwxr-x--x 1 root adm 2,4K 23 févr. 00:41 /var
/log/mail.log
-rwxr-x--x 1 root adm  29K 27 déc.  23:04 /var
/log/mail.warn

Try to create these files with the correct permissions and ownership (using commands : touch, chown and chmod) and restart fail2ban.
That’s strange that you don’t have issues with mail.

@jarod5001 : Debian 12 don’t use this files now, you have this files because you do a migration from Yunohost 11.
You’re /var/log/mail.log is active, you can see the date but the other files are obsoletes.

Debian 12 switched to Journalctl instead of rsyslog, so i don’t know if mail.log exists on a fresh install with Yunohost 12.

@martins : is rsyslog install on your Yunohost?

dpkg -l | grep rsyslog | grep ^ii

If the result is empty, so i think it is normal you don’t have the mail log files.

martins is the admin account

for the dpkg command, the result is indeed empty

I have it in a new yunohost 12 install

@jarod5001 : Could you confirm if rsyslog is installed (or not) on your Yunohost 12?
@martins : if martins is the admin account, you have insufficient permissions, there is a problem on your installation. You can verify if you are admin with :

grep -q admins <(groups) && echo "martins is admin" || echo "martin is not admin"

If you are really admin (i have the same message with a non admin user, so i thought that you weren’t admin) your permissions are not corrects.

If @jarod5001 confirm that rsyslog is installed on a fresh Yunohost 12, you must installed it too.

But with so many problems, it can be more simple to reinstall if you have nothing on it. There’s something wrong on your installation

it replies ‘martins is admin’. if you have the patience, could you guide me for fixing the permissions, or is there perhaps a documentation where this has been already documented? thank you!