nextcloud_ynh icon indicating copy to clipboard operation
nextcloud_ynh copied to clipboard

Upgrade from 20.0.8~ynh1 to 21.0.2~ynh1 failed

Open Thatoo opened this issue 3 years ago • 18 comments

Describe the bug

Upgrade from 20.0.8~ynh1 to 21.0.2~ynh1 failed

Context

  • Hardware: Old laptop
  • YunoHost version: 4.2.6.1
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen | ...
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

Steps to reproduce

  • upgrade from web interface of nextcloud app from 20.0.8~ynh1 to 21.0.2~ynh1
  • failed
  • nextcloud restored to 20.0.8

Expected behavior

upgrade being successful

Logs

The full log is below but I think that the problem is somewhere in these lines

2021-06-23 21:20:58,115: DEBUG - + ynh_print_info '--message='\''/tmp/tmp.EGrvoICZxc'\'' wasn'\''t deleted because it doesn'\''t exist.'
2021-06-23 21:20:58,127: DEBUG - + echo ''\''/tmp/tmp.EGrvoICZxc'\'' wasn'\''t deleted because it doesn'\''t exist.'
2021-06-23 21:20:58,127: INFO - '/tmp/tmp.EGrvoICZxc' wasn't deleted because it doesn't exist.
2021-06-23 21:20:58,128: DEBUG - + chown -R nextcloud: /var/www/nextcloud /home/yunohost.app/nextcloud/data
2021-06-23 21:20:58,605: DEBUG - + exec_occ maintenance:mode --off
2021-06-23 21:20:58,606: DEBUG - + '[' 20 = last ']'
2021-06-23 21:20:58,606: DEBUG - + '[' 20 -ge 15 ']'
2021-06-23 21:20:58,606: DEBUG - + NEXTCLOUD_PHP_VERSION=7.3
2021-06-23 21:20:58,606: DEBUG - + cd /var/www/nextcloud
2021-06-23 21:20:58,606: DEBUG - + ynh_exec_as nextcloud php7.3 occ --no-interaction --no-ansi maintenance:mode --off
2021-06-23 21:20:58,607: DEBUG - + local user=nextcloud
2021-06-23 21:20:58,607: DEBUG - + shift 1
2021-06-23 21:20:58,607: DEBUG - ++ whoami
2021-06-23 21:20:58,608: DEBUG - + [[ nextcloud = root ]]
2021-06-23 21:20:58,608: DEBUG - + sudo -u nextcloud php7.3 occ --no-interaction --no-ansi maintenance:mode --off
2021-06-23 21:49:54,438: WARNING - /usr/share/yunohost/helpers.d/user : ligne 184 :  2000 Processus arrêté      sudo -u "$user" "$@"
2021-06-23 21:49:55,884: DEBUG - + ynh_exit_properly
2021-06-23 21:49:55,884: DEBUG - + local exit_code=137
2021-06-23 21:49:55,884: DEBUG - + rm -rf /var/cache/yunohost/download/
2021-06-23 21:49:56,030: DEBUG - + '[' 137 -eq 0 ']'
2021-06-23 21:49:56,030: DEBUG - + trap '' EXIT
2021-06-23 21:49:56,031: DEBUG - + set +o errexit
2021-06-23 21:49:56,031: DEBUG - + set +o nounset
2021-06-23 21:49:56,031: DEBUG - + sleep 0.5
2021-06-23 21:49:56,791: DEBUG - + type -t ynh_clean_setup
2021-06-23 21:49:56,792: DEBUG - + ynh_clean_setup
2021-06-23 21:49:56,792: DEBUG - + ynh_restore_upgradebackup
2021-06-23 21:49:56,793: DEBUG - + ynh_print_err '--message=Upgrade failed.'
2021-06-23 21:49:57,708: DEBUG - + ynh_print_log '[Error] Upgrade failed.'
2021-06-23 21:49:57,709: WARNING - [Error] Upgrade failed.
2021-06-23 21:49:57,710: DEBUG - + echo -e '[Error] Upgrade failed.'
2021-06-23 21:49:57,710: DEBUG - + local app_bck=nextcloud
2021-06-23 21:49:57,710: DEBUG - + NO_BACKUP_UPGRADE=0
2021-06-23 21:49:57,710: DEBUG - + '[' 0 -eq 0 ']'
2021-06-23 21:49:57,711: DEBUG - + ynh_backup_archive_exists nextcloud-pre-upgrade2
2021-06-23 21:49:57,711: DEBUG - + yunohost backup list --output-as json --quiet
2021-06-23 21:49:57,711: DEBUG - + jq -e --arg archive nextcloud-pre-upgrade2 '.archives | index($archive)'
2021-06-23 21:50:41,358: DEBUG - + yunohost app remove nextcloud
2021-06-23 21:50:44,415: DEBUG - Suppression de nextcloud...

