Upgrade to Mastodon v4.2.0

Upgrade to Mastodon v4.2.0
Photo by Battenhall / Unsplash

Minor update of container without any issue by means of Docker compose YAML infrastructure and automated Portainer GitOps workflow.
v4.2.0
The following post installation updates had to be executed:

root@calypso:/opt/docker/mastodon# docker compose -f /opt/docker/mastodon/docker-compose.yml run --rm shell bundle exec rake db:migrate
I, [2023-09-28T16:44:15.674008 #7]  INFO -- : Migrating to AddTemplateToWebhooks (20230129023109)
== 20230129023109 AddTemplateToWebhooks: migrating ============================
[strong_migrations] DANGER: No lock timeout set
-- add_column(:webhooks, :template, :text)
   -> 0.0029s
== 20230129023109 AddTemplateToWebhooks: migrated (0.0050s) ===================

I, [2023-09-28T16:44:15.698162 #7]  INFO -- : Migrating to AddSettingsToUsers (20230215074327)
== 20230215074327 AddSettingsToUsers: migrating ===============================
[strong_migrations] DANGER: No lock timeout set
-- add_column(:users, :settings, :text)
   -> 0.0040s
== 20230215074327 AddSettingsToUsers: migrated (0.0050s) ======================

I, [2023-09-28T16:44:15.708133 #7]  INFO -- : Migrating to MoveUserSettings (20230215074423)
== 20230215074423 MoveUserSettings: migrating =================================
== 20230215074423 MoveUserSettings: migrated (0.0806s) ========================

I, [2023-09-28T16:44:15.796624 #7]  INFO -- : Migrating to CreateBulkImports (20230330135507)
== 20230330135507 CreateBulkImports: migrating ================================
[strong_migrations] DANGER: No lock timeout set
-- create_table(:bulk_imports)
   -> 0.0365s
-- add_index(:bulk_imports, [:id], {:name=>:index_bulk_imports_unconfirmed, :where=>"state = 0"})
   -> 0.0048s
== 20230330135507 CreateBulkImports: migrated (0.0432s) =======================

I, [2023-09-28T16:44:15.847520 #7]  INFO -- : Migrating to CreateBulkImportRows (20230330140036)
== 20230330140036 CreateBulkImportRows: migrating =============================
[strong_migrations] DANGER: No lock timeout set
-- create_table(:bulk_import_rows)
   -> 0.0096s
== 20230330140036 CreateBulkImportRows: migrated (0.0109s) ====================

I, [2023-09-28T16:44:15.870526 #7]  INFO -- : Migrating to AddFollowRequestIdToListAccounts (20230330155710)
== 20230330155710 AddFollowRequestIdToListAccounts: migrating =================
[strong_migrations] DANGER: No lock timeout set
-- add_reference(:list_accounts, :follow_request, {:foreign_key=>{:on_delete=>:cascade}, :index=>false})
   -> 0.0066s
-- add_index(:list_accounts, :follow_request_id, {:algorithm=>:concurrently, :where=>"follow_request_id IS NOT NULL"})
   -> 0.0076s
== 20230330155710 AddFollowRequestIdToListAccounts: migrated (0.0162s) ========

I, [2023-09-28T16:44:15.891938 #7]  INFO -- : Migrating to AddIndexAccountsOnDomainAndId (20230524190515)
== 20230524190515 AddIndexAccountsOnDomainAndId: migrating ====================
[strong_migrations] DANGER: No lock timeout set
-- add_index(:accounts, [:domain, :id], {:name=>:index_accounts_on_domain_and_id, :algorithm=>:concurrently})
   -> 0.6189s
== 20230524190515 AddIndexAccountsOnDomainAndId: migrated (0.6199s) ===========

I, [2023-09-28T16:44:16.516039 #7]  INFO -- : Migrating to FixAccountDomainCasing (20230524192812)
== 20230524192812 FixAccountDomainCasing: migrating ===========================
[strong_migrations] DANGER: No lock timeout set
-- execute("UPDATE accounts SET domain = lower(domain) WHERE domain IS NOT NULL AND domain != lower(domain)")
   -> 0.0960s
== 20230524192812 FixAccountDomainCasing: migrated (0.0967s) ==================

I, [2023-09-28T16:44:16.616364 #7]  INFO -- : Migrating to AddIndexInstancesOnReverseDomain (20230524194155)
== 20230524194155 AddIndexInstancesOnReverseDomain: migrating =================
[strong_migrations] DANGER: No lock timeout set
-- add_index(:instances, "reverse('.' || domain), domain", {:name=>:index_instances_on_reverse_domain, :algorithm=>:concurrently})
   -> 0.0215s
== 20230524194155 AddIndexInstancesOnReverseDomain: migrated (0.0221s) ========

I, [2023-09-28T16:44:16.641659 #7]  INFO -- : Migrating to AddPrimaryKeyToAccountsTagsJoinTable (20230531153942)
== 20230531153942 AddPrimaryKeyToAccountsTagsJoinTable: migrating =============
[strong_migrations] DANGER: No lock timeout set
-- execute("ALTER TABLE accounts_tags ADD PRIMARY KEY USING INDEX index_accounts_tags_on_tag_id_and_account_id")
   -> 0.0008s
-- execute("ALTER INDEX index_accounts_tags_on_tag_id_and_account_id RENAME TO accounts_tags_pkey")
   -> 0.0006s
== 20230531153942 AddPrimaryKeyToAccountsTagsJoinTable: migrated (0.0028s) ====

I, [2023-09-28T16:44:16.647256 #7]  INFO -- : Migrating to AddPrimaryKeyToStatusesTagsJoinTable (20230531154811)
== 20230531154811 AddPrimaryKeyToStatusesTagsJoinTable: migrating =============
[strong_migrations] DANGER: No lock timeout set
-- execute("ALTER TABLE statuses_tags ADD PRIMARY KEY USING INDEX index_statuses_tags_on_tag_id_and_status_id")
   -> 0.0012s
-- execute("ALTER INDEX index_statuses_tags_on_tag_id_and_status_id RENAME TO statuses_tags_pkey")
   -> 0.0005s
== 20230531154811 AddPrimaryKeyToStatusesTagsJoinTable: migrated (0.0032s) ====

I, [2023-09-28T16:44:16.653424 #7]  INFO -- : Migrating to AddExclusiveToLists (20230605085710)
== 20230605085710 AddExclusiveToLists: migrating ==============================
[strong_migrations] DANGER: No lock timeout set
-- select_one("SELECT current_setting('server_version_num') AS v")
   -> 0.0004s
-- add_column(:lists, :exclusive, :boolean, {:default=>false, :limit=>nil, :null=>false})
   -> 0.0017s
== 20230605085710 AddExclusiveToLists: migrated (0.0028s) =====================

I, [2023-09-28T16:44:16.664741 #7]  INFO -- : Migrating to AddTimeZoneToUsers (20230605085711)
== 20230605085711 AddTimeZoneToUsers: migrating ===============================
[strong_migrations] DANGER: No lock timeout set
-- add_column(:users, :time_zone, :string)
   -> 0.0009s
== 20230605085711 AddTimeZoneToUsers: migrated (0.0016s) ======================

I, [2023-09-28T16:44:16.669725 #7]  INFO -- : Migrating to AddIndexBackupsOnUserId (20230630145300)
== 20230630145300 AddIndexBackupsOnUserId: migrating ==========================
[strong_migrations] DANGER: No lock timeout set
-- add_index(:backups, :user_id, {:algorithm=>:concurrently})
   -> 0.0037s
== 20230630145300 AddIndexBackupsOnUserId: migrated (0.0044s) =================

I, [2023-09-28T16:44:16.677386 #7]  INFO -- : Migrating to AddSuperappIndexToApplications (20230702131023)
== 20230702131023 AddSuperappIndexToApplications: migrating ===================
[strong_migrations] DANGER: No lock timeout set
-- add_index(:oauth_applications, :superapp, {:where=>"superapp = true", :algorithm=>:concurrently})
   -> 0.0037s
== 20230702131023 AddSuperappIndexToApplications: migrated (0.0042s) ==========

I, [2023-09-28T16:44:16.684492 #7]  INFO -- : Migrating to AddIndexUserOnUnconfirmedEmail (20230702151753)
== 20230702151753 AddIndexUserOnUnconfirmedEmail: migrating ===================
[strong_migrations] DANGER: No lock timeout set
-- add_index(:users, :unconfirmed_email, {:where=>"unconfirmed_email IS NOT NULL", :algorithm=>:concurrently})
   -> 0.0035s
== 20230702151753 AddIndexUserOnUnconfirmedEmail: migrated (0.0042s) ==========

I, [2023-09-28T16:44:16.691821 #7]  INFO -- : Migrating to AddPublishedAtToPreviewCards (20230724160715)
== 20230724160715 AddPublishedAtToPreviewCards: migrating =====================
[strong_migrations] DANGER: No lock timeout set
-- add_column(:preview_cards, :published_at, :datetime)
   -> 0.0007s
== 20230724160715 AddPublishedAtToPreviewCards: migrated (0.0013s) ============

I, [2023-09-28T16:44:16.696411 #7]  INFO -- : Migrating to AddImageDescriptionToPreviewCards (20230725213448)
== 20230725213448 AddImageDescriptionToPreviewCards: migrating ================
[strong_migrations] DANGER: No lock timeout set
-- select_one("SELECT current_setting('server_version_num') AS v")
   -> 0.0004s
-- add_column(:preview_cards, :image_description, :string, {:default=>"", :limit=>nil, :null=>false})
   -> 0.0018s
== 20230725213448 AddImageDescriptionToPreviewCards: migrated (0.0028s) =======

I, [2023-09-28T16:44:16.702636 #7]  INFO -- : Migrating to AddUniqueIndexOnPreviewCardsStatuses (20230803082451)
== 20230803082451 AddUniqueIndexOnPreviewCardsStatuses: migrating =============
[strong_migrations] DANGER: No lock timeout set
-- add_index(:preview_cards_statuses, [:status_id, :preview_card_id], {:name=>:preview_cards_statuses_pkey, :algorithm=>:concurrently, :unique=>true})
-- select_all("SELECT status_id FROM preview_cards_statuses GROUP BY status_id HAVING count(*) > 1;")
   -> 0.1200s
-- execute("DELETE FROM preview_cards_statuses p WHERE p.status_id IN (109563987413567160, 109772463200074591, 109840022963690854, 110027278187207107, 110229711275280726, 110463980511273773, 110537735768485870, 110791488426065800) AND p.ctid NOT IN (SELECT q.ctid FROM preview_cards_statuses q WHERE q.status_id = p.status_id LIMIT 1)")
   -> 0.0018s
-- select_one("SELECT current_setting('server_version_num') AS v")
   -> 0.0006s
-- execute("REINDEX INDEX CONCURRENTLY preview_cards_statuses_pkey")
   -> 0.1088s
== 20230803082451 AddUniqueIndexOnPreviewCardsStatuses: migrated (0.2680s) ====

I, [2023-09-28T16:44:16.974177 #7]  INFO -- : Migrating to AddPrimaryKeyToPreviewCardsStatusesJoinTable (20230803112520)
== 20230803112520 AddPrimaryKeyToPreviewCardsStatusesJoinTable: migrating =====
[strong_migrations] DANGER: No lock timeout set
-- execute("ALTER TABLE preview_cards_statuses ADD PRIMARY KEY USING INDEX preview_cards_statuses_pkey")
   -> 0.0010s
== 20230803112520 AddPrimaryKeyToPreviewCardsStatusesJoinTable: migrated (0.0015s)

I, [2023-09-28T16:44:16.978644 #7]  INFO -- : Migrating to RemoveIndexPreviewCardsStatusesOnStatusIdAndPreviewCardId (20230811103651)
== 20230811103651 RemoveIndexPreviewCardsStatusesOnStatusIdAndPreviewCardId: migrating
[strong_migrations] DANGER: No lock timeout set
-- remove_index(:preview_cards_statuses, {:column=>[:status_id, :preview_card_id], :name=>:index_preview_cards_statuses_on_status_id_and_preview_card_id})
   -> 0.0069s
== 20230811103651 RemoveIndexPreviewCardsStatusesOnStatusIdAndPreviewCardId: migrated (0.0074s)

I, [2023-09-28T16:44:16.988908 #7]  INFO -- : Migrating to AddIndexableToAccounts (20230814223300)
== 20230814223300 AddIndexableToAccounts: migrating ===========================
[strong_migrations] DANGER: No lock timeout set
-- select_one("SELECT current_setting('server_version_num') AS v")
   -> 0.0004s
-- add_column(:accounts, :indexable, :boolean, {:default=>false, :limit=>nil, :null=>false})
   -> 0.0017s
== 20230814223300 AddIndexableToAccounts: migrated (0.0027s) ==================

I, [2023-09-28T16:44:16.994638 #7]  INFO -- : Migrating to CreateGlobalFollowRecommendations (20230818141056)
== 20230818141056 CreateGlobalFollowRecommendations: migrating ================
[strong_migrations] DANGER: No lock timeout set
-- create_view(:global_follow_recommendations, {:materialized=>{:no_data=>true}})
   -> 0.0098s
-- add_index(:global_follow_recommendations, :account_id, {:unique=>true})
   -> 0.0024s
== 20230818141056 CreateGlobalFollowRecommendations: migrated (0.0130s) =======

I, [2023-09-28T16:44:17.010835 #7]  INFO -- : Migrating to DropFollowRecommendations (20230818142253)
== 20230818142253 DropFollowRecommendations: migrating ========================
[strong_migrations] DANGER: No lock timeout set
-- drop_view(:follow_recommendations, {:materialized=>true})
   -> 0.0037s
== 20230818142253 DropFollowRecommendations: migrated (0.0045s) ===============

I, [2023-09-28T16:44:17.019121 #7]  INFO -- : Migrating to CreateSoftwareUpdates (20230822081029)
== 20230822081029 CreateSoftwareUpdates: migrating ============================
[strong_migrations] DANGER: No lock timeout set
-- create_table(:software_updates)
   -> 0.0065s
-- add_index(:software_updates, :version, {:unique=>true})
   -> 0.0019s
== 20230822081029 CreateSoftwareUpdates: migrated (0.0098s) ===================

I, [2023-09-28T16:44:17.031521 #7]  INFO -- : Migrating to FixKmrLocaleSettings (20230904134623)
== 20230904134623 FixKmrLocaleSettings: migrating =============================
== 20230904134623 FixKmrLocaleSettings: migrated (0.0218s) ====================

I, [2023-09-28T16:44:17.056838 #7]  INFO -- : Migrating to AddIndexAccountStatsOnLastStatusAtAndAccountId (20230907150100)
== 20230907150100 AddIndexAccountStatsOnLastStatusAtAndAccountId: migrating ===
[strong_migrations] DANGER: No lock timeout set
-- add_index(:account_stats, [:last_status_at, :account_id], {:order=>{:last_status_at=>"DESC NULLS LAST"}, :algorithm=>:concurrently})
   -> 0.0835s
== 20230907150100 AddIndexAccountStatsOnLastStatusAtAndAccountId: migrated (0.0840s)

root@calypso:/opt/docker/mastodon# docker compose up -d
[+] Running 12/12
 ⠿ Container mastodon-elasticsearch-1            Running                                                                                                                           0.0s
 ⠿ Container mastodon-statsd-exporter-1          Running                                                                                                                           0.0s
 ⠿ Container mastodon-redis-1                    Running                                                                                                                           0.0s
 ⠿ Container mastodon-redis-volatile-1           Running                                                                                                                           0.0s
 ⠿ Container mastodon-redis-exporter-1           Running                                                                                                                           0.0s
 ⠿ Container mastodon-postgresql-1               Running                                                                                                                           0.0s
 ⠿ Container mastodon-streaming-1                Started                                                                                                                           1.2s
 ⠿ Container mastodon-redis-volatile-exporter-1  Running                                                                                                                           0.0s
 ⠿ Container mastodon-shell-1                    Started                                                                                                                           1.5s
 ⠿ Container mastodon-postgresql-exporter-1      Running                                                                                                                           0.0s
 ⠿ Container mastodon-website-1                  Started                                                                                                                           1.5s
 ⠿ Container mastodon-sidekiq-1                  Started                                                                                                                           2.3s
root@calypso:/opt/docker/mastodon# docker compose -f /opt/docker/mastodon/docker-compose.yml run --rm shell tootctl search deploy --only=instances accounts statuses
Done! 409346/409346 |=====================================================================================================================================| Time: 00:00:54 (7580 docs/s)
Indexed 68531 records, de-indexed 0
root@calypso:/opt/docker/mastodon# docker compose -f /opt/docker/mastodon/docker-compose.yml run --rm shell tootctl search deploy --reset-chewy
Done! 805884/805884 |=====================================================================================================================================| Time: 00:01:29 (9054 docs/s)
Indexed 126461 records, de-indexed 0
Me on Mastodon - This link is here for verification purposes.