Nextcloud, PHP, sury, BOUM!

My YunoHost server

Hardware: computer
YunoHost version: 3.6.5.3
I have access to my server : Through SSH, through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Yesterday I installed updates on my yunohost (last time I had updated everything was one or two months ago max). Everything went fine until trying to update nextcloud which failed.
Searching into it I understood from this thread, that one, and numerous other threads and issues that there must be a problem with the php version, related to the sury repository being enabled…
Indeed, I found those logs in the system packages update:

2020-01-12 01:29:44,260: INFO - +The following NEW packages will be installed:
2020-01-12 01:29:44,261: INFO - +  php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-intl
2020-01-12 01:29:44,261: INFO - +  php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache
2020-01-12 01:29:44,261: INFO - +  php7.4-readline php7.4-xml php7.4-zip
2020-01-12 01:29:44,261: INFO - +The following packages have been kept back:
2020-01-12 01:29:44,261: INFO - +  yunohost-admin
2020-01-12 01:29:44,261: INFO - +The following packages will be upgraded:
2020-01-12 01:29:44,262: INFO - +  libpcre2-8-0 php-apcu php-apcu-bc php-common php-curl php-fpm php-gd
2020-01-12 01:29:44,262: INFO - +  php-igbinary php-imagick php-intl php-ldap php-mbstring php-mysql php-pear
2020-01-12 01:29:44,262: INFO - +  php-redis php-xml php-zip php7.0-cli php7.0-common php7.0-curl php7.0-fpm
2020-01-12 01:29:44,262: INFO - +  php7.0-gd php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring php7.0-mcrypt
2020-01-12 01:29:44,262: INFO - +  php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml php7.0-zip php7.3-cli
2020-01-12 01:29:44,262: INFO - +  php7.3-common php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-json
2020-01-12 01:29:44,262: INFO - +  php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline
2020-01-12 01:29:44,263: INFO - +  php7.3-xml php7.3-zip
2020-01-12 01:29:44,363: INFO - +46 upgraded, 14 newly installed, 0 to remove and 1 not upgraded.
2020-01-12 01:29:44,363: INFO - +Need to get 14.6 MB of archives.
2020-01-12 01:29:44,363: INFO - +After this operation, 21.5 MB of additional disk space will be used.
2020-01-12 01:29:44,363: INFO - +Get:1 https://packages.sury.org/php stretch/main amd64 php-common all 2:71+0~20191219.19+debian9~1.gbpefc769 [15.3 kB]
2020-01-12 01:29:44,364: INFO - +Get:2 https://packages.sury.org/php stretch/main amd64 php7.4-common amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [620 kB]
2020-01-12 01:29:44,464: INFO - +Get:3 https://packages.sury.org/php stretch/main amd64 php7.4-json amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [18.5 kB]
2020-01-12 01:29:44,464: INFO - +Get:4 https://packages.sury.org/php stretch/main amd64 php7.4-opcache amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [191 kB]
2020-01-12 01:29:44,464: INFO - +Get:5 https://packages.sury.org/php stretch/main amd64 php7.4-readline amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [11.9 kB]
2020-01-12 01:29:44,565: INFO - +Get:6 https://packages.sury.org/php stretch/main amd64 libpcre2-8-0 amd64 10.34-7+0~20191219.5+debian9~1.gbp555bb9 [228 kB]
2020-01-12 01:29:44,565: INFO - +Get:7 https://packages.sury.org/php stretch/main amd64 php7.4-cli amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [1,386 kB]
2020-01-12 01:29:44,565: INFO - +Get:8 https://packages.sury.org/php stretch/main amd64 php7.4-fpm amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [1,396 kB]
2020-01-12 01:29:44,666: INFO - +Get:9 https://packages.sury.org/php stretch/main amd64 php7.3-zip amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [20.1 kB]
2020-01-12 01:29:44,666: INFO - +Get:10 https://packages.sury.org/php stretch/main amd64 php7.3-intl amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [122 kB]
2020-01-12 01:29:44,666: INFO - +Get:11 https://packages.sury.org/php stretch/main amd64 php7.3-readline amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [11.7 kB]
2020-01-12 01:29:44,666: INFO - +Get:12 https://packages.sury.org/php stretch/main amd64 php7.3-ldap amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [27.9 kB]
2020-01-12 01:29:44,766: INFO - +Get:13 https://packages.sury.org/php stretch/main amd64 php7.3-mysql amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [116 kB]
2020-01-12 01:29:44,767: INFO - +Get:14 https://packages.sury.org/php stretch/main amd64 php7.3-gd amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [26.6 kB]
2020-01-12 01:29:44,767: INFO - +Get:15 https://packages.sury.org/php stretch/main amd64 php7.3-xml amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [103 kB]
2020-01-12 01:29:44,767: INFO - +Get:16 https://packages.sury.org/php stretch/main amd64 php7.3-opcache amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [178 kB]
2020-01-12 01:29:44,767: INFO - +Get:17 https://packages.sury.org/php stretch/main amd64 php7.3-curl amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [28.9 kB]
2020-01-12 01:29:44,867: INFO - +Get:18 https://packages.sury.org/php stretch/main amd64 php7.3-json amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [18.2 kB]
2020-01-12 01:29:44,868: INFO - +Get:19 https://packages.sury.org/php stretch/main amd64 php7.3-mbstring amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [517 kB]
2020-01-12 01:29:44,868: INFO - +Get:20 https://packages.sury.org/php stretch/main amd64 php7.3-fpm amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [1,387 kB]
2020-01-12 01:29:44,868: INFO - +Get:21 https://packages.sury.org/php stretch/main amd64 php7.3-cli amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [1,374 kB]
2020-01-12 01:29:44,969: INFO - +Get:22 https://packages.sury.org/php stretch/main amd64 php7.3-common amd64 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da [564 kB]
2020-01-12 01:29:44,969: INFO - +Get:23 https://packages.sury.org/php stretch/main amd64 php7.0-intl amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [125 kB]
2020-01-12 01:29:44,969: INFO - +Get:24 https://packages.sury.org/php stretch/main amd64 php7.0-xml amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [113 kB]
2020-01-12 01:29:45,070: INFO - +Get:25 https://packages.sury.org/php stretch/main amd64 php7.0-mysql amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [124 kB]
2020-01-12 01:29:45,070: INFO - +Get:26 https://packages.sury.org/php stretch/main amd64 php7.0-json amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [17.0 kB]
2020-01-12 01:29:45,070: INFO - +Get:27 https://packages.sury.org/php stretch/main amd64 php7.0-zip amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [20.1 kB]
2020-01-12 01:29:45,070: INFO - +Get:28 https://packages.sury.org/php stretch/main amd64 php7.0-curl amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [27.3 kB]
2020-01-12 01:29:45,071: INFO - +Get:29 https://packages.sury.org/php stretch/main amd64 php7.0-mcrypt amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [14.5 kB]
2020-01-12 01:29:45,171: INFO - +Get:30 https://packages.sury.org/php stretch/main amd64 php7.0-gd amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [27.2 kB]
2020-01-12 01:29:45,171: INFO - +Get:31 https://packages.sury.org/php stretch/main amd64 php7.0-mbstring amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [467 kB]
2020-01-12 01:29:45,172: INFO - +Get:32 https://packages.sury.org/php stretch/main amd64 php7.0-opcache amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [77.6 kB]
2020-01-12 01:29:45,172: INFO - +Get:33 https://packages.sury.org/php stretch/main amd64 php7.0-readline amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [12.3 kB]
2020-01-12 01:29:45,172: INFO - +Get:34 https://packages.sury.org/php stretch/main amd64 php7.0-ldap amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [21.1 kB]
2020-01-12 01:29:45,272: INFO - +Get:35 https://packages.sury.org/php stretch/main amd64 php7.0-fpm amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [1,290 kB]
2020-01-12 01:29:45,273: INFO - +Get:36 https://packages.sury.org/php stretch/main amd64 php7.0-cli amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [1,284 kB]
2020-01-12 01:29:45,273: INFO - +Get:37 https://packages.sury.org/php stretch/main amd64 php7.0-common amd64 7.0.33-14+0~20191218.25+debian9~1.gbpae1889 [539 kB]
2020-01-12 01:29:45,373: INFO - +Get:38 https://packages.sury.org/php stretch/main amd64 php-apcu amd64 5.1.18+4.0.11-1+0~20191219.13+debian9~1.gbpa99079 [103 kB]
2020-01-12 01:29:45,373: INFO - +Get:39 https://packages.sury.org/php stretch/main amd64 php-apcu-bc amd64 1.0.5-1+0~20191128.11+debian9~1.gbp90a6a0 [11.7 kB]
2020-01-12 01:29:45,374: INFO - +Get:40 https://packages.sury.org/php stretch/main amd64 php-igbinary amd64 3.0.1+2.0.8-2+0~20191119.13+debian9~1.gbpaafd11 [137 kB]
2020-01-12 01:29:45,474: INFO - +Get:41 https://packages.sury.org/php stretch/main amd64 php-imagick amd64 3.4.4-1+0~20191119.13+debian9~1.gbpc5da26 [274 kB]
2020-01-12 01:29:45,475: INFO - +Get:42 https://packages.sury.org/php stretch/main amd64 php-redis amd64 5.1.1+4.3.0-1+0~20191219.18+debian9~1.gbp1a44ee [430 kB]
2020-01-12 01:29:45,475: INFO - +Get:43 https://packages.sury.org/php stretch/main amd64 php-fpm all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,244 B]
2020-01-12 01:29:45,475: INFO - +Get:44 https://packages.sury.org/php stretch/main amd64 php7.4-intl amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [121 kB]
2020-01-12 01:29:45,476: INFO - +Get:45 https://packages.sury.org/php stretch/main amd64 php-intl all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,194 B]
2020-01-12 01:29:45,576: INFO - +Get:46 https://packages.sury.org/php stretch/main amd64 php7.4-ldap amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [28.2 kB]
2020-01-12 01:29:45,577: INFO - +Get:47 https://packages.sury.org/php stretch/main amd64 php-ldap all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,188 B]
2020-01-12 01:29:45,577: INFO - +Get:48 https://packages.sury.org/php stretch/main amd64 php7.4-mysql amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [117 kB]
2020-01-12 01:29:45,578: INFO - +Get:49 https://packages.sury.org/php stretch/main amd64 php-mysql all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,188 B]
2020-01-12 01:29:45,578: INFO - +Get:50 https://packages.sury.org/php stretch/main amd64 php7.4-curl amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [28.9 kB]
2020-01-12 01:29:45,679: INFO - +Get:51 https://packages.sury.org/php stretch/main amd64 php-curl all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,188 B]
2020-01-12 01:29:45,679: INFO - +Get:52 https://packages.sury.org/php stretch/main amd64 php7.4-gd amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [26.8 kB]
2020-01-12 01:29:45,679: INFO - +Get:53 https://packages.sury.org/php stretch/main amd64 php-gd all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,182 B]
2020-01-12 01:29:45,679: INFO - +Get:54 https://packages.sury.org/php stretch/main amd64 php7.4-mbstring amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [393 kB]
2020-01-12 01:29:45,780: INFO - +Get:55 https://packages.sury.org/php stretch/main amd64 php-mbstring all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,194 B]
2020-01-12 01:29:45,780: INFO - +Get:56 https://packages.sury.org/php stretch/main amd64 php7.4-xml amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [93.0 kB]
2020-01-12 01:29:45,780: INFO - +Get:57 https://packages.sury.org/php stretch/main amd64 php-xml all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,208 B]
2020-01-12 01:29:45,780: INFO - +Get:58 https://packages.sury.org/php stretch/main amd64 php-pear all 1:1.10.9+submodules+notgz-1+0~20191119.13+debian9~1.gbp296d25 [287 kB]
2020-01-12 01:29:45,780: INFO - +Get:59 https://packages.sury.org/php stretch/main amd64 php7.4-zip amd64 7.4.1-1+0~20191218.8+debian9~1.gbp21c50e [20.3 kB]
2020-01-12 01:29:45,881: INFO - +Get:60 https://packages.sury.org/php stretch/main amd64 php-zip all 2:7.4+71+0~20191219.19+debian9~1.gbpefc769 [6,184 B]

