YunoHost-Apps / hubzilla_ynh

Hubzilla Hub package for YunoHost
https://zotlabs.org/page/hubzilla/hubzilla-project
GNU General Public License v3.0
14 stars 9 forks source link

HZ Composer needs PHP version >= 8.1.0 #152

Closed rocky-III closed 1 year ago

rocky-III commented 1 year ago

Hubzilla Composer needs PHP version >= 8.1.0

root@admin:~# cd /var/www/hubzilla
root@admin:/var/www/hubzilla# util/config system php_path                                                                                
Composer detected issues in your platform:                                                                                               

Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.33.                                                     

PHP Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running
 7.4.33. in /var/www/hubzilla/vendor/composer/platform_check.php on line 24                                           
dragondaddy commented 1 year ago

The default php version on Debian 11 is 7.4.*.

If you call a script in util, you will need to run it using the proper php version.

/usr/bin/php8.2 util/.... or /usr/bin/php${YNH_PHP_VERSION} util/....

rocky-III commented 1 year ago

THANKS for helping me to understand things

so i try this:

cd /var/www/hubzilla
/var/www/hubzilla# /usr/bin/php8.2 util/config system php_path
<html>
<head><tigle>System Unavailabel</title></head>
</body>
Apologies but this site is unavailable at the moment. Please try again later.
</boby>

What does that mean?

The Problem: After update from YH HZ 8.4.1 to YH HZ 8.6 i could not sent out any posts. HZ Devs pointed out that the HZ queueworker may not work because of the missing PHP version >= 8.1.0. ...

so you think that this is not the case and that the HZ Composer is working correct in YH HZ 8.6 ?

dragondaddy commented 1 year ago

Well... I'm don't really understand what you're trying to do here. Why would you try to run such commands on your YunoHost system?

rocky-III commented 1 year ago

because of the not working queueworker Mario asked me to run the command because he would like to know if the php settings are right for the db - CLI and webserver

dragondaddy commented 1 year ago

Right. What's the output of ls -l /etc/alternatives/php ?

And also grep php_path .htconfig.php

rocky-III commented 1 year ago
root@my:~# ls -l /etc/alternatives/php                                                                                                     
lrwxrwxrwx 1 root root 15 Aug  8  2022 /etc/alternatives/php -> /usr/bin/php7.4                                                            

root@my:~# cd /var/www/hubzilla                                                                                                            
root@my:/var/www/hubzilla# grep php_path .htconfig.php                                                                                     
App::$config['system']['php_path'] = '/usr/bin/php8.0';                                                                                    
root@my:/var/www/hubzilla#      

now this is from my other hub which is running still YH HZ 8.0 but has now the same problems with the queueworker -- no posts get out - It was working fine till yesterday. I had the queueworker addon still activ - but since the queueworker got core on HZ 8 i deactivated the addon yesterday for a try ... than no delivery... also activating again could not solve the problem...

the other hub with 8.4.1 and the not working delivery after update to 8.6 is down because the restoring of the backup did not work.

you see right now i have quid some trouble with my YH HZ hubs... :-)

dragondaddy commented 1 year ago

OK, so your default php version is 7.4, which is perfectly fine on Debian 11. Your Hubzilla 8.0 hub uses php8.0, which is the version that is required with the Hubzilla 8.0 package, so it's fine too. I really can't tell you what could be wrong and if it's related to the queueworker addon, you'd have to check with Mario directly.

If this is something you can do, maybe you should simply reinstall Hubzilla on the server where the 8.4.1/8.6 version is down, and then try to clone your channels from your not running so well but still running other hub. That's what I would do. Unless you have content that was only available on the more up-to-date hub.

rocky-III commented 1 year ago

thanks for help - i will ask Mario too

there are no clones of all those channels... it is a large hub... some how i have to reinstall the backup - since the automated script is not working right i guess i have to do it "by hand" this time... all data is there ... just have to but it back in the right places

I was thinking that the HZ YH prepackages may have problems with the needed php versions and this problem get just know if the core queueworker is needed... by the HZ YH updates the queueworker addon did not get deleted and stayed active...

still don't understand why after reactivating the queueworker addon things are still bad ... well

dragondaddy commented 1 year ago

Good luck on you manual restore, then. Just to let you know, I ran a test and upgrading from a hubzilla 8.0 freshly installed hub to 8.6 seems to work just fine on YunoHost. I honestly don't see why activating/deactivating an addon could make such a mess on your hub, this would require some testing to see if you can reproduce the bug on another hub.

Anyhow, it's getting late, so good night, and, again, good luck :)

rocky-III commented 1 year ago

good morning - hoped you slept well :-)

well i kind of reproduced things on by second hub while i deactivating the addon also there

Why is this queueworker not working ...? What could i try more?


thanks for your testing the update

here is my result by trying updating from 8.0 to 8.6 WARNING - Variable $random_string wasn't initialized when trying to replace __RANDOM_STRING__ in /var/www/hubzilla/.htconfig.php

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

that installation is on a Raspi PI also with a large DB.

There was an report form an other installation that had the same error https://github.com/YunoHost-Apps/hubzilla_ynh/issues/149


Now, i not just need luck but also knowledge ;-) which i don't really have :-(

https://github.com/YunoHost-Apps/hubzilla_ynh/issues/153#issuecomment-1676277577

rocky-III commented 1 year ago

where exactly do i see the logs for php on a YH server ?

i found: /yunohost/admin/#/services/php7.4-fpm and / yunohost/admin/#/services/php8.0-fpm

is there also an other place with more ( possible error) php logs ?

dragondaddy commented 1 year ago

php-fpm logs are in /var/log/. You will most likely fin different files for the different php versions you have on your server.

rocky-III commented 1 year ago

Thanks

OK in

/etc/php/8.0/fpm/php-fpm.conf is configured error_log = /var/log/php8.0-fpm.log

and in /var/log/php8.0-fpm.log i see the same as under

https://YH-Server.tld/yunohost/admin/#/services/php8.0-fpm

seams OK here - no errors just WARNING: [pool hubzilla] server reached max_children setting (16), consider raising it but raising does not solve the problem with the queueworker

hmm ???

Where else could i find relevant error logs?

dragondaddy commented 1 year ago

/var/www/hubzilla/php.log ?

rocky-III commented 1 year ago

oh yes - good hint - there i find a large file... even that large that i can't open it with FeatherPad... will rename the file and create a new php.log file and see -

rocky-III commented 1 year ago

found out the reason why the QueueWorker is not working and could fix it: https://github.com/YunoHost-Apps/hubzilla_ynh/issues/156