Jump to content
Froxlor Forum
  • 0

`froxlor:update --database`: Call to undefined function Froxlor\Cli\lng()


fritzmg

Question

I was installing the `php8.3-bz2` extension on my system as I needed it for a project. During this process various services (including Apache) got restarted and I guess the PHP-FPM sockets got recreated. However, the PHP-FPM socket for Froxlor was missing and thus I could not access Froxlor's admin panel anymore:

[proxy:error] [pid 43569] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/apache2/fastcgi/1-froxlor.panel-froxlor.example.com-php-fpm.socket (*) failed

Since there was an update available for Froxlor I decided to update it (was probably the wrong idea ๐Ÿ˜‰). Froxlor was installed via apt and so I updated it via apt. Afterwards I wanted to run

/usr/bin/php8.2 bin/froxlor-cli froxlor:update --database

However, I am getting the following error when doing so:

# /usr/bin/php8.2 bin/froxlor-cli froxlor:update --database
PHP Fatal error:  Uncaught Error: Call to undefined function Froxlor\Cli\lng() in /var/www/html/froxlor/lib/Froxlor/Cli/UpdateCommand.php:62
Stack trace:
#0 /var/www/html/froxlor/vendor/symfony/console/Command/Command.php(298): Froxlor\Cli\UpdateCommand->execute()
#1 /var/www/html/froxlor/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#2 /var/www/html/froxlor/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#3 /var/www/html/froxlor/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#4 /var/www/html/froxlor/bin/froxlor-cli(71): Symfony\Component\Console\Application->run()
#5 {main}
  thrown in /var/www/html/froxlor/lib/Froxlor/Cli/UpdateCommand.php on line 62

Forcing the cron to run results in the following message:

# /usr/bin/php8.2 bin/froxlor-cli froxlor:cron -f -d
It seems that the froxlor files have been updated. Please login and finish the update procedure.

So I am now stuck unfortunately. As far as I understand it the Cronjob would normally recreate the PHP-FPM socket for Froxlor's control panel - but the cronjob cannot run becaus the update needs to be finished. But the update cannot be finished due to the aformentioned error.

Does anyone have an idea how to fix this?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

if you've updated via apt, just login and let the webui handle the database update. Alternatively, test the following fix:

diff --git a/lib/Froxlor/Cli/UpdateCommand.php b/lib/Froxlor/Cli/UpdateCommand.php
index d7a255eb..bca38420 100644
--- a/lib/Froxlor/Cli/UpdateCommand.php
+++ b/lib/Froxlor/Cli/UpdateCommand.php
@@ -58,6 +58,7 @@ final class UpdateCommand extends CliCommand
                if ($input->getOption('database')) {
                        $result = $this->validateRequirements($output, true);
                        if ($result == self::SUCCESS) {
+                               require Froxlor::getInstallDir() . '/lib/functions.php';
                                if (Froxlor::hasUpdates() || Froxlor::hasDbUpdates()) {
                                        $output->writeln('<info>' . lng('updates.dbupdate_required') . '</>');
                                        if ($input->getOption('check-only')) {

ย 

Link to comment
Share on other sites

  • 0
Quote

if you've updated via apt, just login and let the webui handle the database update.

But that's the issue, I cannot log in as the PHP-FPM socket for Froxlor's control panel is missing (it was missing since I was installing the bz2 extension).

Quote

Alternatively, test the following fix:

Thx, that helped, I was able to run

bin/froxlor-cli froxlor:update --database
bin/froxlor-cli froxlor:cron -f -d

without any errors now. However, the original issue with the missing PHP-FPM socket still exists:

[proxy:error] [pid 46129] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/apache2/fastcgi/1-froxlor.panel-froxlor.inspiredminds.at-php-fpm.socket (*) failed

/var/lib/apache2/fastcgi/ still has no socket for Froxlor's control panel ๐Ÿ˜•

Link to comment
Share on other sites

  • 0
Just now, fritzmg said:

But that's the issue, I cannot log in as the PHP-FPM socket for Froxlor's control panel is missing (it was missing since I was installing the bz2 extension)

installing a php extension does not delete any fpm sockets...no idea what you did there...

Just now, fritzmg said:

without any errors now. However, the original issue with the missing PHP-FPM socket still exists:

[proxy:error] [pid 46129] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/apache2/fastcgi/1-froxlor.panel-froxlor.inspiredminds.at-php-fpm.socket (*) failed

/var/lib/apache2/fastcgi/ still has no socket for Froxlor's control panel ๐Ÿ˜•

1) check whether php-fpm is running

2) check where the config for the fpm-pool is located (did you maybe replace php8.x with your php8.3 installation?) and move it the the currently running fpm (it should be displayed when running froxlor:cron -f -d), e.g.

[information] Froxlor\Cron\Http\ApacheFcgi::reload: running service php8.3-fpm restart
[information] Froxlor\Cron\Http\ApacheFcgi::reload: reloading Froxlor\Cron\Http\ApacheFcgi

If that is not php8.3 your settings in froxlor might differ from what you are actually usingย 

Link to comment
Share on other sites

  • 0
Quote

installing a php extension does not delete any fpm sockets...no idea what you did there...

Yeah, I thought so too. I really only ran apt get php8.3-bz2 at that point (Ubuntu 22), nothing else. apt however automatically restarted some services. Afterwards Froxlor did not work anymore as the PHP-FPM socket was missing.

Quote

1) check whether php-fpm is running

ps aux | grep php-fpm does show PHP-FPM pools running for the various sites configured in Froxlor - but the pool for its control panel seems to be missing.

Quote

(did you maybe replace php8.x with your php8.3 installation?)

PHP 8.3 was already installed and already used it for sites in Froxlor before, so I don't think anything got replaced.

Quote

and move it the the currently running fpm (it should be displayed when running froxlor:cron -f -d), e.g.

Hm, interesting. When I run froxlor:cron -f -d it wants to restart the php-fpm pool for 8.1, but fails:

[information] Froxlor\Cron\Http\ApacheFcgi::reload: running service php8.1-fpm restart
Failed to restart php8.1-fpm.service: Unit php8.1-fpm.service is masked.
[information] Froxlor\Cron\Http\ApacheFcgi::reload: running service php8.2-fpm restart
[information] Froxlor\Cron\Http\ApacheFcgi::reload: running service php8.3-fpm restart
[information] Froxlor\Cron\Http\ApacheFcgi::reload: reloading Froxlor\Cron\Http\ApacheFcgi

I am guessing Froxlor's system config is still using PHP 8.1 - may be that's the issue. Or at least that's the issue now as during the last apt upgrade PHP 8.1 got actually removed as it was marked as "unused" by apt.

Is there a way to automatically restore this?

Link to comment
Share on other sites

  • 0
23 minutes ago, fritzmg said:

Yeah, I thought so too. I really only ran apt get php8.3-bz2 at that point (Ubuntu 22), nothing else. apt however automatically restarted some services. Afterwards Froxlor did not work anymore as the PHP-FPM socket was missing

Unlikely, installing an extension does not remove config files...

24 minutes ago, fritzmg said:

I am guessing Froxlor's system config is still using PHP 8.1 - may be that's the issue. Or at least that's the issue now as during the last apt upgrade PHP 8.1 got actually removed as it was marked as "unused" by apt.

Why would you remove anything without checking whether it's running and in use?

You may simpl move the pool config from the 8.1 pool.d config to the 8.3 pool.d directory, restart fpm 8.3, access your froxlor and adjust the form configs there to use 8.3 (maybe stop the crond beforehand so nothing is rebuild in the time)

Link to comment
Share on other sites

  • 0
23 minutes ago, d00p said:

Why would you remove anything without checking whether it's running and in use?

I simply put too much trust in apt's message of recommending to run apt autoremove ;)

Anyway, I ended up manually re-installing php8.1 again and now everything's fine again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...