Server: APCu not available for local cache and LDAP Problem with PHP7 and cron.php

Created on 22 Sep 2017  路  4Comments  路  Source: nextcloud/server

Steps to reproduce

  1. Configure PHP7.0 and APCu for local Cache (aka OCMemcacheAPCu)
  2. Make sure apc.enable_cli=1
  3. Setup Cronjob for webuser
  4. Run cronjob manually or wait for it to run

Expected behaviour

If cron.php is executed everything should be fine.
APCu Memcache should be functional as local Memcache.
No Log Entries regarding the LDAP Configuration.

Actual behaviour

Everytime the cron.php is executed the following messages appear in log:

Log Message:

Info | user_ldap | Paged search was not available | 2017-09-22T09:45:01+0200
Info | user_ldap | No paged search for us, Cpt., Limit 500 Offset 500 | 2017-09-22T09:45:01+0200
Info | user_ldap | Looking for cookie L/O 500/0 | 2017-09-22T09:45:01+0200
Info | user_ldap | Paged search was not available | 2017-09-22T09:45:01+0200
Info | user_ldap | No paged search for us, Cpt., Limit 500 Offset 500 | 2017-09-22T09:45:01+0200
Info | user_ldap | Looking for cookie L/O 500/0 | 2017-09-22T09:45:01+0200
Info | cli | Memcache OCMemcacheAPCu not available for distributed cache | 2017-09-22T09:45:01+0200
Info | cli | Memcache OCMemcacheAPCu not available for local cache | 2017-09-22T09:45:01+0200

Server configuration

Operating system: Debian Stretch 9

Web server: Apache 2.4.25

Database: MaxScale Galera Cluster MariaDB

PHP version: PHP 7.0.19-1

Nextcloud version: 12.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Fresh Install

Where did you install Nextcloud from: Download from Webpage

Signing status:


Signing status

No errors have been found.

List of activated apps:


App list

Active:

  • activity: 2.5.2
  • bruteforcesettings: 1.0.2
  • comments: 1.2.0
  • dav: 1.3.0
  • federatedfilesharing: 1.2.0
  • federation: 1.2.0
  • files: 1.7.2
  • files_pdfviewer: 1.1.1
  • files_sharing: 1.4.0
  • files_texteditor: 2.4.1
  • files_trashbin: 1.2.0
  • files_versions: 1.5.0
  • files_videoplayer: 1.1.0
  • firstrunwizard: 2.1
  • gallery: 17.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.1
  • notifications: 2.0.0
  • oauth2: 1.0.5
  • password_policy: 1.2.2
  • provisioning_api: 1.2.0
  • quota_warning: 1.1.0
  • serverinfo: 1.2.0
  • sharebymail: 1.2.0
  • survey_client: 1.0.0
  • systemtags: 1.2.0
  • theming: 1.3.0
  • twofactor_backupcodes: 1.1.1
  • updatenotification: 1.2.0
  • user_ldap: 1.2.1
  • workflowengine: 1.2.0
    Disabled:
  • admin_audit
  • encryption
  • files_external
  • user_external
  • user_saml

Nextcloud configuration:


Config report

{
"system": {
"instanceid": "oc7bv2lmnftj",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"cloud.stefan-benten.de"
],
"trusted_proxies": [
"10.0.0.2"
],
"datadirectory": "/mnt/cloud/data/",
"overwrite.cli.url": "REMOVED SENSITIVE VALUE",
"htaccess.RewriteBase": "/",
"memcache.local": "\OC\Memcache\APCu",
"memcache.locking": "\OC\Memcache\Redis",
"filelocking.enabled": "true",
"redis": {
"host": "/var/run/redis/redis.sock",
"port": 0,
"timeout": 0
},
"dbtype": "mysql",
"version": "12.0.3.3",
"dbname": "cloud",
"dbhost": "10.0.3.15",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\OCA\User_LDAP\LDAPProviderFactory",
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_smtpsecure": "tls",
"mail_from_address": "cloud",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "25",
"updater.secret": "REMOVED SENSITIVE VALUE",
"maintenance": false,
"theme": "",
"loglevel": 1
}
}

Are you using external storage, if yes which one: no

Are you using encryption: not yet

Are you using an external user-backend, if yes which one: Active Directory

LDAP configuration (delete this part if not used)


LDAP config

