Closed Chluz closed 3 years ago
Thats really strange, i`m using also php7.4 without issues.
Indeed, perhaps I have settings in php which do not allow for these types of error, or my specific install triggers $args[0] == null.
It would be because the path_join
function is being called with a null parameter, which it does not expect. It would be interesting to have the full stacktrace to try to figure out why it is being passed a null value in the first place.
I reverted the change to retrigger the error, and now I'm not getting any error messages. I do not know what is happening.
The original issue was
[Fri Nov 05 23:25:25.974060 2021] [php:error] [pid 16362] [client 192.168.67.13:39040] PHP Fatal error: Uncaught ErrorException: Trying to access array offset on value of type null in /var/www/ssh-key-authority/core.php:101\nStack trace:\n#0 /var/www/ssh-key-authority/core.php(101): exception_error_handler()\n#1 /var/www/ssh-key-authority/core.php(55): path_join()\n#2 /var/www/ssh-key-authority/core.php(75): autoload_model()\n#3 /var/www/ssh-key-authority/core.php(42): setup_database()\n#4 /var/www/ssh-key-authority/requesthandler.php(19): require('...')\n#5 /var/www/ssh-key-authority/public_html/init.php(18): require('...')\n#6 {main}\n thrown in /var/www/ssh-key-authority/core.php on line 101
Making that a bit more readable:
[Fri Nov 05 23:25:25.974060 2021] [php:error] [pid 16362] [client 192.168.67.13:39040] PHP Fatal error: Uncaught
ErrorException: Trying to access array offset on value of type null in /var/www/ssh-key-authority/core.php:101
Stack trace:
#0 /var/www/ssh-key-authority/core.php(101): exception_error_handler()
#1 /var/www/ssh-key-authority/core.php(55): path_join()
#2 /var/www/ssh-key-authority/core.php(75): autoload_model()
#3 /var/www/ssh-key-authority/core.php(42): setup_database()
#4 /var/www/ssh-key-authority/requesthandler.php(19): require('...')
#5 /var/www/ssh-key-authority/public_html/init.php(18): require('...')
#6 {main}
thrown in /var/www/ssh-key-authority/core.php on line 101
Given the path this has followed, I can only assume that the error was caused by $base_path
somehow being null. Commit be22ecf9 did fix a bug that would cause $base_path
to not be set correctly in CLI scripts. Is it possible that you were running an older version of the code that did not have this fix?
Hi Thomas, thank you for the answer. Yes it's possible, I would even say it's probable. I had not yet pulled this year's changes when the bug was triggered initially. I then implemented the fix above, and starting cherry picking commits - not noticing that the commit you linked might be fixing the issue. I think that you found the root cause, and we can close this issue now. Thanks Again !
Hi, after upgrading to php7.4, I was having issues with php errors of the type
Uncaught ErrorException: Trying to access array offset on value of type null in
the file core.php at line 100.I therefore changed
to
Its not very clean, but I don't really know php ! Hope it helps others having the same issue. I can create a merge request if this is acceptable.