Error 1062: Duplicate entry 'usermeta-tags' for key 'namespace'

Fresh/latest install of Cells 2.0.4,
CentOS Linux release 7.7.1908 (Core) [Minimal],
MariaDB 10.4.12 (Local).

Example: Installer fails to complete if the user misunderstands the use of Internal/External address in a non-proxied environment. The easiest path forward is to attempt to reinstall.

rm -r ~/.config/pydio/cells
./cells install

Once the installer completes successfully, the following errors occur on startup:

INFO	pydio.grpc.user-meta	started
INFO	pydio.grpc.user-meta	Inserting default namespace for metadata
ERROR	pydio.grpc.user-meta	could not initialise service at version 2.0.4	{"error": "Error 1062: Duplicate entry 'usermeta-tags' for key 'namespace'"}
ERROR	pydio.grpc.user-meta	Could not run 	{"error": "Error 1062: Duplicate entry 'usermeta-tags' for key 'namespace'"}
INFO	pydio.grpc.user-meta	stopping

If these errors go unnoticed, error alerts will appear for the user while using the application until user-meta service is restored. The easiest way to correct the issue is to delete all rows in idm_usr_meta_ns table before running another reinstall as above.

If a reinstall is not possible, stop the server, delete the ‘idm_usr_meta_ns’ table and recreate it as per /idm/meta/namespace/migrations/mysql/0.1.sql:

CREATE TABLE IF NOT EXISTS idm_usr_meta_ns (
    namespace	VARCHAR(255) NOT NULL,
    label		VARCHAR(255) NOT NULL,
    ns_order	INT NOT NULL,
    indexable	TINYINT(1),
    definition	BLOB,
    UNIQUE (namespace)
);

The server should now start error free and user-meta (custom tags) should be working as expected.

Ideally, it would be nice if the installer could detect that an existing database exists and warn the user, or even handle the idm_usr_meta_ns table gracefully, but my knowledge is limited and I do not understand what implications this has on more complex configurations with multiple servers or distributed services. Hopefully this helps new users experiencing Error 1062.

Hello @bnmatrx,

When you install Cells there is a database named cells (if you did not change its name) that is created, when ou reinstall make sure to clean the database with the folder under ~/.config .

The duplicate error might be that the database was already filled with a usermeta-tags and it attempted to create on but could not.

edit: we are actually working on the installer to add a database detection to avoid experiencing that.