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

Pixelfed upgrade from 0.11.1~ynh2 to 0.11.2~ynh1 fails : php (dependencies ?) issue with composer ? #165

Closed
aarontrom opened this issue Feb 6, 2022 · 52 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@aarontrom
Copy link

Describe the bug

I tried to upgrade Pixelfed from version 0.11.1ynh2 to 0.11.2ynh1in the yunohost admin panel and it failed.

Context

  • Hardware: VPS bought online
  • YunoHost version: 4.3.6.2 (stable)
  • 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

Steps to reproduce

  • If the error occurs in your browser, explain what you did:
    1. Go to 'System update'
    2. Click on 'Pixelfed Upgrade'
    3. See this error:

Pixelfed upgrade error

Logs

https://paste.yunohost.org/raw/dafoqekiba

Any help is appreciated :)

@aarontrom
Copy link
Author

I think the reason why it failed is because I'm still using php 7.3 and not 7.4 right?
But that's related to yunohost running on Debian 10.
This will probably be solved with the upgrade to Debian 11, am I right?

@lapineige
Copy link
Member

lapineige commented Feb 6, 2022

Even on Debian 10, the upgrade should install php7.4 (if needed) and run Pixelfed with it (it was php7.3 before that version).

I will take a look at your logs.

@lapineige lapineige added the bug Something isn't working label Feb 6, 2022
@lapineige
Copy link
Member

lapineige commented Feb 6, 2022

Here is the error:

