ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR: null value in column "released_at" violates not-null constraint
https://sentry.gitlab.net/gitlab/gitlabcom/issues/972182/
PG::NotNullViolation: ERROR: null value in column "released_at" violates not-null constraint
DETAIL: Failing row contains (1000215, v0.9.0, Release for tag v0.9.0, 14727994, 2016-12-22 17:59:37, 2016-12-22 17:59:37, null, null, null, Test Release, null, null).
active_record/connection_adapters/postgresql/database_statements.rb:75:in `async_exec'
@connection.async_exec(sql)
active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
@connection.async_exec(sql)
active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
yield
active_support/concurrency/share_lock.rb:187:in `yield_shares'
yield
active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
@lock.yield_shares(compatible: [:load]) do
...
(75 additional frame(s) were not displayed)
ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR: null value in column "released_at" violates not-null constraint
DETAIL: Failing row contains (1000215, v0.9.0, Release for tag v0.9.0, 14727994, 2016-12-22 17:59:37, 2016-12-22 17:59:37, null, null, null, Test Release, null, null).
: INSERT INTO releases ("name", "tag", "description", "created_at", "updated_at", "released_at", "project_id")
VALUES ('Test Release', 'v0.9.0', 'Release for tag v0.9.0', '2016-12-22 17:59:37', '2016-12-22 17:59:37', NULL, 14727994)
PG::NotNullViolation: ERROR: null value in column "released_at" violates not-null constraint
DETAIL: Failing row contains (1000215, v0.9.0, Release for tag v0.9.0, 14727994, 2016-12-22 17:59:37, 2016-12-22 17:59:37, null, null, null, Test Release, null, null).
: INSERT INTO releases ("name", "tag", "description", "created_at", "updated_at", "released_at", "project_id")
VALUES ('Test Release', 'v0.9.0', 'Release for tag v0.9.0', '2016-12-22 17:59:37', '2016-12-22 17:59:37', NULL, 14727994)
This is the same error as gitlab-foss#65194 (closed) which should have been fixed in gitlab-foss!31496 (merged)
Workaround
Check for draft releases in Github. Either delete or publish before import to GitLab.
Possible fix
per @stanhu from Slack thread (internal):
The fix should be simple, just assign today's date if there is none available. We should do it for data fields in the release importer
Edited by Cynthia "Arty" Ng