Skip to content

mastodon: 4.6.8 -> 4.7.2 - #554800

Merged
SuperSandro2000 merged 1 commit into
NixOS:staging-nextfrom
erictapen:mastodon
Sep 25, 2026
Merged

SuperSandro2000 merged 1 commit into
NixOS:staging-nextfrom
erictapen:mastodon

Conversation

@erictapen

@erictapen erictapen commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Changelog: https://github.com/mastodon/mastodon/releases/tag/v4.7.0

Things done

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (update) This PR updates a package to a newer version 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Aug 20, 2026
@erictapen

Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 552623
Commit: 8191a53815af4e26429df7bcfab71ae9708c6285


aarch64-linux

✅ 1 package built:
  • mastodon

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Aug 20, 2026
@abhin4v

abhin4v commented Aug 21, 2026 •

Copy link
Copy Markdown

@erictapen the module code should be changed to add SKIP_POST_DEPLOYMENT_MIGRATIONS=true before the rails db:migrate line so that only pre deployment migrations are run. Otherwise the mastodon-init-db service will require hours to complete and may be timed out by systemd. At best this may cause long downtime, at worst a corrupted database. This is from the release note upgrade instructions.

@teutat3s teutat3s changed the title mastodon: 4.6.7 -> 4.7.0 mastodon: 4.6.6 -> 4.7.0 Aug 21, 2026
@erictapen

erictapen commented Aug 21, 2026 •

Copy link
Copy Markdown
Member Author

@abhin4v This is only true for large instances, and people operating these should read the NixOS release notes (therefore the entry) to understand the implications and take additional steps.

The goal of this module is always to require no manual steps for regular small instances. Asking everybody to manually run migrations would be against that goal. For 4.6.0 we did the same, btw.

@abhin4v

abhin4v commented Aug 21, 2026 •

Copy link
Copy Markdown

@erictapen I checked the actual migration files. I doubt they'll run under few minutes even for small instances. They migrate the accounts table that contains every account ever seen by an instance including the remote ones. My small instance of 15 users has over 300000 accounts. I estimate that the full migration to take tens of minutes, if not over an hour. I'll try to figure out a workaround if your call is to not change the service. Thanks.

Please note that the release notes for 4.6.0 do not mention long running migrations.

@erictapen

Copy link
Copy Markdown
Member Author

Mh good call, I didn't consider that this might not scale with the amount of local users on the instance but with the amount of federated users. The thing is, the module should work in a way so that not reading the release notes should always result in a functional system. An hour of downtime is still better than the service being guaranteed to crash because the migrations weren't applied.

So how about we add more precise NixOS release notes and make sure that mastodon-init-db never timeouts? Afaiu a oneshot service has TimeoutStartSec=infinity by default anyways, but maybe we should test this.

@abhin4v

abhin4v commented Aug 21, 2026 •

Copy link
Copy Markdown

That's an option. Alternatively, we can change the mastodon-init-db service to run only pre migrations by adding SKIP_POST_DEPLOYMENT_MIGRATIONS=true before rails db:migrate, and create a mastodon-db-migrate one-shot service that runs automatically after mastodon-init-db service, with exactly same content except the env var. I suspect now that Mastodon has this capability of pre and post migrations, they are going to use it in future versions too.

@erictapen
erictapen marked this pull request as draft August 21, 2026 14:40
@erictapen

Copy link
Copy Markdown
Member Author

I'll try to have a look at this on the weekend.

@sorz

sorz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 552623 Commit: 8191a53815af4e26429df7bcfab71ae9708c6285

aarch64-linux

✅ 1 package built:

Wrong PR number? nixpkgs-review pr 554800 failed on my machine.

Error logs
error: Cannot build '/nix/store/ii8a3pw5p59dnz6ya5s8cr6336yh3cqx-mastodon-modules-4.7.0.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/0cpm81zi3ylys8cm2zbmszzap3ayrjqq-mastodon-modules-4.7.0
       Last 25 log lines:
       > ➤ YN0000: ┌ Fetch step
       > ➤ YN0001: │ Error: typescript@patch:@typescript/typescript6@npm%3A6.0.2#optional!builtin<compat/typescript>::version=6.0.2&hash=5786d5: ENOENT: no such file or directory, lstat '/node_modules/typescript/lib/_tsc.js'
       >     at Bc (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:4:1321)
       >     at Object.vje (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:4:1589)
       >     at ps.lstatSync (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:148:205052)
       >     at ps.lstatPromise (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:148:204825)
       >     at bn.lstatPromise (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:9:2311)
       >     at k1 (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:718:9044)
       >     at mL (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:720:224)
       >     at rP.patchPackage (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:724:2073)
       >     at async S (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:197:1641)
       >     at async x (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:197:1981)
       > ➤ YN0001: │ Error: typescript@patch:typescript@npm%3A7.0.2#optional!builtin<compat/typescript>::version=7.0.2&hash=5786d5: ENOENT: no such file or directory, lstat '/node_modules/typescript/lib/_tsc.js'
       >     at Bc (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:4:1321)
       >     at Object.vje (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:4:1589)
       >     at ps.lstatSync (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:148:205052)
       >     at ps.lstatPromise (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:148:204825)
       >     at bn.lstatPromise (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:9:2311)
       >     at k1 (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:718:9044)
       >     at mL (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:720:224)
       >     at rP.patchPackage (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:724:2073)
       >     at async S (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:197:1641)
       >     at async x (/nix/store/wsbg2zr9l7f8sbh1f91x5zv22259f4gb-yarn-berry-offline-4.14.1/bin/yarn:197:1981)
       > ➤ YN0000: └ Completed in 1s 186ms
       > ➤ YN0000: · Failed with errors in 1s 427ms
       For full logs, run:
         nix log /nix/store/ii8a3pw5p59dnz6ya5s8cr6336yh3cqx-mastodon-modules-4.7.0.drv