+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| hasPagedResultSupport | |
| homeFolderNamingRule | attr:cn |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | CN=Administrator,OU=Dom盲nenbenutzer,DC=ad,DC=stefan-benten,DC=de |
| ldapAgentPassword | * |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | DC=ad,DC=stefan-benten,DC=de |
| ldapBaseGroups | dc=ad,dc=stefan-benten,dc=de |
| ldapBaseUsers | ou=Dom盲nenbenutzer,dc=ad,dc=stefan-benten,dc=de |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | cn |
| ldapGidNumber | gidNumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (|(cn=Dom盲nen-Admins)) |
| ldapGroupFilterGroups | Dom盲nen-Admins |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | |
| ldapGroupMemberAssocAttr | member |
| ldapHost |
REMOVED SENSITIVE VALUE** |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(|(objectclass=person))(|(|(memberof=CN=Dom盲nen-Benutzer,CN=Users,DC=ad,DC=stefan-benten,DC=de)(primaryGroupID=513))))(|(samaccountname=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid)))) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 1 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | cloudquota |
| ldapQuotaDefault | 50GB |
| ldapTLS | 0 |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(|(objectclass=person))(|(|(memberof=CN=Dom盲nen-Benutzer,CN=Users,DC=ad,DC=stefan-benten,DC=de)(primaryGroupID=513)))) |
| ldapUserFilterGroups | Dom盲nen-Benutzer |
| ldapUserFilterMode | 1 |
| ldapUserFilterObjectclass | person |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Client configuration

Browser: Chrome 60

Operating system: Windows 10 and Windows 7

Logs

Web server error log


Web server error log

No errors logged.

Nextcloud log (data/nextcloud.log)


Nextcloud log

{"reqId":"pntGPDiIuwDTj288HwLw","level":1,"time":"2017-09-22T07:45:01+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"Looking for cookie L/O 500/0","userAgent":"--","version":"12.0.3.3"}
{"reqId":"pntGPDiIuwDTj288HwLw","level":1,"time":"2017-09-22T07:45:01+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"No paged search for us, Cpt., Limit 500 Offset 500","userAgent":"--","versi$
{"reqId":"pntGPDiIuwDTj288HwLw","level":1,"time":"2017-09-22T07:45:01+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"Paged search was not available","userAgent":"--","version":"12.0.3.3"}
{"reqId":"pntGPDiIuwDTj288HwLw","level":1,"time":"2017-09-22T07:45:01+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"Looking for cookie L/O 500/0","userAgent":"--","version":"12.0.3.3"}
{"reqId":"pntGPDiIuwDTj288HwLw","level":1,"time":"2017-09-22T07:45:01+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"No paged search for us, Cpt., Limit 500 Offset 500","userAgent":"--","versi$
{"reqId":"pntGPDiIuwDTj288HwLw","level":1,"time":"2017-09-22T07:45:01+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"--","url":"--","message":"Paged search was not available","userAgent":"--","version":"12.0.3.3"}
{"reqId":"meATeo8ISimfL8KESDs8","level":1,"time":"2017-09-22T07:47:15+00:00","remoteAddr":"","user":"--","app":"cli","method":"--","url":"--","message":"Memcache \OC\Memcache\APCu not available for local cache","userAgent":"--","ve$
{"reqId":"meATeo8ISimfL8KESDs8","level":1,"time":"2017-09-22T07:47:15+00:00","remoteAddr":"","user":"--","app":"cli","method":"--","url":"--","message":"Memcache \OC\Memcache\APCu not available for distributed cache","userAgent":"-$

Browser log


Browser log

Nothing logged.

needs info

Most helpful comment

So, is it really enabled? Open a PHP shell and check the ini value:

$ php -a
Interactive shell

php > var_dump(ini_get('apc.enable_cli'));
php shell code:1:
string(1) "1"

Also check phpinfo output. If the module is loaded, you should see an apcu section

php > phpinfo(INFO_MODULES);
phpinfo()

apcu

APCu Support => Enabled
Version => 5.1.8
APCu Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>  
Serialization Support => php
Build Date => Jan 17 2017 19:12:15

All 4 comments

So, is it really enabled? Open a PHP shell and check the ini value:

$ php -a
Interactive shell

php > var_dump(ini_get('apc.enable_cli'));
php shell code:1:
string(1) "1"

Also check phpinfo output. If the module is loaded, you should see an apcu section

php > phpinfo(INFO_MODULES);
phpinfo()

apcu

APCu Support => Enabled
Version => 5.1.8
APCu Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>  
Serialization Support => php
Build Date => Jan 17 2017 19:12:15

Thanks blizzz for that input!

I only checked that APCu was enabled with apc.enable_cli=1 through the standard phpinfo() page via HTTP Call.
As i checked it via var_dump it returned 0.

I moved the configuration from

/etc/php/7.0/cli/conf.d/20-apcu.ini -> apc.enable_cli=1

to

/etc/php/7.0/cli/php.ini

and it seems to work now regarding the CLI Log Entries.

But the user_ldap messages still occur! Any hints for fixing that?

That's dependent on your LDAP server. If it does not support paging, this is how it looks like, but it will still operate. Increase the Log level to not see those 馃檴 Or is it supposed to do it?

Figured all out! Thanks for your support @blizzz

Was this page helpful?
0 / 5 - 0 ratings