AnsweredAssumed Answered

Existing 201707 install, suddenly unable to create any sites

Question asked by xarope on Apr 16, 2018

Just recently (a few days) ago, my alfresco installation has suddenly started having errors when creating any sites.

The error is:

2018-04-16 10:24:47,841  ERROR [web.scripts.RepositoryContainer] [http-apr-8080-exec-2131] Server error (03164751)
 org.springframework.extensions.webscripts.WebScriptException: 03160966 Wrapped Exception (with status template): 03164750 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/site/sites.post.json.js':
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "alf_access_control_list_pkey"
  Detail: Key (id)=(54147) already exists.
### The error may exist in alfresco/ibatis/#resource.dialect#/permissions-insert-SqlMap.xml
### The error may involve alfresco.permissions.insert.insert_Acl-Inline
### The error occurred while setting parameters
### SQL: insert into alf_access_control_list             (id, version, acl_id, latest, acl_version, inherits, inherits_from,              type, inherited_acl, is_versioned, requires_version, acl_change_set)         values             (?, ?, ?, ?, ?, ?, ?,              ?, ?, ?, ?, ?)
### Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "alf_access_control_list_pkey"
  Detail: Key (id)=(54147) already exists.
; SQL []; ERROR: duplicate key value violates unique constraint "alf_access_control_list_pkey"
  Detail: Key (id)=(54147) already exists.; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "alf_access_control_list_pkey"
  Detail: Key (id)=(54147) already exists.

I can see in the alfresco database, that there is an existing entry for id=54147, and the contents are:

  id   | version |                acl_id                | latest | acl_version | inherits | inherits_from | type | inherited_acl | is_versioned | requires_version | acl_change_set
-------+---------+--------------------------------------+--------+-------------+----------+---------------+------+---------------+--------------+------------------+----------------
 54147 |       8 | 26871c72-7e86-49f7-8dd7-ba043fe3ae9a | t      |           1 | f        |         54146 |    1 |         54148 | f            | f                |          13921

Does anybody know how does alfresco determine this alf_access_control_list.id, why is there such a duplicate, and how I can recover from this?  I've been running alfresco now for several years, users are still able to upload, download and delete documents, but no new sites are able to be created at all.

NB: I upgraded 5.2 from 201702 to 201707 in early March, and it has been working fine until now.

Outcomes