Upgrading from v2.5.2 to v2.7.1 caused data error


#1

Hello,

I had once successfully deployed mastodon v2.5.2 and recently tried to upgrade to v2.7.1.
I followd upgrading instructions Upgrading to a new release - Mastodon documentation and I could launch web server.
But when I tried to login as my account, following error occurs and server responds 500.

Feb 11 09:40:13 mastodon-web bundle[1764]: [44d2f6ba-701a-4cfb-b8a3-0d3bd5f6db50] method=POST path=/auth/sign_in format=html controller=Auth::SessionsController action=create status=500 error='ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR:  null value in column "id" violates not-null constraint
Feb 11 09:40:13 mastodon-web bundle[1764]: DETAIL:  Failing row contains (927d9fdbfb15fcb24d6d65cebb8beaea85107c51ccba5c0d83599807d5d5f11d, null, null, null, 2019-02-11 09:40:13.708661, read write follow, 1, null, 1).
Feb 11 09:40:13 mastodon-web bundle[1764]: : INSERT INTO "oauth_access_tokens" ("token", "created_at", "scopes", "application_id", "resource_owner_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"' duration=89.36 view=0.00 db=8.63
Feb 11 09:40:13 mastodon-web bundle[1764]: [44d2f6ba-701a-4cfb-b8a3-0d3bd5f6db50]
Feb 11 09:40:13 mastodon-web bundle[1764]: [44d2f6ba-701a-4cfb-b8a3-0d3bd5f6db50] ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR:  null value in column "id" violates not-null constraint
Feb 11 09:40:13 mastodon-web bundle[1764]: DETAIL:  Failing row contains (927d9fdbfb15fcb24d6d65cebb8beaea85107c51ccba5c0d83599807d5d5f11d, null, null, null, 2019-02-11 09:40:13.708661, read write follow, 1, null, 1).
Feb 11 09:40:13 mastodon-web bundle[1764]: : INSERT INTO "oauth_access_tokens" ("token", "created_at", "scopes", "application_id", "resource_owner_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"):

I think some illegal data was contaminated into DB but I am not sure about mastodon DB schemas. I want ideal to solve problem.


#2

Did you migrated the db or not?


#3

Yes I have migrated db. I ran following command

RAILS_ENV=production bundle exec rails db:migrate

#4

Check all services are active and Start them

systemctl start mastodon-web && systemctl start mastodon-streaming && systemctl start mastodon-sidekiq


#5

Of course I started server softwares.

For additional info, my instance works fine except sign in. It means I can see user’s page (ex. https://mastodon.hostname/@tackman shows as expected)