Cannot use OCC from debian CLI

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 26.0.0
Operating system and version (eg, Ubuntu 20.04): Debian 11, Docker

The issue you are facing:
Hey ya’ll, I’m real stuck. I am trying to run OCC commands on a nextcloud 26.0.0 instance running in docker on debian 11. After a whole lot of trial and error, Ive determined that " sudo docker exec -u 33 -it nextcloud php -f /config/www/nextcloud/occ memories:index" is the command I need to use (not sure about-it picked that up from a forum). User is 33 because for some reason debian says every user isnt in the passwd file unless I use UID. So now it is TRYING to run, but I keep receiving this error:

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

Im at a loss for what to now. I used chmod 770 and chown 33 and was able to verify through the gui that the permissions and ownership had in fact updated, but the cli still throws out the same error.
Is this the first time you’ve seen this error? (Y/N): Y