The following additional packages will be installed:
2022-02-06 12:37:19,945: DEBUG - php7.4 php7.4-bcmath php7.4-cli php7.4-common php7.4-curl php7.4-fpm
2022-02-06 12:37:19,945: DEBUG - php7.4-gd php7.4-igbinary php7.4-imagick php7.4-intl php7.4-json
2022-02-06 12:37:19,945: DEBUG - php7.4-mbstring php7.4-opcache php7.4-pgsql php7.4-readline php7.4-redis
2022-02-06 12:37:19,946: DEBUG - php7.4-xml php7.4-zip
2022-02-06 12:37:20,011: DEBUG - The following packages will be REMOVED:
2022-02-06 12:37:20,015: DEBUG - friendica-ynh-deps nextcloud-ynh-deps php-igbinary php-imagick php-redis
2022-02-06 12:37:20,017: DEBUG - The following NEW packages will be installed:
2022-02-06 12:37:20,018: DEBUG - php7.4 php7.4-bcmath php7.4-cli php7.4-common php7.4-curl php7.4-fpm
2022-02-06 12:37:20,018: DEBUG - php7.4-gd php7.4-igbinary php7.4-imagick php7.4-intl php7.4-json
2022-02-06 12:37:20,018: DEBUG - php7.4-mbstring php7.4-opcache php7.4-pgsql php7.4-readline php7.4-redis
2022-02-06 12:37:20,019: DEBUG - php7.4-xml php7.4-zip
2022-02-06 12:37:20,044: DEBUG - 0 upgraded, 18 newly installed, 5 to remove and 0 not upgraded.
2022-02-06 12:37:20,044: WARNING - E: Packages need to be removed but remove is disabled.
2022-02-06 12:37:20,047: DEBUG - ++ cat /tmp/tmp.YSe3IRtLUQ/dpkg_log
2022-02-06 12:37:20,047: DEBUG - ++ grep -oP '(?<=-ynh-deps depends on ).*(?=; however)'
2022-02-06 12:37:20,048: DEBUG - ++ tr '\n' ' '
2022-02-06 12:37:20,052: DEBUG - + local 'problematic_dependencies=php7.4-bcmath php7.4-cli php7.4-ctype php7.4-curl php7.4-exif php7.4-gd php7.4-iconv php7.4-intl php7.4-json php7.4-mbstring php7.4-redis php7.4-tokenizer php7.4-xml php7.4-zip php7.4-pdo php7.4-pgsql php7.4-fileinfo php7.4-imagick php7.4 php7.4-fpm php7.4-common '
2022-02-06 12:37:20,052: DEBUG - + [[ -n php7.4-bcmath php7.4-cli php7.4-ctype php7.4-curl php7.4-exif php7.4-gd php7.4-iconv php7.4-intl php7.4-json php7.4-mbstring php7.4-redis php7.4-tokenizer php7.4-xml php7.4-zip php7.4-pdo php7.4-pgsql php7.4-fileinfo php7.4-imagick php7.4 php7.4-fpm php7.4-common ]]
2022-02-06 12:37:20,052: DEBUG - + ynh_package_install php7.4-bcmath php7.4-cli php7.4-ctype php7.4-curl php7.4-exif php7.4-gd php7.4-iconv php7.4-intl php7.4-json php7.4-mbstring php7.4-redis php7.4-tokenizer php7.4-xml php7.4-zip php7.4-pdo php7.4-pgsql php7.4-fileinfo php7.4-imagick php7.4 php7.4-fpm php7.4-common --dry-run
2022-02-06 12:37:20,052: DEBUG - + ynh_apt --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install php7.4-bcmath php7.4-cli php7.4-ctype php7.4-curl php7.4-exif php7.4-gd php7.4-iconv php7.4-intl php7.4-json php7.4-mbstring php7.4-redis php7.4-tokenizer php7.4-xml php7.4-zip php7.4-pdo php7.4-pgsql php7.4-fileinfo php7.4-imagick php7.4 php7.4-fpm php7.4-common --dry-run
2022-02-06 12:37:20,053: DEBUG - + ynh_wait_dpkg_free
2022-02-06 12:37:20,053: DEBUG - + grep -v 'fix-broken|Reading state info'
2022-02-06 12:37:20,053: DEBUG - + sed --quiet '/Reading state info/,$p'
2022-02-06 12:37:20,535: DEBUG - + return 0
2022-02-06 12:37:20,536: DEBUG - + LC_ALL=C
2022-02-06 12:37:20,536: DEBUG - + DEBIAN_FRONTEND=noninteractive
2022-02-06 12:37:20,536: DEBUG - + apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install php7.4-bcmath php7.4-cli php7.4-ctype php7.4-curl php7.4-exif php7.4-gd php7.4-iconv php7.4-intl php7.4-json php7.4-mbstring php7.4-redis php7.4-tokenizer php7.4-xml php7.4-zip php7.4-pdo php7.4-pgsql php7.4-fileinfo php7.4-imagick php7.4 php7.4-fpm php7.4-common --dry-run
2022-02-06 12:37:21,333: WARNING - The following packages have unmet dependencies:
2022-02-06 12:37:21,334: WARNING - php7.4-cli : Depends: php7.4-opcache but it is not going to be installed
2022-02-06 12:37:21,334: WARNING - Depends: php7.4-readline but it is not going to be installed
2022-02-06 12:37:21,335: WARNING - php7.4-fpm : Depends: php7.4-opcache but it is not going to be installed
2022-02-06 12:37:21,335: WARNING - php7.4-imagick : Breaks: php-imagick (< 3.6.0-4+020220117.35+debian101.gbp149f82~)
2022-02-06 12:37:21,335: WARNING - php7.4-redis : Depends: php7.4-igbinary but it is not going to be installed
2022-02-06 12:37:21,336: WARNING - Breaks: php-redis (< 5.3.5+4.3.0-5+020220131.41+debian101.gbpf8a972~)
2022-02-06 12:37:21,337: DEBUG - + ynh_die '--message=Unable to install dependencies'

I don't know what's the issue that prevent those dependencies from being installed. Sounds like there is some conflict, such as with php-redis.
ping @YunoHost-Apps/apps-group ?


By the way, this is strange:

DEBUG - The following packages will be REMOVED:
DEBUG - friendica-ynh-deps nextcloud-ynh-deps php-igbinary php-imagick php-redis

You might check if both friendica and nextcloud are working well…

@aarontrom
Copy link
Author

Thanks for looking into that!
Both friendica and nextcloud work well.

@sthaydn
Copy link

sthaydn commented Feb 6, 2022

I have the same issue with this. I am running Pixelfed on a VPS as well.

@aarontrom
Copy link
Author

Update:
I installed php 7.4 via this tutorial and tried to update Pixelfed again, but the following happened: https://paste.yunohost.org/raw/numayagiwu

@lapineige
Copy link
Member

lapineige commented Feb 7, 2022

So the same error I guess ?

