Error running occ admin_audit

I get this error when running occ to enable admin_audit in AIO docker.

f1dc21122342:/var/www/html# /usr/src/nextcloud/occ config:app:set admin_audit
Nextcloud is not installed - only a limited number of commands are available

There are no commands defined in the “config:app” namespace.

If i run with www-data user another error:

f1dc21122342:/var/www/html# sudo -u www-data php /usr/src/nextcloud/occ config:app:set admin_audit

Warning: Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
Cannot write into “config” directory!
This can usually be fixed by giving the web server write access to the config directory.

But, if you prefer to keep config.php file read only, set the option “config_is_read_only” to true in it.
See Configuration Parameters — Nextcloud latest Administration Manual latest documentation

I also see 2 config.php which one is being used?

f1dc21122342:/var/www/html# find / -name config.php
/var/www/html/config/config.php
/usr/src/nextcloud/config/config.php

the one here is owned by root and 0 bytes:
f1dc21122342:/var/www/html# ls -la /usr/src/nextcloud/config/config.php
-rw-r–r-- 1 root root 0 Jan 16 20:07 /usr/src/nextcloud/config/config.php

  • That’s not the occ command to install an app [1][3]
  • You’re using AIO so here’s how you run occ[2]

[1] Using the occ command — Nextcloud latest Administration Manual latest documentation
[2] GitHub - nextcloud/all-in-one: The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.
[3] (btw, you can install apps from the web interface too)

1 Like

okay looks like admin_audit is already enabled but nextcloud.log doesnt containt any log or auditing about access of users to data.

f1dc21122342:/var/www/html# ls -la /mnt/ncdata/nextcloud.log
-rw-r–r-- 1 www-data www-data 0 Jan 16 18:49 /mnt/ncdata/nextcloud.log

The nextcloud log is stored in ./data/nextcloud.log inside the container

ok i guess is this then:

ls -la /var/www/html/data/nextcloud.log
-rw-r----- 1 www-data www-data 73523 Jan 17 10:43 /var/www/html/data/nextcloud.log

But exploring it i dont see user file activities like time, user, activity (modified, create, delete), path, file in there just see webserver logs.

How can i see a log with all user file activities?

Please see the Admin Manual. There’s a whole section on the topic:

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html#admin-audit-log-optional