Social: table "oc_social_3_cache_actor" has more than one primary key

Created on 24 Sep 2020  路  7Comments  路  Source: nextcloud/social

@daita as discussed, this issue occurs when trying to enable the app (latest master) also with server latest master:

An exception occurred while executing
'CREATE TABLE oc_social_3_cache_actor (id_prim VARCHAR(128) NOT NULL COLLATE BINARY,
id VARCHAR(1000) DEFAULT NULL COLLATE BINARY,
type VARCHAR(31) DEFAULT '' COLLATE BINARY,
account VARCHAR(127) DEFAULT '' COLLATE BINARY, local BOOLEAN DEFAULT '0' NOT NULL, following VARCHAR(1000) DEFAULT '' COLLATE BINARY, followers VARCHAR(1000) DEFAULT '' COLLATE BINARY, inbox VARCHAR(1000) DEFAULT '' COLLATE BINARY, shared_inbox VARCHAR(1000) DEFAULT '' COLLATE BINARY, outbox VARCHAR(1000) DEFAULT '' COLLATE BINARY, featured VARCHAR(1000) DEFAULT '' COLLATE BINARY, url VARCHAR(1000) DEFAULT '' COLLATE BINARY, preferred_username VARCHAR(127) DEFAULT '' COLLATE BINARY, name VARCHAR(127) DEFAULT '' COLLATE BINARY, icon_id VARCHAR(1000) DEFAULT '' COLLATE BINARY, summary CLOB DEFAULT '' COLLATE BINARY, public_key CLOB DEFAULT '' COLLATE BINARY, source CLOB DEFAULT '' COLLATE BINARY, details CLOB DEFAULT NULL COLLATE BINARY, creation DATETIME DEFAULT NULL, nid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE, PRIMARY KEY(id_prim))': SQLSTATE[HY000]:

General error: 1 table "oc_social_3_cache_actor" has more than one primary key
1. to develop backend bug

Most helpful comment

Hi, I've just upgraded to Nextcloud 20.0.1, and also updated the social app, to version 0.4.1. Unfortunately, if I try to enable the app, I get this error:
An exception occurred while executing 'DROP INDEX oc_social_3_cache_actor_pkey': SQLSTATE[2BP01]: Dependent objects still exist: 7 ERROR: cannot drop index oc_social_3_cache_actor_pkey because constraint oc_social_3_cache_actor_pkey on table oc_social_3_cache_actor requires it HINT: You can drop constraint oc_social_3_cache_actor_pkey on table oc_social_3_cache_actor instead.
This seems the same error as #1093, but since it is now closed as duplicate I'm reporting it here, manly to say that this was not fixed in 0.4.1

All 7 comments

Fixed now, probably through #1041

I try to update my test instance from 0.3.1 to 0.4.0 and still get this error.

Nextcloud Version: 20.0.0
DB-Engine: SQLite

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_social_3_cache_actor (id_prim VARCHAR(128) NOT NULL COLLATE BINARY, id VARCHAR(1000) DEFAULT NULL COLLATE BINARY, type VARCHAR(31) DEFAULT '' COLLATE BINARY, account VARCHAR(127) DEFAULT '' COLLATE BINARY, local BOOLEAN DEFAULT '0' NOT NULL, following VARCHAR(1000) DEFAULT '' COLLATE BINARY, followers VARCHAR(1000) DEFAULT '' COLLATE BINARY, inbox VARCHAR(1000) DEFAULT '' COLLATE BINARY, shared_inbox VARCHAR(1000) DEFAULT '' COLLATE BINARY, outbox VARCHAR(1000) DEFAULT '' COLLATE BINARY, featured VARCHAR(1000) DEFAULT '' COLLATE BINARY, url VARCHAR(1000) DEFAULT '' COLLATE BINARY, preferred_username VARCHAR(127) DEFAULT '' COLLATE BINARY, name VARCHAR(127) DEFAULT '' COLLATE BINARY, icon_id VARCHAR(1000) DEFAULT '' COLLATE BINARY, summary CLOB DEFAULT '' COLLATE BINARY, public_key CLOB DEFAULT '' COLLATE BINARY, source CLOB DEFAULT '' COLLATE BINARY, details CLOB DEFAULT NULL COLLATE BINARY, creation DATETIME DEFAULT NULL, nid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE, PRIMARY KEY(id_prim))': SQLSTATE[HY000]: General error: 1 table "oc_social_3_cache_actor" has more than one primary key

@daita @icewind1991 can you re-investigate this? ^

were able to reproduce the issue. I'll work on a fix.

should be fixed in 0.4.1

That fix seems to have introduced a new bug for people upgrading from 0.4.0 to 0.4.1:

2020-10-20 14:36:43.551 UTC [14422] ERROR:  cannot drop index oc_social_3_cache_actor_pkey because constraint oc_social_3_cache_actor_pkey on table oc_social_3_cache_actor requires it
2020-10-20 14:36:43.551 UTC [14422] HINT:  You can drop constraint oc_social_3_cache_actor_pkey on table oc_social_3_cache_actor instead.
2020-10-20 14:36:43.551 UTC [14422] STATEMENT:  DROP INDEX oc_social_3_cache_actor_pkey

Hi, I've just upgraded to Nextcloud 20.0.1, and also updated the social app, to version 0.4.1. Unfortunately, if I try to enable the app, I get this error:
An exception occurred while executing 'DROP INDEX oc_social_3_cache_actor_pkey': SQLSTATE[2BP01]: Dependent objects still exist: 7 ERROR: cannot drop index oc_social_3_cache_actor_pkey because constraint oc_social_3_cache_actor_pkey on table oc_social_3_cache_actor requires it HINT: You can drop constraint oc_social_3_cache_actor_pkey on table oc_social_3_cache_actor instead.
This seems the same error as #1093, but since it is now closed as duplicate I'm reporting it here, manly to say that this was not fixed in 0.4.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jancborchardt picture jancborchardt  路  6Comments

jancborchardt picture jancborchardt  路  3Comments

sunjam picture sunjam  路  4Comments

maiki picture maiki  路  5Comments

Lurkars picture Lurkars  路  5Comments