If you install the previous version (I suppose you will have to use yunohost app install https://github.com/YunoHost-Apps/pixelfed_ynh/tree/4c1cc4281c6069842ff5ce12de6dce4000211a3e, and then update it, does it work ?

@aarontrom
Copy link
Author

aarontrom commented Feb 7, 2022

I logged in my server, went to /var/www/pixelfed and got this after I used your command:

/var/www/pixelfed# yunohost app install -u https://github.com/YunoHost-Apps/pixelfed_ynh/tree/4c1cc4281c6069842ff5ce12de6dce4000211a3e
usage: yunohost {app} ...
                [-h] [--output-as {json,plain,none}] [--debug] [--quiet]
                [--timeout ==SUPPRESS==] [-v]
yunohost: error: unrecognized arguments: -u

@lapineige
Copy link
Member

Oh sorry, you don't need that -u parameter (that's used for manual upgrade). I changed the command.

By the way, you don't need to be in /var/www/pixelfed, current directory doesn't matter.

@aarontrom
Copy link
Author

Ahh okay thx, but how do I do that, because I cannot install it on the same domain:
Error: Sorry, this app must be installed on a domain of its own, but other apps are already installed on the domain 'mysubdomain.mydomain.tld'. You could use a subdomain dedicated to this app instead.

So does that mean I need to delete my Pixelfed installation and then install the previous version with that command yunohost app install https://github.com/YunoHost-Apps/pixelfed_ynh/tree/4c1cc4281c6069842ff5ce12de6dce4000211a3e and then try to update it?

But can I then restore the current data somehow?

Or should I just install Pixelfed on another domain and then upgrade it just to see if that works?

@aarontrom
Copy link
Author

Hm, I just tried the latter one (install pixelfed on another subdomain) and it failed. Here is the log: https://paste.yunohost.org/raw/isinavubeb

@lapineige
Copy link
Member

Wait, you mean that installation went well on your first try (with the current main version), even with the error you reported ?

Ok my bad, I didn't notice you were talking about an upgrade, and not a fresh install… sorry 😅

But now with you last experiment, we know that there is the same error upon install and upgrade…

I wonder what's wrong with php7.4 dependencies on some servers and not on others… Something about Debian specific minor versions ? 🤔
@YunoHost-Apps/apps-group do you have an idea ?

@sthaydn
Copy link

sthaydn commented Feb 24, 2022

Any news about that, @aarontrom? Did you manage to get it working?

@aarontrom
Copy link
Author

Hi @sthaydn yes, actually just yesterday I worked on that and I did the following 3 things:

apt install php7.4-igbinary
apt install php7.4-redis
apt install php7.4-imagick

after installing these packages I was able to upgrade Pixelfed from 0.11.1 to 0.11.2 :)

@sthaydn
Copy link

sthaydn commented Feb 24, 2022

Worked also for me. Thanks a lot!

@aarontrom
Copy link
Author

awesome 👍🏾 no problem :)

@lapineige
Copy link
Member

Thanks for sharing the workaround. Nice to see this worked :)

@aarontrom
Copy link
Author

So I have to share here that my nextcloud Instance has some issues and I strongly suspect this is due to the change that I did there:

Hi @sthaydn yes, actually just yesterday I worked on that and I did the following 3 things:

apt install php7.4-igbinary
apt install php7.4-redis
apt install php7.4-imagick

after installing these packages I was able to upgrade Pixelfed from 0.11.1 to 0.11.2 :)

I am now investigating.

@aarontrom
Copy link
Author

I restored a Nextcloud-Backup (from 4 days ago) after I removed the 3 packages that I installed there and now it works again. And interestingly Pixelfed works too, despite me removing

apt install php7.4-igbinary
apt install php7.4-redis
apt install php7.4-imagick

@sthaydn
Copy link

sthaydn commented Feb 27, 2022

Oh dear, that's indeed very strange. But glad it works for you now. I don't have Nextcloud installed, all other apps are working fine.

@aarontrom
Copy link
Author

Hm, now the supervisor service from Pixelfed doesn't work anymore. So there seems to be an issue with the php versions. Some depend on php7.3 and pixelfed 0.11.2 only works with php7.4

@aarontrom
Copy link
Author

Yes I might reopen this issue for the yunohost pixelfed packagers.

@aarontrom aarontrom reopened this Feb 27, 2022
@lapineige
Copy link
Member

Some depend on php7.3

What depends on php7.3 ?
We migrated recently (with last version upgrade) to php7.4, maybe there is some dead spot 😅

Yes I might reopen this issue for the yunohost pixelfed packagers.

Good point, I forgot to reopen it 😅

@lapineige lapineige changed the title Pixelfed upgrade from 0.11.1~ynh2 to 0.11.2~ynh1 fails Pixelfed upgrade from 0.11.1~ynh2 to 0.11.2~ynh1 fails : php (dependencies ?) issue Feb 27, 2022
@aarontrom
Copy link
Author

