Rails 6.1 -> 7 gives 404 for ActionText attachments

Love you for this! So unfortunate to face this. Rails upgrades should not be like this. You save the day. Thanks!

1 Like

Rails upgrades should not be like this.

For sure they should not be. This difficult isn’t intended and we probably should make this easier. Can someone please open an issue explaining the problem on Sign in to GitHub · GitHub?

If the key generator default changed, it should not invalidate already existing keys. Rails has message rotators to make this upgrade easier and I’m not sure the rotator isn’t being used in this case.

1 Like

I had the same problem, but with ActiveModel used as attachables so I didn’t want to reencode all Trix text because there was no file to find.

In my case, the secret_key_base had been autogenerated and stored in encrypted credentials, and until 6.1 Rails would automatically pick it up.

In Rails 7 however, the secret_key_base lookup is a little different, and doesn’t automatically use a secret_key_base defined in credentials, resulting in different Encryptor settings, and thus different SGIDs. More details in the Github issue #51051.