klaussilveira / gitlist

An elegant and modern git repository viewer
https://gitlist.org/
BSD 3-Clause "New" or "Revised" License
2.92k stars 517 forks source link

PHP 8.2 => 500 Internal Server Error, setLastErrors must be of type array, bool given #924

Closed buergi closed 3 months ago

buergi commented 1 year ago

I'm using archlinux and lighttpd together with GitList version 2.0.0 (installed from zip). I just upgraded php to 8.2.2. The GitList index page works, but when browsing any repository I'm now getting a 500 error with the following messages in the log:

Feb 04 14:49:18 mydomain.de [41956]: php.CRITICAL: Uncaught Error: Carbon\CarbonImmutable::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 {"exception":"[object] (TypeError(code: 0): Carbon\\CarbonImmutable::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 at /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:928)"} []
Feb 04 14:49:18 mydomain.de [41956]: request.CRITICAL: Uncaught PHP Exception TypeError: "Carbon\CarbonImmutable::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98" at /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php line 928 {"exception":"[object] (TypeError(code: 0): Carbon\\CarbonImmutable::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 at /usr/share/webapps/gitlist/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:928)"} []

With archlinux package php-legacy (currently 8.1.15) it works, with php (8.2.2) it does not.

I also tried latest nightly build with the identical result.

tocsinde commented 1 year ago

Can you try running composer update? Seems like the carbon dependency is out of date.

counterpoint commented 1 year ago

Where should composer update be run? Running it in ...vendor/nesbot/carbon didn't fix the problem.

buergi commented 3 months ago

Just tried the current nightly 30d69a6 and it is working again, I therefore would close this issue.