In /etc/php/7.3/fpm/pool.d there seem a lot of apps using and depending on php7.3:

image

I can also share this in /run/php:

image

also in sudo update-alternatives --config php php7.3 is apparently the deault:

There are 2 choices for the alternative php (providing /usr/bin/php).

  Selection    Path             Priority   Status
------------------------------------------------------------
  0            /usr/bin/php7.4   74        auto mode
* 1            /usr/bin/php7.3   73        manual mode
  2            /usr/bin/php7.4   74        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

@aarontrom
Copy link
Author

Should I choose the option 0 there? to put php7.4 in auto mode?
By the way, what is the difference there between auto mode and manual mode?

@lapineige
Copy link
Member

In /etc/php/7.3/fpm/pool.d there seem a lot of apps using and depending on php7.3:

That's fine and quite normal as far as I know. (but migrations to php7.4 are coming for some of them)

Should I choose the option 0 there? to put php7.4 in auto mode?
By the way, what is the difference there between auto mode and manual mode?

I have noooo idea 😅. Maybe @YunoHost-Apps/apps-group will have more information, but I would say change nothing and let Yunohost apps handle this php version stuff, just in case 😅

@aarontrom
Copy link
Author

there was an upgrade today actually of pixelfed on yunohost via the admin panel. I did the upgrade to version: 0.11.3 and everything works fine now. I also do have a NextCloud there, plus I also do have php 7.4 and pixelfed is using that actually.

@Tony-John-Cil
Copy link

Yes, but if I've correctly followed your case :

  • the Pixelfed upgrade from 0.11.1 to 0.11.2 didn't work.
  • you've installed php7.4 packages through apt.
  • you've installed php7.4-igbinary, php7.4-redis and php7.4-imagick specifically through apt.
  • the Pixelfed upgrade from 0.11.1 to 0.11.2 did work.
  • then you had issues with Nextcloud, so you've restored a backup.
  • you've removed php7.4-igbinary, php7.4-redis and php7.4-imagick specifically through apt.
  • then you had issues with Supervisor.
  • then the Pixelfed upgrade from 0.11.2 to 0.11.3 did work.

So shall I have to take all those steps too to upgrade my Pixelfed installation, temporarily breaking my Nextcloud service and my Pixelfed service, or is it possible to implement something on the Yunohost package which may be more secure, or is there at least a more easy way to do the upgrade manually ?

@aarontrom
Copy link
Author

Ohh @Tony-John-Cil I'm sorry that I didn't get back to your message earlier...
hm, I'm not sure entirely how you should do it best. Did you figure something out in the meantime?

@Tony-John-Cil
Copy link

Nope, I still haven't updated it successfully, but I'm now waiting for the update of the Nextcloud app, which is still in version 22, but a pull request for version 24 is pending, then I will try to update Pixelfed again with the hope that it won't break.

@yalh76
Copy link
Member

yalh76 commented Jun 24, 2022

All thoses issues comes from the upgrade of PHP from 7.3 to 7.4. Pixelfed require php-redis but php7.3-redis is not compatible with php7.4-redis ...

@lapineige
Copy link
Member

What version does Nextcloud use ?
If it's 7.4, maybe upgrade Pixelfed to 7.4 (view Yunohost normal upgrade) first ?

@Tony-John-Cil
Copy link

nextcloud_ynh still uses Nextcloud 22 with PHP 7.3, but pull requests are pending for Nextcloud 23 and 24 which uses higher PHP versions.

@lapineige
Copy link
Member

With php 8.0… maybe it with resolve the conflict ?

@yalh76
Copy link
Member

yalh76 commented Jul 26, 2022

With php 8.0… maybe it with resolve the conflict ?

Same issue with php8.0-redis

From https://packages.sury.org/php/dists/buster/main/binary-amd64/Packages

Package: php8.0-redis
Source: php-redis
Version: 5.3.7+4.3.0-1+0~20220330.42+debian10~1.gbp6fe8b7
Architecture: amd64
Maintainer: Debian PHP PECL Maintainers <team+php-pecl@tracker.debian.org>
Installed-Size: 673
Pre-Depends: php-common (>= 2:69~)
Depends: php8.0-common, php8.0-igbinary, phpapi-20200930, libc6 (>= 2.14), liblz4-1 (>= 0.0~r130), libzstd1 (>= 1.3.2)
Suggests: redis-server
Breaks: php-redis (<< 5.3.7+4.3.0-1+0~20220330.42+debian10~1.gbp6fe8b7~)

