APC not available

faq_answered
memcache
9.0.x
help

#1

Steps to reproduce

  1. Install owncloud on debian 7
  2. Install php-apc
  3. Edit the config to use APC for caching

Expected behaviour

APC is used for caching.

Actual behaviour

It seems like APC isn't used.
I don't know how the use of APC is implemented in the code. But I got the following error log each time the cron job is running.

I successfully install the php-apc package and enable it.
I actually use owncloud in a chrooted environnement.

{"reqId":"Ilx8paadA2ju0fOmlwFB","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APC not available for local cache","level":1,"time":"2016-10-21T14:00:01+00:00","method":"--","url":"--"}
{"reqId":"Ilx8paadA2ju0fOmlwFB","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APC not available for distributed cache","level":1,"time":"2016-10-21T14:00:01+00:00","method":"--","url":"--"}

Server configuration

Operating system: Debian 7

Web server: Apache 2.2.22

Database: MySQL server 5.5.41

PHP version: PHP 5.4.38 (yeah I know I should move to 5.5 but the server runs other services that I haven't upgrade to use 5.5)

ownCloud version: 9.0.0

Updated from an older ownCloud or fresh install: fresh install

Where did you install ownCloud from: git stable branch

Signing status (ownCloud 9.0 and above): Sorry I disable integrity checker.

List of activated apps:

Enabled:
  - activity: 2.2.3
  - calendar: 1.2.2
  - comments: 0.2
  - contacts: 1.3.1.0
  - dav: 0.1.5
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_pdfviewer: 0.8
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_videoplayer: 0.9.8
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
Disabled:
  - encryption
  - external
  - files_external
  - files_versions
  - firstrunwizard
  - user_external
  - user_ldap

The content of config/config.php:

{
    "system": {
        "instanceid": "ocl4w3y4pz2m",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "example.com"
        ],
        "datadirectory": "\/htdocs\/data",
        "overwrite.cli.url": "https:\/\/example.com",
        "share_folder": "\/Shared",
        "default_language": "fr",
        "dbtype": "mysql",
        "version": "9.0.0.19",
        "dbname": "example_owncloud",
        "dbhost": "127.0.0.1",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "overwriteprotocol": "https",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_domain": "example.com",
        "theme": "",
        "loglevel": 0,
        "maintenance": false,
        "trashbin_retention_obligation": "auto",
        "forcessl": true,
        "proxy": "172.18.8.24:3128",
        "appcodechecker": true,
        "appstoreenabled": true,
        "appstoreurl": "https:\/\/apps.owncloud.com\/",
        "mail_from_address": "admin",
        "integrity.check.disabled": true,
        "mail_smtphost": "127.0.0.1",
        "mail_smtpport": "25",
        "memcache.local": "\\OC\\Memcache\\APC"
    }
}

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: no

Client configuration

Browser: Firefox 45.4.0

Operating system: Debian 8

Logs

Web server error log

Nothing particular

ownCloud log (data/owncloud.log)

{"reqId":"Ilx8paadA2ju0fOmlwFB","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APC not available for local cache","level":1,"time":"2016-10-21T14:00:01+00:00","method":"--","url":"--"}
{"reqId":"Ilx8paadA2ju0fOmlwFB","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APC not available for distributed cache","level":1,"time":"2016-10-21T14:00:01+00:00","method":"--","url":"--"}
{"reqId":"Ilx8paadA2ju0fOmlwFB","remoteAddr":"","app":"cron","message":"Run job with ID 63885","level":0,"time":"2016-10-21T14:00:02+00:00","method":"--","url":"--"}
[...]

Browser log

Nothing particular here

I am talking about APC, not APCu because for now I cannot upgrade to php 5.5.
Can someone help fixing this error ?

Thanks in advance.


#2

Hi,

short pointers:

You should really update to the latest version 9.0.5 first.

This means that you're running ownCloud with a non-default loglevel of 1 instead of the default 2:

https://doc.owncloud.org/server/latest/admin_manual/configuration_server/logging_configuration.html#parameters

You need to expect additional log entries which just have "Informational" character. In the case of APC you can ignore this Info entries for the occ command (cli in your logs) as well as for cron. Those shouldn't use APC.

If APC is not working for you you would get a warning in your admin backend.

To sum-up:

  1. Update to at least 9.0.5
  2. Set loglevel in your config.php to the default value 2

The second points is also explained extensively at the following FAQ:


#3

Hello and thank you very much for your answer.

In my configuration I have loglevel set to 0 which means DEBUG. So I think it's OK, I have all log entries.

I will do the update to 9.0.5 but from the changelog I don't expect it to solve this issue.

I don't really understand the FAQ. It says that if I have this message in my log file I should switch from DEBUG log level to WARN log level. Ok, this will hide the error message but how can I fix it ? Is APC working even if I have this kind of log ?


#4

Hi,

there is nothing needed here to be fixed. Just set the loglevel to 2 and you're good.


#5

Ok so you mean that this message is "normal" ? How can I be sure that APC caching is working ?


#6

Hi,

yes this is "normal" if you're getting the logentries containing cli or cron in your owncloud.log as explained in the linked FAQ.

If APC/APCu is not working for the important part you would get the warning as also explained above: