inveniosoftware / troubleshooting

DEPRECATED - Use the forum instead:
https://invenio-talk.web.cern.ch
5 stars 4 forks source link

deposit: null value in column "default_location" violates not-null constraint #5

Open hachreak opened 7 years ago

hachreak commented 7 years ago

Problem

If you install deposit and try to create a new one without configure the location where save the files you'll encounter the error:

web_1 | Error on request:
web_1 | Traceback (most recent call last):
[...]
web_1 | sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) null value in column "default_location" violates not-null constraint
web_1 | DETAIL: Failing row contains (2017-03-30 14:27:21.449596, 2017-03-30 14:27:21.449603, 0f2b474a-1082-4de8-85f0-969c967fe5f2, null, S, 0, null, null, f, f).
web_1 | [SQL: 'INSERT INTO files_bucket (created, updated, id, default_location, default_storage_class, size, quota_size, max_file_size, locked, deleted) VALUES (%(created)s, %(updated)s, %(id)s, %(default_location)s, %(default_storage_class)s, %(size)s, %(quota_size)s, %(max_file_size)s, %(locked)s, %(deleted)s)'] [parameters: {'locked': False, 'size': 0, 'created': datetime.datetime(2017, 3, 30, 14, 27, 21, 449596), 'default_storage_class': 'S', 'quota_size': None, 'id': UUID('0f2b474a-1082-4de8-85f0-969c967fe5f2'), 'max_file_size': None, 'updated': datetime.datetime(2017, 3, 30, 14, 27, 21, 449603), 'deleted': False, 'default_location': None}]

Solution

To resolve the problem, you can create a default one:

flask files location default /tmp --default