Maybe a solution would be to just have php-redis instead of php${YNH_PHP_VERSION}-redis

@lapineige
Copy link
Member

I'll try that… but for the other dependencies, I hope it's not the same…

@lapineige
Copy link
Member

lapineige commented Jul 27, 2022

Oh wait we are using php-redishttps://github.com/YunoHost-Apps/pixelfed_ynh/blob/testing/scripts/_common.sh#L11
edit: no it's php7.4-redis, my bad ^^

@Tony-John-Cil could you try again now with the latest version ? (0.11.3)

@Tony-John-Cil
Copy link

Thanks ! But it seems that there's a problem with php-imagick too.
Here's my log after a sudo yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_ynh/tree/testing --debug : https://paste.yunohost.org/raw/umugonicip

@lapineige
Copy link
Member

Can you try again with this one ?

@Tony-John-Cil
Copy link

Thanks ! But it seems that there's still a problem with php-imagick or its dependencies. https://paste.yunohost.org/raw/befuqeneve

@lapineige
Copy link
Member

@Tony-John-Cil could you try the latest testing please ?

@Tony-John-Cil
Copy link

Thanks ! But now there's a problem with composer or one of its dependencies : /usr/share/yunohost/helpers.d/php: line 481: 9006 Killed COMPOSER_HOME="$workdir/.composer" COMPOSER_MEMORY_LIMIT=-1 php${phpversion} "$workdir/composer.phar" $commands -d "$workdir" --no-interaction --no-ansi 2>&1 https://paste.yunohost.org/raw/ajerofinol

@lapineige
Copy link
Member

The error is not really clear…
I wonder if it's not a memory limit issue 🤔

Or something about a migration to Composer 2, I recall reading something about it regarding Pixelfed.

@lapineige lapineige added the help wanted Extra attention is needed label Aug 5, 2022
@Tony-John-Cil
Copy link

Isn't it possible to log more errors on Yunohost scripts side or on Composer side ? Are there "verbose" options that may show more errors on that step ?

@lapineige
Copy link
Member

I don't know.

Maybe you can open a topic on the forum to ask for help ?

@Tony-John-Cil
Copy link

Tony-John-Cil commented Aug 8, 2022

Problem solved ! In the end, I've just manually replaced the file /var/www/pixelfed/composer.phar with its most up-to-date version then re-run the update command on the testing branch, and 0.11.3 was installed successfully. Thanks again for managing the php7.4 update !

@lapineige
Copy link
Member

I've just manually replaced the file /var/www/pixelfed/composer.phar

Could you explain how you did that ? (to help other people stuck in this issue ;)

@Tony-John-Cil
Copy link

Tony-John-Cil commented Aug 10, 2022

In this case, there aren't many steps I can add. Here is the very specific procedure I've done but other configurations may act differently :

cd /var/www/pixelfed
sudo rm composer.phar
# Composer installation steps as they are prompted on https://getcomposer.org/download/ 
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php
sudo php -r "unlink('composer-setup.php');"
## Upgrade from Yunohost testing branch
sudo yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_ynh/tree/testing --debug

But isn't there a way to check for the version of composer.phar through the YunoHost upgrade script, and replace it with its more up-to-date version during the update ? It would prevent similar problems in the future and avoid this kind of manipulation that could lead to errors, even if its simple to do for advanced users. (back in the days, I've already had a kernel panic after installing a screensaver on my personal Ubuntu computer through command lines ; so simpler is the solution, better it is for all users).

@lapineige lapineige changed the title Pixelfed upgrade from 0.11.1~ynh2 to 0.11.2~ynh1 fails : php (dependencies ?) issue Pixelfed upgrade from 0.11.1~ynh2 to 0.11.2~ynh1 fails : php (dependencies ?) issue with composer ? Aug 11, 2022
@lapineige
Copy link
Member

But isn't there a way to check for the version of composer.phar through the YunoHost upgrade script, and replace it with its more up-to-date version during the update ?

We will have to work on that. I believe next version will require it, although I cannot recall where I found that.

@lapineige
Copy link
Member

I believe #182 might fix the original issue @aarontrom had.
Could you test it if you are concerned ?

I'm closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants