Changed NextCloud Database User - occ errors

Hi,

I moved the database of my nextcloud instance and also changed the username. From company-nextcloud to nextcloud. Username in config.php has been altered accordingly.

Now I used occ, and somehow it’s still using the old username:

root@b96858f5e95d:/var/www/html# sudo -u www-data ./occ groupfolders:scan -- 1

In ExceptionConverter.php line 117:

  An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('company-nex
  tcloud'@'%') does not exist


In Exception.php line 28:

  SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('company-nextcloud'@'%') does not exist


In Statement.php line 130:

  SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('company-nextcloud'@'%') does not exist


groupfolders:scan [--all] [--output [OUTPUT]] [--] [<folder_id>]

NextCloud seems to be running fine, but what happened here?

Any ideas?

Joshua

sudo -u www-data ./occ groupfolders:scan -- 1

You appear to be using Docker. If so, are you specifying the the db config via environment variables in your Compose file? If so, open you connection to the container like this and retry without using sudo in the container itself: GitHub - nextcloud/docker: ⛴ Docker image of Nextcloud

equivalent examples:

docker compose exec -u33 app bash ← then run your commands in the container

docker compose exec -u33 app occ config:list system

docker compose exec -u33 app occ config:list system --private ← to see if the variables you are passing are making it

Hi,

I don’t specify the db config via environment variables in my compose file.

The database configuration is in config/config.php.

Had to use docker compose exec -u33 app ./occ config:list system --private (./occ instead of just occ).

Config passes and the variables are correct.

I tested the initial occ groupfolders:scan from my initial post with docker exec, but still it’s trying to use the old database username.