NC 26.0.2 works fine on php8.0 but logins fail on php8.2

Nextcloud version 26.0.2
Operating system and version: my own packages on slackware
Apache or nginx version 2.4.57
PHP version: 8.2.7

I’m working on upgrading nextcloud to 26.0.2 and php from 8.0.19 to 8.2.7. The nextcloud upgrade went without issue, but when using php 8.2.7 I can no longer login.

I’m using php-fpm and have a server for both 8.0.19 and 8.2.7 so I can switch back and forth by simply changing the socket in .htaccess:

SetHandler “proxy:unix:/var/run/php8.0.sock|fcgi://localhost timeout=600”
or
SetHandler “proxy:unix:/var/run/php8.2.sock|fcgi://localhost timeout=600”

When running on php8.2 logins fail. I don’t see any errors in the php logs or in the nextcloud logs. I simply get the failed login log:

{“reqId”:“OfDqSV7z7OC6RtZgOkEl”,“level”:2,“time”:“2023-06-10T15:21:50+00:00”,“remoteAddr”:“x.x.x.x”,“user”:“–”,“app”:“no app in context”,“method”:“POST”,“url”:“/index.php/login”,“message”:“Login failed: admin (Remote IP: x.x.x.x)”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36”,“version”:“26.0.2.1”,“data”:}

I can confirm that there aren’t any missing modules in 8.2.7 and comparing the php.ini files between the versions they have the same settings, only the comments are different.

If I login on 8.0.19 then pivot to 8.2.7 everything is fine as my browser sends a session cookie that proves I’ve been authenticated.

Any thoughts on how to debug this further?

You could try this to get more verbose error reporting In the php.ini of the php8.2-fpm

  • To report all errors, warnings, and notices, you can use:
error_reporting = E_ALL
  • To report all errors except notices, you can use:
error_reporting = E_ALL & ~E_NOTICE
  • if you define the error_log directive in the php.ini file as follows:
error_log = /var/log/php/php_fpm_error.log

PHP-FPM will log its errors and other related messages to the specified file, in this case, /var/log/php/php_fpm_error.log.

This name and the path are of course only meant as an example. Make sure php has write permissions in the log directory.

Maybe you find exactly the message that brings you on the trail of your solution.

Much luck

ernolf,

I appreciate the helpful reply. I did as you suggested and am recording all errors to a file, however the only errors I show are deprecation errors:

[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 4653
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 4664
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 5731
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 5742
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 13398
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 13398
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 13409
[10-Jun-2023 20:06:35 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/htdocs/nextcloud/apps/mail/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 13409

I’m not thinking this is related… but… it could be a character encoding issue.

I used the occ console to turn the netcloud logging to debug and still don’t see anything related.

Finally some progress. The login is failing on Hasher.php line 162:

if (password_verify($message, $hash)) {

If I write a simple php test:

print_r ( password_verify('mepassword', '$argon2id$v=19$m=65536,t=4,p=1$mehash') );

Then I can see it work with php8.0 and fail with php8.2:

$ php8.0 test.php
1
$ php8.2 test.php

Now to figure out what is up with that…

1 Like

–with-password-argon2 was missing in my php build. Adding that resolved my issues.

Lame that php doesn’t spit out something in the log when you try to hash a password against a missing algo…