Support needed after mistake: wiped table in MariaDB [Solved]

Because of #597, I wanted to install the version 4.0.5. I installed it manually. But then, I could not setup the application correctly in the settings. So I decided to clean everything related to the app. I deleted /var/www/html/nextcloud/apps/groupfolders/ .

But I also deleted the tables in the database ( DROP TABLE command in MariaDB). I removed the following tables:
oc_group_folders, oc_group_folders_groups, oc_group_folders_manage, oc_group_folders_acl, oc_group_folders_trash
I think I made a big mistake :-/

Now I can’t reinstall the app without causing an internal server error, and these messages in the log:
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT f . folder_id , mount_point , quota , acl , fileid , storage , path , name , mimetype , mimepart , size , mtime , storage_mtime , etag , encrypted , parent , a . permissions AS group_permissions , c . permissions AS permissions FROM oc_group_folders f INNER JOIN oc_group_folders_groups a ON f . folder_id = a . folder_id LEFT JOIN oc_filecache c ON ( name = CONCAT( f . folder_id , ‘’)) AND ( parent = ?) WHERE a . group_id = ?’ with params [940647, “Zembo”]: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_group_folders’ doesn’t exist

For information, deleting /var/www/html/nextcloud/apps/groupfolders/ solves the issue, but the issue comes back if I reinstall the app :frowning:

How could I solve this issue? Thank you very much for your support!

Hi @sisim

I think the app config is still in the database. You can use following query to remove this data:

DELETE FROM oc_appconfig WHERE appid LIKE "groupfolders";

You may check first if groupfolders is the correct config key:

SELECT DISTINCT appid FROM oc_appconfig WHERE appid LIKE "group%";

Kind regards
Timm

Hello @timm2k, thank you very much for your support. I followed your instructions, but unfortunately, it did not solve my problem. The log still shows the same message:

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT f.folder_id, mount_point, quota, acl, fileid, storage, path, name, mimetype, mimepart, size, mtime, storage_mtime, etag, encrypted, parent, a.permissionsASgroup_permissions, c.permissionsASpermissionsFROMoc_group_folders fINNER JOINoc_group_folders_groups aONf.folder_id=a.folder_idLEFT JOINoc_filecache c ON (name = CONCAT(f.folder_id, '')) AND (parent= ?) WHEREa.group_id` = ?’ with params [940647, “Zembo”]: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_group_folders’ doesn’t exist

Would you have another idea?

There is a log of applied migrations.

  1. Make a backup of your nextcloud instance
  2. Look for migrations with app = “groupfolders” in oc_migrations.
  3. Delete the migrations for the groupfolders app from the table.
  4. Install the app again

Yihaaa! Thank you very much @kesselb , it worked!
I did in mariaDB:
DELETE FROM oc_migrations WHERE app LIKE "groupfolders";
In addition to the command from @timm2k
DELETE FROM oc_appconfig WHERE appid LIKE "groupfolders";
And it worked!
Thank you so much both of you!