In the two threads I mention, some people talk about:

  • removing the unwanted php version (php 7.4 in my case),
  • removing sury,
  • running sudo update-alternatives --config php7.0.

I know nothing about php, and the server I’m doing all this on is used by dozens of persons, so even if nextcloud is down and that’s bad enough for me to want to solve the issue really fast, I prefer not trying many things and end up making the situation worse by breaking other things, losing data…
Anyone has some advice on what to do to solve all this PHP/sury mess?

  • I already tried running sudo update-alternatives --config php7.0 but it returned update-alternatives: error: no alternatives for php7.0.
  • I’m reluctant to manually remove/install php (because I’d like my yunohost to stay as much in its defaults as possible in order to have less future issues). But maybe here that’s the way to go. Also I don’t know what’d be the proper way to do it.
  • I don’t know how to remove sury if that’s what should be done, and what impact it may have.

Any help would be warmly welcome. And I know many people struggle to solve php problems with yunohost, thank you for the great job you do.

Note: Maybe that’s another issue, but after the fail update of nextcloud, discourse also failed to update and is now down.

Hi there,

I had the very same problem.
So, I solved it by uninstalling all the php7.4 related packages with a
apt remove php7.4*
And then a
apt install php7.0-zip

BUT ! Now, my nextcloud has an issue that must be related to the uninstall / reinstall process… And it looks that I’m the only one having it so maybe you won’t have any issue by removing php7.4.

Good luck

Hey @charly, thank you for your quick reply.
I tried your solution and it worked great, everything seem to be in order now. I just hope this will not induce future problems on future yunohost upgrade, but for now all good.
Did you try to update nextcloud to 15.0.13 after that? I’m a bit reluctant now that it works to risk creating more problems.
Thanks :slight_smile:

Cool.
Yes, I ran the update without any problem (beside this problem to upgrade 100 Mo files from a client, with might be / might not be related, I don’t really know)

I tried updating nextcloud again, but it fails with not such useful logs. However nothing breaks, it just comes back to the previous version. It reminds me of an issue I saw in the nextcloud_ynh app so I’ll investigate that at some point, but it’s a different issue than this one I think.
Anyway, thanks @charly for the advice, it’s cool to have everything running again :slight_smile: