mozilla/release-services

ship-it db doesn't initialize on master

nthomas-mozilla opened this issue · 3 comments

For a fresh release-services clone (in Ubuntu 18.04 in docker mode) I can init the db on v60 with

./please run postgresql
./please run shipit/api   --taskcluster-client-id=$TASKCLUSTER_CLIENT_ID --taskcluster-access-token=$TASKCLUSTER_ACCESS_TOKEN   --taskcluster-secret repo:github.com/mozilla-releng/services:branch:master

but this doesn't work with master@dcb4f26b1fb5d7926bbd0d519256b170aed5c81f. There's an error related to keys and unique constraints from sqlalchemy in the log for shipit/api:

Traceback (most recent call last):
  File "/nix/store/h8qjk4c8if8z0kccsx2dqvnbbn0xg4qv-python3.7-SQLAlchemy-1.3.1/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/nix/store/h8qjk4c8if8z0kccsx2dqvnbbn0xg4qv-python3.7-SQLAlchemy-1.3.1/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
    cursor.execute(statement, parameters)
psycopg2.IntegrityError: duplicate key value violates unique constraint "pg_type_typname_nsp_index"
DETAIL:  Key (typname, typnamespace)=(shipit_api_releases_id_seq, 2200) already exists.

The log for postgresql has ERROR: relation "shipit_api_releases" already exists.

I've tried to bisect to find the change which causes this but there's something intermittent, or my noobie steps aren't reliable.

Creating the db isn't reliable on v60 either, halp!

Rail says this is a known issue, and you just retry until it works.

This works correctly in https://github.com/mozilla-releng/shipit, which will be the new official home for Ship It soon.