New Install on CentOS7 - first login is ok (web installer), second login fails

New Installation of NC 16.0.3 with web installer runs through all steps of setup without problem.
My setup is CentOS 7, MySQL 5.7, PHP 7.2, Apache 2.4.
The first login with the newly created account, let’s take “ncadmin” as example, lets me in, I can change settings for the mail account and mailserver setup and so on, everything looks fine.
When I log out, I am not able to login with "ncadmin"anymore.
I checked this three times, I installed NC 16.0.3 and NC 17.0.0 in the same environment, same behaviour.
I can see the record for ncadmin in the table “oc_user” in the MySQL DB-Structure, there is a hash value in the field password, but this doesn’t work out.
If I use “Forgot password” function, I receive an email with a token value that allows me to reset the password, but still I cannot login with this.
I guess it has something to do with how the password hashes are stored in MySQL-DB.
But I don’t know where to search and what to test.

Any hint is appreciated,

Cheers, Philipp

The usual way to start finding the root cause of a problem is by looking in the log files of Nextcloud and you web server :wink:

OK, I had searched the logs, didn’t find the cause.
Is NextCloud writing some extra logs?
Further investigation led me to this: when using PHP 7.3.10 and MySQl 5.7 I seem to get it going with a very basic php.ini.
I can login and logout a several times with my adminuser, I added a second user, made it admin, cóuld login and logout ok.
Now, as soon as I start using OpCache and other extensions like APCu and memcached, my setup gets screwed up and I cannot login with any user and password reset doesn’t work as well.
After receiving the token and giving a new password, no logins possible!
I guess the hash values are blown up somehow.
If I take the extensions out of my php.ini again, I still cannot login anymore, the DB seems to contain invalid entries for the passwords.

How can I test this? Is this a PHP issue?

Regards,
Philipp

APCu is the culprit.
If I load that extension in php.ini via
extension=/(some paths)…/apcu.so
my login screws up.

Whats next?
Philipp

OK, APCu is NOT the reason for my login problems.

I found this in the /data/nextcloud.log after my installation fails:

{“reqId”:“Xbm26QT9AQPoXueKVsD-7wAAABg”,“level”:3,“time”:“2019-10-30T16:14:35+00:00”,“remoteAddr”:“192.168.238.247”,“user”:"–",“app”:“PHP”,“method”:“POST”,“url”:"/nextcloud/index.php",“message”:“password_hash(): Memory allocation error at /home/newvidbw/nextcloud.newvision-demo.de/nextcloud/lib/private/Security/Hasher.php#80”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0”,“version”:“17.0.0.9”}
{“reqId”:“Xbm26QT9AQPoXueKVsD-7wAAABg”,“level”:3,“time”:“2019-10-30T16:14:46+00:00”,“remoteAddr”:“192.168.238.247”,“user”:"–",“app”:“index”,“method”:“POST”,“url”:"/nextcloud/index.php",“message”:{“Exception”:“Error”,“Message”:“Call to a member function getUID() on null”,“Code”:0,“Trace”:[{“file”:"/home/newvidbw/nextcloud.newvision-demo.de/nextcloud/core/Controller/SetupController.php",“line”:72,“function”:“install”,“class”:“OC\Setup”,“type”:"->",“args”:["*** sensitive parameters replaced "]},{“file”:"/home/newvidbw/nextcloud.newvision-demo.de/nextcloud/lib/base.php",“line”:938,“function”:“run”,“class”:“OC\Core\Controller\SetupController”,“type”:"->",“args”:[" sensitive parameters replaced ***"]},{“file”:"/home/newvidbw/nextcloud.newvision-demo.de/nextcloud/index.php",“line”:42,“function”:“handleRequest”,“class”:“OC”,“type”:"::",“args”:[]}],“File”:"/home/newvidbw/nextcloud.newvision-demo.de/nextcloud/lib/private/Setup.php",“Line”:415,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0”,“version”:“17.0.0.9”}

It’s the “memory allocation error” that catches my eye.
This is somehow related to PHP Bug # 78516,
https://bugs.php.net/bug.php?id=78516

So it’s about hasher.php failing to work properly.
I don’t know how to set proper memory cost value, though

Regards,
Philipp

see bug report: https://github.com/nextcloud/server/issues/17761