Nextcloud - Database user change causing impact. DEFINER?

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.4
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian latest stable
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.62
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • None
  • PHP version (e.g, 8.3):
    • PHP 8.2.26
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After migrating the database to a new user which has a different database user
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • On a VM - not using docker or anything similar
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I migrated my database to a new server. The new server has a different database user which I have updated in the config file. This worked successfully and the Nextcloud service is working as expected, except for OCC commands.

OCC Commands show the following error:

An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1449 The user specified as a definer (‘olduser’@‘%’) does not exist

The olduser is not referenced in the config file. My research indicates this could be a DEFINER in the MySQL db which I am not familiar with. I’ve checked for Views, SPROCS, Stored functions, Triggers, & Events which all return an empty set.

Can someone provide some guidance as to what I need to update?

Steps to replicate it (hint: details matter!):

  1. Change database username & update in config file

I have managed to resolve the situation.

I was able to show the triggers with the following MySQL commands:

USE REPLACE-ME-WITH-NEXTCLOUD-DB-NAME;
SHOW TRIGGERS;

This listed one trigger relating to the memories app: memories_fcu_trg

I deleted this trigger with DROP TRIGGER IF EXISTS memories_fcu_trg;

I was able to regenerate the triggers by running occ maintenance:repair

Hopefully this helps someone else who comes across this issue.