Readeck - 502 Bad Gateway After Installation

What app is this about, and its version: Readeck, 0.20.3~ynh1
What YunoHost version are you running: 12.1.26
What type of hardware are you using: Virtual machine

Describe your issue

I’m writing this post and will provide a solution in the comments below just in case someone has the same issue I’ve had. I’ve noticed that, with some apps, I have various issues that seem to come from running Yunohost on a VM. Because when I installed it once on bare metal, everything worked better and Readeck might be one of those apps that’s a little odd on a VM.

Anyway, after setting up a subdomain and installing Readeck, Yunohost completes the installation just fine, but the Readeck website was throwing a 502 Bad Gateway error. The error text was helpful and said to check the readeck service, which I did through Tools → Services in the admin portal. Sure enough, Readeck wasn’t able to start, and the logs pointed to its inability to create a Postgres extension called ‘unaccent.’ The service was trying to restart over and over again, but threw the same message every time.

Share relevant logs or error messages

Oct 01 05:48:41 readeck[222756]: {“time”:“2025-10-01T05:48:41.314103307-05:00”,“level”:“ERROR”,“msg”:“can’t initialize database”,“err”:“ERROR: permission denied to create extension "unaccent" (SQLSTATE 42501)”}
Oct 01 05:48:41 systemd[1]: readeck.service: Main process exited, code=exited, status=1/FAILURE
Oct 01 05:48:41 systemd[1]: readeck.service: Failed with result ‘exit-code’.

SOLUTION:

  1. SSH into your Yunohost server
  2. Switch to a superuser with sudo su
  3. Access Postgres as the superuser sudo -u postgres psql Note: I tried to do this as my normal user and it failed.
  4. Once you’re in a Postgres command line, denoted by postgres=#, you’re going to temporarily elevate the readeck database user to superuser status within the database.
  5. To elevate the readeck database user to superuser, type ALTER USER readeck SUPERUSER;
  6. Wait for a minute or two while readeck discovers its newfound ability to create that ‘unaccent’ extension. Check Tools → Services in the admin web portal and you should see that the service has successfully initialized.
  7. Check the Readeck website and make sure you’re no longer getting the 502 error.
  8. Remove the superuser status by typing ALTER USER readeck NOSUPERUSER;
  9. You should be able to quit your Postgres command line with exit and then type exit again to return your Yunohost root user back to your regular user.
  10. Go back to the Readeck website and create your first user. You should be up and running now!

i’m running yunohost in a VM for years without issues
and i’m using readeck for a year now and i hadn’t your issue

i think your setup is bugged

okay so, sorry it’s a thing i didn’t know before yesterday
i’m not a database-toucher eheh

the package will now handle this automatically: install pgsql extensions by OniriCorpe · Pull Request #58 · YunoHost-Apps/readeck_ynh · GitHub

2 Likes

Nah worries! And thanks for helping to get it fixed up!

In the meantime, I’m loving Readeck!

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.