inveniosoftware / inveniosoftware/invenio-cli

inconsistent state unhandled by services setup

Open
#238 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
14
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Package version (if known): invenio-cli, version 0.23.0 (python 3.7.1, using postgresql as db)

## Describe the bug

An inconsistent state makes `services setup` (and `service setup --force`) fail at an intermediate point during the db setup (even if the table creation successes). When this happens, the workaround is to delete the psql docker container and re run `services setup` to recreate it.

## Steps to Reproduce
1. Run
```bash
invenio-cli init rdm
cd my-site/
invenio-cli install
invenio-cli services setup
```

```
[...]
Creating admin role...
[2021-04-15 11:05:06,902] WARNING in ext: JSONSCHEMAS_HOST is set to localhost
[2021-04-15 11:05:09,624] WARNING in ext: JSONSCHEMAS_HOST is set to localhost
Role "admin" created successfully.
[...]
sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "uq_accounts_role_name"
DETAIL: Key (name)=(admin) already exists.

[SQL: INSERT INTO accounts_role (name, description) VALUES (%(name)s, %(description)s) RETURNING accounts_role.id]
[parameters: {'name': 'admin', 'description': None}]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
Failed to setup services.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.