-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server repeatedly fill disk with infinite log messages: "hash_hmac(): Unknown hashing algorithm:sha1" #9243
Comments
I should note the only seemingly-relevant information I found while searching around was this: https://help.nextcloud.com/t/unknown-hashing-algorithm-sha1/1031 However, I have enabled |
i have the exact same problem - disabling opcache is a workaround for me but not a solution as it comes with a performance hit. |
After some digging, it appears that this issue may be a result of non-thread-safe PHP code entering into a bad state when executed under a multithreaded environment (such as with Apache 2.4's event MPM, which I am using). There is a generic mention of potential multithreading issues with various Apache MPMs here: https://wiki.apache.org/httpd/PHP-FPM Based on this information, I installed PHP-FPM and configured Apache to use it instead of just For anyone finding this via Google, note that to make Nextcloud login work properly with PHP-FPM I also had to configure Apache to preserve the authorization information using
|
I've got the exact same problem. I have a Debian 7 system and upgrading from Apache 2.4.25 to 2.4.29 causes the MPM to change from worker to event. I've just tried re-compiling with the worker MPM (which worked previously), so we'll see what happens. |
It's been a while since I migrated to PHP-FPM and the issue still has not returned. |
for me the problem went away after migrating from apache to nginx and php-fpm |
@jospoortvliet Is the worker MPM in Apache a known requirement? Is it worth adding it to the documentation? |
@terrytibbles I haven't verified this myself but it is worthwhile doing a quick pr to the docs to let someone there look at it 😸 |
I am having the same problem also on gentoo. Unfortunately migrating apache mpm from event to worker did not mitigate the issue. |
Since phpseclib's docs suggest that bcmath and gmp might also be useful I tried various combinations of these useflags for php without success and also ended up migrating to php-fpm. |
Did php-fpm fix it? |
Unfortunately I am not able to deterministically reproduce the issue. Therefore I have to wait to verify its absence. I'll keep you informed. |
This very same problem started for us with PHP 7.2.8, mod_php and Apache 2.4.34 compiled with event MPM (which we are using since early Apache 2.4 without any problems). Reverting back to PHP 7.2.7 mitigates the issue. Now PHP 7.2.9 was released. First I compiled it with mod_php but after a short while those "hash_hmac(): Unknown hashing algorithm: sha1 ..." messages flooded the nextcloud.log again (sometimes the error messages also read "hash(): Unknown hashing algorithm: sha512"). As suggested in this thread I switched from mod_php to PHP-FPM. Unfortunately this does not bring any remedy to the problem but this morning the "Unknown hashing algorithm" messages had started again. I will revert back to PHP 7.2.7 since with 7.2.7 the server runs just smooth without any problems. Worth mentioning that whenever this happens after a while all connections to MySQL are starting to fail. MySQL eventually starts to block all connections regardless of the sources (also non-php connections). A restart of Apache brings remedy for a while. Server configuration: |
I think this is a problem with memory. Despite having a reasonable amount of physical memory available and little swap, setting Nextcloud to use APCu seems to cause these problems. This is especially bad under high load, when the server can crash (go to 100% CPU) at regular intervals. I've currently mitigated this problem by setting Nextcloud not to use APCu and using the worker MPM, which is a lot more stable on my system. I'm currently monitoring the performance, but it's been pretty stable so far. |
I also had endless messages "hash (): Unknown hashing algorithm: sha512" in the log and the CPU load is 100% until you restart the Apache. |
#12722 looks similar. |
Has this problem been fixed in nextcloud 14? I had always had this problem when trying to upgrade from php5 to php7 so I gave up with php7 until it was really necessary.
I can't login to nextcloud from any client without restarting apache. The android device is using the latest version of the nextcloud app. I am currently using nextcloud 13.0.12 but want to update to 14.0.8 when I know php7 is working properly. |
We only got rid of the problem by compiling Apache with mpm=worker (instead of mpm=event) and by enabling PHP-FPM. Since then those problems are gone. |
Ok, thanks. |
Seems that PHP 7.3 may be a solution, too. |
Yes, I will try with php 7.3 now and save changing over to php-fpm as the last resort. |
After updating to PHP 7.3 from 7.2 everything has been working well for 4 days now, rather than starting to die after 6 hours. This is with the PHP opcache and the APCu local memcache enabled. I am still using mod_php with apache mpm_event_module just like I was with PHP 5.6 and NC 13, so in the end all I needed to do was upgrade straight from PHP 5.6 to PHP 7.3. For some reason 7.0, 7.1, and 7.2 don't like my system. The server it is running on is a pretty old one now though with just 4GB of RAM and 32-bit slackware 14.2. edit: I did also disable a couple of php extensions which I didn't need, and installed the php-imagick extension since it was recommended. All the opcache settings are those recommended on the nextcloud settings overview page. |
Here are more reports that php-fpm fixed this issue somehow:
If your php setup stops working there is not much we can do. You may report this kind of problem to mod_php or switch to php-fpm (there are a lof ot advantages anyway). Closing this issue because there are reports for other php applications and the issue (it's related to some special kind of configuration) can not be fixed by nextcloud. |
Can I ask if anyone experiencing this problem is running Nextcloud on a low memory system, like 2 GB RAM or less? What's the swap usage when this occurs? |
I use now PHP-FPM, I'll wait for re-seeing the loop. |
Seem resolve the problem 😃 |
I am not sure if this is a problem in the server or the Android app. My Nextcloud server intermittently generates these log messages within
data/nextcloud.log
. Once the server starts generating these messages, they're logged repeatedly as fast as the server can generate them until the partition containing the log file runs out of disk space:This does not seem to occur as a result of taking any sort of action, and these log messages are not preceded by any other log messages.
Steps to reproduce
data/nextcloud.log
becomes fullExpected behaviour
The Nextcloud server should not generate repeated log messages that fill up the disk
Actual behaviour
The Nextcloud server frequently (every other day or so) frequently consumes my entire disk with the above log messages and I have to truncate the log file
Server configuration
Operating system: Gentoo Linux
Web server: Apache 2.4.29-r1
Database: MySQL 5.6.39
PHP version: PHP 7.1.15
Nextcloud version: 13.0.0
Updated from an older Nextcloud/ownCloud or fresh install: Upgraded from previous versions, I have installed each major release. This issue has been present since at least 12.0.0 and I believe in prior major releases too.
Where did you install Nextcloud from: Operating system repository
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: No
Are you using encryption: No
Are you using an external user-backend, if yes which one: LDAP
LDAP configuration (delete this part if not used)
LDAP config
Client configuration
Browser: Nextcloud Android app
Operating system: Android
Logs
Web server error log
Web server error log
Every 10 minutes, I have a chunk of these:
There is no other diagnostic information in the Apache access or error logs.
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
N/A, unless I can somehow get logging details from the Android app
The text was updated successfully, but these errors were encountered: