Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after upgrading to 0.18.1 & 0.18.2 #66

Open
retiolus opened this issue Jul 12, 2023 · 11 comments
Open

Error after upgrading to 0.18.1 & 0.18.2 #66

retiolus opened this issue Jul 12, 2023 · 11 comments

Comments

@retiolus
Copy link

After upgrading to latest 0.18.1 Lemmy Yunohost version, my Lemmy server look like this:

image

@retiolus
Copy link
Author

retiolus commented Jul 12, 2023

The issue is coming from the lemmy service, I can't get logs, yunohost-api crash when trying to get them.

image

@mdeabreu
Copy link
Contributor

Do you still have this issue? I just tried upgrading on my live instance and noticed the same thing however I was able to dig a little deeper. I think this is if you have a large database. If you can ssh into your machine (or have physical access), you can see what the lemmy service is doing by looking at the /var/log/lemmy/lemmy.log file. In my case I saw the following line:

lemmy_db_schema::utils: Running Database migrations (this may take a long time)...

Yunohost thinks the upgrade succeeded but you should have seen a warning saying the lemmy service didn't fully start, that's because it's still running the migrations.

You can follow along by running tail -f /var/log/lemmy/lemmy.log and waiting until it says something new. You can also run top and see that postgres is using a ton of CPU as it goes through the migrations. It seems like the best bet is to wait until the migrations are complete and you see Database migrations complete. in that log file.

@retiolus
Copy link
Author

That's correct
image
image

@retiolus
Copy link
Author

2 h and still doing the database migration (~7 GB database), is this normal?

image

@retiolus
Copy link
Author

retiolus commented Jul 12, 2023

Database migration finished and still having the "Error" message.

API error: FetchError: request to http://0.0.0.0:8536/api/v3/site? failed, reason: connect ECONNREFUSED 0.0.0.0:8536

@da-am
Copy link

da-am commented Jul 12, 2023

I'm seeing this too. After migration I'm getting:
Error connecting to postgres://lemmy:9WVl5bVF0FA9myk1slnMFlY7g9KEsW@localhost:5432/lemmy: could not connect to server: Connection refused

@mdeabreu
Copy link
Contributor

I was seeing the connection refused to the postgres server, attempting to start lemmy again got me past that issue. But then it appeared that I was having troubles federating. I wasn't able to see any incoming activity.

I've opted to restore from my backup for the time being.

@retiolus
Copy link
Author

Fixed the issue following these steps:

  • run the following SQL query to remove server icon: Server error after updating to 0.18.0 LemmyNet/lemmy-ui#1530 (comment)
  • update environment variables in /etc/systemd/system/lemmy-ui.service:
    • LEMMY_INTERNAL_HOST --> LEMMY_UI_LEMMY_INTERNAL_HOST
    • LEMMY_EXTERNAL_HOST --> LEMMY_UI_LEMMY_EXTERNAL_HOST
    • LEMMY_HTTPS --> LEMMY_UI_HTTPS
  • restart lemmy-ui service

Updated config of the environment variables: https://github.com/LemmyNet/lemmy-ui#configuration

@retiolus retiolus changed the title Error after upgrading to 0.18.1 Error after upgrading to 0.18.1 & 0.18.2 Jul 20, 2023
@jahway603
Copy link

Thank you @retiolus for this possible fix, as I do not see the OP error. It's not clear if the server is now federating or not though.

@jahway603
Copy link

Now I'm getting the original error again. Anyone have any ideas on how to fix this?

@retiolus
Copy link
Author

retiolus commented Jun 6, 2024

My server running 0.18.2~ynh3 was completely broken, here is how I fixed it (not sure if this will allow futures updates from YunoHost):

node: v20.14.0
yarn: 1.22.22

  1. sudo -u lemmy bash
  2. cd
  3. delete lemmy-ui: rm -rf lemmy-ui
  4. git clone https://github.com/LemmyNet/lemmy-ui.git --recursive --> --recursive is very important
  5. cd lemmy-ui
  6. git checkout 0.18.2
  7. yarn install --pure-lockfile
  8. yarn build:prod
  9. here I don't know why but my lemmy server was running on port 8537 (default is 8536), even changing lemmy-ui environment variables I didn't manage to change its config so...
  10. sudo nano /var/www/lemmy/config/config.hjson and change port to 8536
  11. sudo systemctl restart lemmy
  12. sudo nano /etc/nginx/conf.d/lemmy.cat.d/lemmy.conf and change all 8537 to 8536
  13. sudo systemctl daemon-reload && sudo systemctl restart nginx
  14. sudo systemctl restart lemmy-ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants