nextcloud / recognize

👁 👂 Smart media tagging for Nextcloud: recognizes faces, objects, landscapes, music genres
https://apps.nextcloud.com/apps/recognize
GNU Affero General Public License v3.0
558 stars 46 forks source link

SQLSTATE [42S01] Base or view alread exists 'oc_recognize_face_detections' already exists. #348

Closed martadinata666 closed 2 years ago

martadinata666 commented 2 years ago

Describe the bug Cant enable Recognize due database or table already exist.

To Reproduce Steps to reproduce the behavior:

  1. Enable Face Recognition
  2. Disable Face Recognition
  3. Download and Enable Recognize
  4. Nextcloud throwing SQL error.

Expected behavior Recognize enabled successfully

Server (please complete the following information):

Additional context I already had Face Recognition run, when i thougt it just disable it and enable Recognize and testing it out, seems its not that simple. As the database seems conflict each other is there some specific guide to drop the table? or some additional step guide to enable Recognize correctly.

Thanks.

marcelklehr commented 2 years ago

I doubt that this has something to do with the face recognition app. If you don't care about what is in those tables, you can drop them:

DROP TABLE oc_recognize_face_detections; DROP TABLE oc_recognize_face_clusters; DROP TABLE oc_recognize_queue_imagenet; DROP TABLE oc_recognize_queue_landmarks; DROP TABLE oc_recognize_queue_faces; DROP TABLE oc_recognize_queue_movinet; DROP TABLE oc_recognize_queue_musicnn; DELETE from oc_migrations where app = 'recognize';
martadinata666 commented 2 years ago

Thanks for the info.

I dropped the table, but some tables are missing.

Query OK, 0 rows affected (0.724 sec)

Query OK, 0 rows affected (1.033 sec)

ERROR 1051 (42S02): Unknown table 'nextcloud.oc_recognize_queue_imagenet'
ERROR 1051 (42S02): Unknown table 'nextcloud.oc_recognize_queue_landmarks'
ERROR 1051 (42S02): Unknown table 'nextcloud.oc_recognize_queue_faces'
ERROR 1051 (42S02): Unknown table 'nextcloud.oc_recognize_queue_movinet'
ERROR 1051 (42S02): Unknown table 'nextcloud.oc_recognize_queue_musicnn'
Query OK, 1 row affected (0.144 sec)

And afer dropping the tables, i enable Recognize again, but it throw Unexpected error occurred, nextcloud log show nothing, but after reload the page somehow it enabled? 🤔

marcelklehr commented 2 years ago

Which version of recognize are you using?

martadinata666 commented 2 years ago

The stable version 2.2.1.

FYI about the missing table, i tested disabling recognize, drop tables, enable again, then throw unexptected error. So i check the table, seems it not created (`only two created face_clusters and face_detections)? or created later by enabling features at admin. Not really sure about it.

| oc_ratelimit_entries           |
| oc_reactions                   |
| oc_recent_contact              |
| oc_recognize_face_clusters     |
| oc_recognize_face_detections   |
| oc_registration                |
| oc_remote_signing_queues       |
marcelklehr commented 2 years ago

If you use v2 then the queue tables will not be created, yes.

martadinata666 commented 2 years ago

i see, thanks for the guide. despite installation issue, recognize seems work correctly 👍🏼