mozilla / release-services

Mozilla Release Engineering Services
https://docs.mozilla-releng.net
Mozilla Public License 2.0
49 stars 93 forks source link

ship-it db doesn't initialize on master #2258

Closed nthomas-mozilla closed 5 years ago

nthomas-mozilla commented 5 years ago

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.

nthomas-mozilla commented 5 years ago

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

nthomas-mozilla commented 5 years ago

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

bhearsum commented 5 years ago

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