https://paste.yunohost.org/wukecaquyo.bash

Thatoo avatar Jun 23 '21 20:06 Thatoo

Following the same steps, I've got the same error, see https://paste.yunohost.org/raw/nomotekoti It's running debian 10

Hope that helps and thanks for the great job you do on nextcloud_ynh :)

manuelleduc avatar Jun 24 '21 09:06 manuelleduc

Hi!

Do you have enough memory during the upgrade? Could you try again by disabling some heavy services?

kay0u avatar Jun 24 '21 15:06 kay0u

According to htop I have 818M of free memory. Testing with some services stopped.

manuelleduc avatar Jun 24 '21 15:06 manuelleduc

In my case, I had 3 Go of available memory (only 500Mo of "free", but "available" should be the one that matter) and it failed.

gnouts avatar Jun 25 '21 09:06 gnouts

Did a few tries yesterday night while closing as many services as I could (and reactivating some when the upgrade was complaining) and it failed consistently.

manuelleduc avatar Jun 25 '21 09:06 manuelleduc

Did a few tries yesterday night while closing as many services as I could (and reactivating some when the upgrade was complaining) and it failed consistently.

Many thanks for your tests. There is some people having the same issue. https://www.reddit.com/r/NextCloud/comments/ntipaj/occ_command_killed/

Could you run php7.3 -i | grep apc.enable to see if apc is enabled?

You can try the solution found on this reddit thread:

fixed it by adding the line “apc.enable_cli=1” to my /etc/php/7.4/cli/conf.d/20-apcu.ini. (See NC 21 - No OCC Output after upgrade - #2 by tflidd 6). Working fine now.

but with php7.3

kay0u avatar Jun 25 '21 09:06 kay0u

Steps to success:

$ php7.3 -i | grep apc.enable
apc.enable_cli => Off => Off
apc.enabled => On => On
$ # added apc.enable_cli=1 to /etc/php/7.3/cli/conf.d/20-apcu.ini
$ sudo service php7.3-fpm restart
$ php7.3 -i | grep apc.enable
apc.enable_cli => On => On
apc.enabled => On => On
$ sudo yunohost app upgrade

Thanks!

manuelleduc avatar Jun 25 '21 10:06 manuelleduc

I can confirm, it works

gnouts avatar Jun 25 '21 10:06 gnouts

Steps to success:

$ php7.3 -i | grep apc.enable
apc.enable_cli => Off => Off
apc.enabled => On => On
$ # added apc.enable_cli=1 to /etc/php/7.4/cli/conf.d/20-apcu.ini
$ sudo service php7.3-fpm restart
$ php7.3 -i | grep apc.enable
apc.enable_cli => On => On
apc.enabled => On => On
$ sudo yunohost app upgrade

Thanks!

..it works, but you have to use the 7.3 path for apcu.ini

OK76 avatar Jun 25 '21 11:06 OK76

Steps to success:

$ php7.3 -i | grep apc.enable
apc.enable_cli => Off => Off
apc.enabled => On => On
$ # added apc.enable_cli=1 to /etc/php/7.4/cli/conf.d/20-apcu.ini
$ sudo service php7.3-fpm restart
$ php7.3 -i | grep apc.enable
apc.enable_cli => On => On
apc.enabled => On => On
$ sudo yunohost app upgrade

Thanks!

..it works, but you have to use the 7.3 path for apcu.ini

My bad, bad copy-paste. Fixed in my previous message too.

manuelleduc avatar Jun 25 '21 11:06 manuelleduc

it does work

Thatoo avatar Jun 25 '21 18:06 Thatoo

Sadly, for me, it did not work out. Here is my log: https://paste.yunohost.org/raw/guyomefoqi

mnium avatar Jun 27 '21 07:06 mnium

Sadly, for me, it did not work out. Here is my log: https://paste.yunohost.org/raw/guyomefoqi

Hello, the first attemp did not work too, I get errors. After I removed the Dropbox Plugins it works fine. But beware, I had installed the plugin again and nextcloud didn't work anymore. I had to remove it again.

OK76 avatar Jun 28 '21 05:06 OK76

@mnium the problem is not the same here, the app spreed fails to upgrade, try to disable it an try again

kay0u avatar Jun 28 '21 11:06 kay0u

thanks, at first didn't realize spreed = talk app

mnium avatar Jun 28 '21 16:06 mnium

Hello, Just for your information, we have same this issue here : https://forum.yunohost.org/t/failing-to-upgrade-nextcloud/16494. If you want more informations, ask me.

Mickael-Martin avatar Jul 18 '21 11:07 Mickael-Martin

Same "memory" issue, while having 7GB of free RAM.

I will try that workaround from @manuelleduc

lapineige avatar Aug 03 '21 22:08 lapineige

It worked ! :tada: :rocket:

By the way, what does apc.enabled do ?

lapineige avatar Aug 04 '21 08:08 lapineige