error: Cannot build '/nix/store/vwgrhhn71jnmw1gjgnpr18m7qwiyiv6f-mastodon-4.7.0.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/crw3g1kngmi2ggjcdla2gx6daa15js7i-mastodon-4.7.0
error: Cannot build '/nix/store/py8vzn1rkjmk4j3w0150zmzsm4j0n07d-review-shell.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/w9mhwfh0vmay2hr0wxswhvpdv242x6za-review-shell

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/554800
--------- Report for 'x86_64-linux' ---------
1 package blacklisted:
tests.nixos-functions.nixos-test

1 package failed to build:
mastodon

1 package built:
nixpkgs-manual

@erictapen

Copy link
Copy Markdown
Member Author

Shit, thank you. This is blocked by #524710 then, cherry-picking the commit fixes the build.

@erictapen

Copy link
Copy Markdown
Member Author

create a mastodon-db-migrate one-shot service that runs automatically after mastodon-init-db service

Can you explain more what you mean by this? System activation will restart all changed units anyways, so there wouldn't any difference in downtime. And when switching on boot (e.g. when going to a new NixOS release) it wouldn't make any difference either.

I finally managed to run the migrations against a database dump of a small instance with around 50 active users (300k entries in the accounts table) and it took 7min on my laptop.

That's not nothing, but I would deem it acceptable enough for the average Mastodon instance.

@SuperSandro2000

Copy link
Copy Markdown
Member

I think we want to change the lockfile to the old lock format as the linked yarn-berry PR is pretty stale.

@sorz

sorz commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

The build error seems to be caused by a compatibility issue between TypeScript 7 and yarn < v4.17.1, see yarnpkg/berry#7190.

@DimitarNestorov DimitarNestorov mentioned this pull request Aug 23, 2026
8 of 13 tasks
@DimitarNestorov

Copy link
Copy Markdown
Member

The build error seems to be caused by a compatibility issue between TypeScript 7 and yarn < v4.17.1

Yarn update PR: #555729

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 6, 2026
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 15, 2026
@SuperSandro2000

Copy link
Copy Markdown
Member

There is already https://github.com/mastodon/mastodon/releases/tag/v4.7.2 in the time we fixed our yarn stuff :)

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 17, 2026
@SuperSandro2000 SuperSandro2000 changed the title mastodon: 4.6.6 -> 4.7.0 mastodon: 4.6.8 -> 4.7.2 Sep 24, 2026

@nixpkgs-ci nixpkgs-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to the documentation

Make sure you follow the documentation styleguide, most notably:

  • Show, don't tell: lead with a minimal working example; explanation follows the code.
  • No meta-commentary: don't write "This section explains how to…", just do it.
  • Imperative mood and active voice: "Run the command", not "The user should run the following command".
  • Present tense: "This creates a folder", not "This will create a folder".
  • Be confident: no hedging with "should", "might", "typically", "usually".
  • Cut filler words: "simply", "just", "easily", "basically"; "to", not "in order to".

For larger changes, like adding or removing whole sections, ask the NixOS documentation team for a review.

@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 24, 2026
@SuperSandroBot

This comment was marked as outdated.

@SuperSandro2000
SuperSandro2000 changed the base branch from master to staging-next September 24, 2026 19:37
@nixpkgs-ci nixpkgs-ci Bot closed this Sep 24, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this Sep 24, 2026
@SuperSandro2000
SuperSandro2000 marked this pull request as ready for review September 24, 2026 22:49
@SuperSandro2000

Copy link
Copy Markdown
Member

Tested on c3d2.social and works with the yarn update included.

@SuperSandro2000
SuperSandro2000 added this pull request to the merge queue Sep 25, 2026
Merged via the queue into NixOS:staging-next with commit 61a111f Sep 25, 2026
57 checks passed
@github-project-automation github-project-automation Bot moved this from ⚖ Needs refinement to ✅ Done in Nix documentation Sep 25, 2026
@teutat3s teutat3s mentioned this pull request Nov 1, 2026
2 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

6 participants