Can't add media descriptions

I’m not sure what I’ve done (mistakes were made) but now I can upload media only if I don’t attach a media description. I also can’t edit existing posts to add media descriptions. I’ve tried turning logging all the way up to debug and nothing shows up in the logs, so I don’t even know how to troubleshoot this. The UI just pops up a message reading “Error: Failed to update media, try again.” The javascript console reports a 403 error on the uri api/v1/media/[NUMBER] (and the number doesn’t seem have an obvious correspondence with the media URL). How do I fix this?

I’d attach a debug log, but there’s nothing relevant in it!

Replying to myself to say that I found that the NUMBER in that uri is the ID in the object table. Uploaded media is getting saved to the right directory, and the corresponding item is created in the object table, but the item can’t be updated in the UI to add the media description (which is … the name value in the JSON data?). Why can’t that field be updated?

This turned out to be related to a specific mistake I made when trying to fix a broken configuration. I recreated my prod.secret.exs by exporting and editing my configuration, but I didn’t include the required Pleroma.Web.Endpoint declaration in the replacement file. After adding the declaration (copied from a backup) everything works as expected now.