YunoHost-Apps / mastodon_ynh

Free, open-source social network for YunoHost
https://joinmastodon.org/
GNU Affero General Public License v3.0
84 stars 36 forks source link

Failed upgrade from 2.5 #145

Closed MCMic closed 5 years ago

MCMic commented 5 years ago

I think I had 2.5.something

The upgrade took several hours and finally failed, but with no clear error message…

The first bit that talks about an error is:

16419476 DEBUG + sudo -u mastodon env PATH=/opt/rbenv/shims:/opt/rbenv/bin:/opt/node_n/n/versions/node/8/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RAILS
_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key                                                                                             
16420078 DEBUG + ynh_exit_properly                                                                                                                                                             
16420079 WARNING !!                                                                                                                                                                            
16420079 DEBUG + local exit_code=10                                                                                                                                                            
16420079 WARNING   mastodon's script has encountered an error. Its execution was cancelled.                                                                                                    
16420080 DEBUG + '[' 10 -eq 0 ']'                                                                                                                                                              
16420080 WARNING !!                                                                                                                                                                            
16420081 DEBUG + trap '' EXIT                                                                                                                                                                  
16420081 WARNING Upgrade failed.      

Saddly I did not use screen so I do not have the whole output. Any idea what could’ve gone wrong?

Then it tried to restore mastodon from the backup it made, and it’s now in a failed state. Not sure what to try next.

MCMic commented 5 years ago

It seems the update was not correctly rollbacked, there are things in the logs like «"error_message":"undefined method `statuses_count='». The log is pretty verbose and full of personal data so I cannot really share it publicly.

Should I attempt the upgrade again?

gnouts commented 5 years ago

Same here. The upgrade failed, now my mastodon is unaccessible (the little masto is hitting the keyboard) The auto-restore did not work as expected. I tried to upgrade again as I didn't had the logs as well. Here is my second try : https://paste.yunohost.org/iluzaneluf.sql

yalh76 commented 5 years ago

Same here. The upgrade failed, now my mastodon is unaccessible (the little masto is hitting the keyboard) The auto-restore did not work as expected. I tried to upgrade again as I didn't had the logs as well. Here is my second try : https://paste.yunohost.org/iluzaneluf.sql

Hi @gnouts , the upgrade failed because a file is missing during backup.

echo 'Source path '\''/etc/apt/sources.list.d/yarn.list'\'' does not exist'

You can recreate it doing:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
yalh76 commented 5 years ago

It seems the update was not correctly rollbacked, there are things in the logs like «"error_message":"undefined method `statuses_count='». The log is pretty verbose and full of personal data so I cannot really share it publicly.

Should I attempt the upgrade again?

Hi @MCMic

Without logs, it will be difficult to help you. Maybe you can provide the full logs replacing the passwords ?

gnouts commented 5 years ago

@yalh76 Thanks it helped ! but still... unable to upgrade. Here is the new log : https://paste.yunohost.org/nezebojatu.bash

Should I delete and restore an older backup before upgrading again ? Because actually the restored "pre-upgrade" backup is not working. So I'm updating a broker mastodon

MCMic commented 5 years ago

I can email you the log if you give me an email address to send it to. But I do not have the log from the failed upgrade, only the one from currently trying to access mastodon.

yalh76 commented 5 years ago

@yalh76 Thanks it helped ! but still... unable to upgrade. Here is the new log : https://paste.yunohost.org/nezebojatu.bash

Should I delete and restore an older backup before upgrading again ? Because actually the restored "pre-upgrade" backup is not working. So I'm updating a broker mastodon

Well, you have an error with the bundle exec rake mastodon:webpush:generate_vapid_key that part has been removed in the testing branch. Maybe you can try to upgrade using: yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug

gnouts commented 5 years ago

Hi thanks for your help again :) Testing branch was a successful upgrade, unfortunately mastodon is still broken. It returns a 502 error while all 3 services are up and going well. I don't know where to find the log to debug it more. It start looking like https://github.com/YunoHost-Apps/mastodon_ynh/issues/139

Also, if nothing works, I thought about switching to pleroma. I saw you packaged it for yunohost too (https://github.com/YunoHost-Apps/pleroma_ynh). Is there a way I can dump some data/profile/follow from the db and import into pleroma ? I will use the same domain

MCMic commented 5 years ago

What is the correct way to try the update and keep the log? I will attempt to use the test branch as well.

yalh76 commented 5 years ago

Hi thanks for your help again :) Testing branch was a successful upgrade, unfortunately mastodon is still broken. It returns a 502 error while all 3 services are up and going well. I don't know where to find the log to debug it more. It start looking like #139

Maybe you can ask on mastodon https://discourse.joinmastodon.org/ because I don't know how to debug 502 error

Also, if nothing works, I thought about switching to pleroma. I saw you packaged it for yunohost too (https://github.com/YunoHost-Apps/pleroma_ynh). Is there a way I can dump some data/profile/follow from the db and import into pleroma ? I will use the same domain

As far as I know, there is no way to do export from mastodon / import to pleroma.

yalh76 commented 5 years ago

What is the correct way to try the update and keep the log? I will attempt to use the test branch as well.

Hi @MCMic you can upgrade using: yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug or yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug to update to the testing version

MCMic commented 5 years ago

Ok the upgrade with testing branch was successful but I still have mastodon in error state, like @gnouts is describing.

All mastodon-* jobs are started, as well as postgresql@9.6-main.service.

MCMic commented 5 years ago

It does look like #139

For info I found the logs which are in /var/log/yunohost/categories/operation/ They can also be listed/displayed using the command «yunohost log».

So, I can email you the logs for both the failed update and the successful one if that may help?

MCMic commented 5 years ago

In /etc/systemd/system/mastodon-web.service there is «Environment="PORT="» which seems wrong, PORT should not be empty.

MCMic commented 5 years ago

Changing this for PORT=3000 and reloading/restarting mastodon services fixed the problem for me.

yalh76 commented 5 years ago

In /etc/systemd/system/mastodon-web.service there is «Environment="PORT="» which seems wrong, PORT should not be empty.

Thanks, very helpfull, I will solve that :)

yalh76 commented 5 years ago

Now solved in testing branch, you can redo an upgrade using: yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug