Upgrade to v21.08.5 #2423

Closed
opened 2026-02-05 04:06:22 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @jacksonp2008 on GitHub (Oct 11, 2021).

Describe the bug
Current version is 0.26.2 running on Ubuntu 16.04, attempting to upgrade to latest.

Steps To Reproduce

  1. Upgraded system to Ubuntu 18.04.6 LTS
  2. Upgraded php to 7.4 (per Updating to v0.28 or higher)
  3. Upgraded to php 8 (per Updating to v21.04 or higher)
  4. Attempt upgrade with git pull origin release && composer install --no-dev && php artisan migrate

Expected behavior
Be great if it just worked.

Screenshots
Resulting error message:

pollock@ip-172-31-31-66:/var/www/bookstack$ composer install --no-dev
Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:62
Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:108
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:129
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:129
Cannot create cache directory /home/spollock/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/spollock/.composer/cache/files/, or directory is not writable. Proceeding without cache
> @php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');"
Loading composer repositories with package information
Installing dependencies from lock file
PHP Fatal error:  Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84
Stack trace:
#0 [internal function]: array_merge()
#1 /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array()
#2 /usr/share/php/Composer/DependencyResolver/Solver.php(383): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages()
#3 /usr/share/php/Composer/DependencyResolver/Solver.php(736): Composer\DependencyResolver\Solver->selectAndInstall()
#4 /usr/share/php/Composer/DependencyResolver/Solver.php(228): Composer\DependencyResolver\Solver->runSat()
#5 /usr/share/php/Composer/Installer.php(473): Composer\DependencyResolver\Solver->solve()
#6 /usr/share/php/Composer/Installer.php(227): Composer\Installer->doInstall()
#7 /usr/share/php/Composer/Command/InstallCommand.php(119): Composer\Installer->run()
#8 /usr/share/php/Symfony/Component/Console/Command/Command.php(252): Composer\Command\InstallCommand->execute()
#9 /usr/share/php/Symfony/Component/Console/Application.php(946): Symfony\Component\Console\Command\Command->run()
#10 /usr/share/php/Symfony/Component/Console/Application.php(248): Symfony\Component\Console\Application->doRunCommand()
#11 /usr/share/php/Composer/Console/Application.php(251): Symfony\Component\Console\Application->doRun()
#12 /usr/share/php/Symfony/Component/Console/Application.php(148): Composer\Console\Application->doRun()
#13 /usr/share/php/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run()
#14 /usr/bin/composer(59): Composer\Console\Application->run()
#15 {main}
  thrown in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php on line 84

Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84
Stack trace:
#0 [internal function]: array_merge()
#1 /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array()
#2 /usr/share/php/Composer/DependencyResolver/Solver.php(383): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages()
#3 /usr/share/php/Composer/DependencyResolver/Solver.php(736): Composer\DependencyResolver\Solver->selectAndInstall()
#4 /usr/share/php/Composer/DependencyResolver/Solver.php(228): Composer\DependencyResolver\Solver->runSat()
#5 /usr/share/php/Composer/Installer.php(473): Composer\DependencyResolver\Solver->solve()
#6 /usr/share/php/Composer/Installer.php(227): Composer\Installer->doInstall()
#7 /usr/share/php/Composer/Command/InstallCommand.php(119): Composer\Installer->run()
#8 /usr/share/php/Symfony/Component/Console/Command/Command.php(252): Composer\Command\InstallCommand->execute()
#9 /usr/share/php/Symfony/Component/Console/Application.php(946): Symfony\Component\Console\Command\Command->run()
#10 /usr/share/php/Symfony/Component/Console/Application.php(248): Symfony\Component\Console\Application->doRunCommand()
#11 /usr/share/php/Composer/Console/Application.php(251): Symfony\Component\Console\Application->doRun()
#12 /usr/share/php/Symfony/Component/Console/Application.php(148): Composer\Console\Application->doRun()
#13 /usr/share/php/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run()
#14 /usr/bin/composer(59): Composer\Console\Application->run()
#15 {main}
  thrown in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php on line 84

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.26.2
  • PHP Version: PHP 8.0.11 (cli) (built: Sep 23 2021 21:26:06) ( NTS )
  • Hosting Method (Nginx/Apache/Docker): nginx

Additional context
Add any other context about the problem here.

Originally created by @jacksonp2008 on GitHub (Oct 11, 2021). **Describe the bug** Current version is 0.26.2 running on Ubuntu 16.04, attempting to upgrade to latest. **Steps To Reproduce** 1. Upgraded system to Ubuntu 18.04.6 LTS 2. Upgraded php to 7.4 (per Updating to v0.28 or higher) 3. Upgraded to php 8 (per Updating to v21.04 or higher) 4. Attempt upgrade with `git pull origin release && composer install --no-dev && php artisan migrate` **Expected behavior** Be great if it just worked. **Screenshots** Resulting error message: ``` pollock@ip-172-31-31-66:/var/www/bookstack$ composer install --no-dev Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:62 Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:108 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:129 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:129 Cannot create cache directory /home/spollock/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/spollock/.composer/cache/files/, or directory is not writable. Proceeding without cache > @php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');" Loading composer repositories with package information Installing dependencies from lock file PHP Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84 Stack trace: #0 [internal function]: array_merge() #1 /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array() #2 /usr/share/php/Composer/DependencyResolver/Solver.php(383): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages() #3 /usr/share/php/Composer/DependencyResolver/Solver.php(736): Composer\DependencyResolver\Solver->selectAndInstall() #4 /usr/share/php/Composer/DependencyResolver/Solver.php(228): Composer\DependencyResolver\Solver->runSat() #5 /usr/share/php/Composer/Installer.php(473): Composer\DependencyResolver\Solver->solve() #6 /usr/share/php/Composer/Installer.php(227): Composer\Installer->doInstall() #7 /usr/share/php/Composer/Command/InstallCommand.php(119): Composer\Installer->run() #8 /usr/share/php/Symfony/Component/Console/Command/Command.php(252): Composer\Command\InstallCommand->execute() #9 /usr/share/php/Symfony/Component/Console/Application.php(946): Symfony\Component\Console\Command\Command->run() #10 /usr/share/php/Symfony/Component/Console/Application.php(248): Symfony\Component\Console\Application->doRunCommand() #11 /usr/share/php/Composer/Console/Application.php(251): Symfony\Component\Console\Application->doRun() #12 /usr/share/php/Symfony/Component/Console/Application.php(148): Composer\Console\Application->doRun() #13 /usr/share/php/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run() #14 /usr/bin/composer(59): Composer\Console\Application->run() #15 {main} thrown in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php on line 84 Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84 Stack trace: #0 [internal function]: array_merge() #1 /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array() #2 /usr/share/php/Composer/DependencyResolver/Solver.php(383): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages() #3 /usr/share/php/Composer/DependencyResolver/Solver.php(736): Composer\DependencyResolver\Solver->selectAndInstall() #4 /usr/share/php/Composer/DependencyResolver/Solver.php(228): Composer\DependencyResolver\Solver->runSat() #5 /usr/share/php/Composer/Installer.php(473): Composer\DependencyResolver\Solver->solve() #6 /usr/share/php/Composer/Installer.php(227): Composer\Installer->doInstall() #7 /usr/share/php/Composer/Command/InstallCommand.php(119): Composer\Installer->run() #8 /usr/share/php/Symfony/Component/Console/Command/Command.php(252): Composer\Command\InstallCommand->execute() #9 /usr/share/php/Symfony/Component/Console/Application.php(946): Symfony\Component\Console\Command\Command->run() #10 /usr/share/php/Symfony/Component/Console/Application.php(248): Symfony\Component\Console\Application->doRunCommand() #11 /usr/share/php/Composer/Console/Application.php(251): Symfony\Component\Console\Application->doRun() #12 /usr/share/php/Symfony/Component/Console/Application.php(148): Composer\Console\Application->doRun() #13 /usr/share/php/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run() #14 /usr/bin/composer(59): Composer\Console\Application->run() #15 {main} thrown in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php on line 84 ``` **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): 0.26.2 - PHP Version: PHP 8.0.11 (cli) (built: Sep 23 2021 21:26:06) ( NTS ) - Hosting Method (Nginx/Apache/Docker): nginx **Additional context** Add any other context about the problem here.
Author
Owner

@ssddanbrown commented on GitHub (Oct 11, 2021):

Hi @jacksonp2008,
This can often occur if composer is outdated compared to the PHP version used.
If you have the composer system package installed you may want to remove it (sudo apt remove composer).

See the composer install steps here to get a fresh up-to-date version:
https://getcomposer.org/download/

Note the sudo mv composer.phar /usr/local/bin/composer command shown there to make composer globally available on the command line.

@ssddanbrown commented on GitHub (Oct 11, 2021): Hi @jacksonp2008, This can often occur if composer is outdated compared to the PHP version used. If you have the composer system package installed you may want to remove it (`sudo apt remove composer`). See the composer install steps here to get a fresh up-to-date version: https://getcomposer.org/download/ Note the `sudo mv composer.phar /usr/local/bin/composer` command shown there to make `composer` globally available on the command line.
Author
Owner

@jacksonp2008 commented on GitHub (Oct 13, 2021):

Thanks Dan, the above worked well on one system.

On the second I did the same and am getting this error in the browser window:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".

Yet I had already installed both php 7.4 and 8.0 per above steps.

root@ipsadfasf:/var/www/bookstack# php --version
PHP 8.0.11 (cli) (built: Sep 23 2021 21:26:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies
@jacksonp2008 commented on GitHub (Oct 13, 2021): Thanks Dan, the above worked well on one system. On the second I did the same and am getting this error in the browser window: ``` Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". ``` Yet I had already installed both php 7.4 and 8.0 per above steps. ``` root@ipsadfasf:/var/www/bookstack# php --version PHP 8.0.11 (cli) (built: Sep 23 2021 21:26:06) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.11, Copyright (c) Zend Technologies with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies ```
Author
Owner

@ssddanbrown commented on GitHub (Oct 13, 2021):

@jacksonp2008 The command line version can be different to what's being used by the webserver. Remove any old PHP versions then re-run a composer install within the BookStack folder to be sure, then restart the webserver.

@ssddanbrown commented on GitHub (Oct 13, 2021): @jacksonp2008 The command line version can be different to what's being used by the webserver. Remove any [old PHP versions](https://stackoverflow.com/questions/28318041/how-to-check-if-there-are-multiple-versions-of-php-installed-on-ubuntu-12-04-lts/28318279) then re-run a `composer install` within the BookStack folder to be sure, then restart the webserver.
Author
Owner

@jacksonp2008 commented on GitHub (Oct 13, 2021):

Thanks, removed 7.0, leaving:

root@ip-ddd:/etc/php# sudo update-alternatives --list php
/usr/bin/php7.4
/usr/bin/php8.0

ran composer install in bookstack dir

restarted nginx

Site is not working at all now, are there logs someplace?

@jacksonp2008 commented on GitHub (Oct 13, 2021): Thanks, removed 7.0, leaving: ``` root@ip-ddd:/etc/php# sudo update-alternatives --list php /usr/bin/php7.4 /usr/bin/php8.0 ``` ran `composer install` in bookstack dir restarted nginx Site is not working at all now, are there logs someplace?
Author
Owner

@ssddanbrown commented on GitHub (Oct 13, 2021):

@jacksonp2008 Ah, sorry, I had assumed Apache.

It's likely nginx is sending requests off to the old PHP version.
Open you bookstack nginx conf (Likely at /etc/nginx/sites-available/bookstack.conf or similar). Look for a line like this:

4ffe766ec0/config/nginx (L16)

It will likely have php7.0-fpm.sock (Or similar). You'll need to change that to be php7.4-fpm.sock or php8.0-fpm.sock then restart nginx again.

If the above doesn't align, you'll likely be getting errors in your nginx logs at somewhere like /var/logs/nginx/error.log.

@ssddanbrown commented on GitHub (Oct 13, 2021): @jacksonp2008 Ah, sorry, I had assumed Apache. It's likely nginx is sending requests off to the old PHP version. Open you bookstack nginx conf (Likely at `/etc/nginx/sites-available/bookstack.conf` or similar). Look for a line like this: https://github.com/BookStackApp/devops/blob/4ffe766ec0deb9c9625a12e068bbb011f58db37d/config/nginx#L16 It will likely have `php7.0-fpm.sock` (Or similar). You'll need to change that to be `php7.4-fpm.sock` or `php8.0-fpm.sock` then restart nginx again. If the above doesn't align, you'll likely be getting errors in your nginx logs at somewhere like `/var/logs/nginx/error.log`.
Author
Owner

@jacksonp2008 commented on GitHub (Oct 13, 2021):

You are the tech master!

That was the issue, was showing up in the nginx logs as well.


2021/10/12 15:34:08 [crit] 15374#15374: *35 connect() to unix:/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 10.80.66.36, server: wiki.fryryryry.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "172.31.99.165"

Many thanks for the help,
-Steve

@jacksonp2008 commented on GitHub (Oct 13, 2021): You are the tech master! That was the issue, was showing up in the nginx logs as well. ``` 2021/10/12 15:34:08 [crit] 15374#15374: *35 connect() to unix:/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 10.80.66.36, server: wiki.fryryryry.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "172.31.99.165" ``` Many thanks for the help, -Steve
Author
Owner

@jacksonp2008 commented on GitHub (Oct 13, 2021):

Closing

@jacksonp2008 commented on GitHub (Oct 13, 2021): Closing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2423