yes I think that’s the problem. The llm reckons the code doesn’t handle a list of entries well, hence the 500 error.
Ok so does it look like we’re in Contribute > Bug territory?
I think it’s a bug, and I expect it’s a simple fix, but I don’t really understand the new categories. (And I personally wouldn’t submit code when I feel I don’t fully understand.)
There’s also the question of whether the state of your database comes from some other bug which also needs a fix.
As this topic has only had three contributors, a new bug report topic might be useful - if a moderator wishes to merge or recategorise, they can always do that.
Ok I hadn’t actually seen the Contribute > Bug category, or ever posted in it as far as I can remember, nor would I have the skill level to pinpoint bug / not a bug.
Plus, YES you are probably right, there could be some historical DB issues, that tripped this brittle point.
While there is a requirement to get the admin acc accessible again, sooner rather than later, I guess that remains in the lap of the gods, but at least we may have gotten to the source of the problem, so heres hoping!
Thanks for your help. ![]()
Also, I do wonder if this gives some credence to revoking the user admin status, changing to to moderator acc level, and this might bypass this issue on login.
I might test it out, after backing up things.
My concern is data loss or breaking things that I will have no idea how to check, if it seems ok and nothing error’s out. ![]()
You’re welcome. It’s been interesting.
Probably, there’s some tiny thing you could do in SQL to remove that duplicate entry, but I personally wouldn’t do that lightly.
It’s also possible, according to the llm, to use the rails console to update the ten line ruby function and harden it. That, at least, ought to be something safe, because a restart would reload the real ruby from disk.
I want to paste this to preserve it so I can close a tab - untested code from the llm, presented here as a monkey patch to apply in the rails console to a running system, but also containing an llm-suggested fix for this fragility which causes the oops:
# Re-open the CurrentUserSerializer to override the broken method
class CurrentUserSerializer < ApplicationSerializer
def has_new_upcoming_changes
last_visited = object.custom_fields["last_visited_upcoming_changes_at"]
# Extract string if cached as an array by the preloader
last_visited = last_visited.first if last_visited.is_a?(Array)
return false if last_visited.blank? && object.created_at < Discourse.site_creation_date + 1.hour
cutoff = last_visited.present? ? Time.zone.parse(last_visited.to_s) : object.created_at
UpcomingChangeEvent.added.not_backfilled.where("created_at > ?", cutoff).exists?
end
end
Revoking Admin
Actions apply to the original locked out admin user acc:
-
Revoke admin + Grants moderator = login failed/same error.
-
Revoke moderator
- first login (no error) but stalls on two-factor/signing-in spinning wheel
- Left it for about 10 mins (server was showing load uptick on login), still nothing
- however “active” users tab shows the user logged in Xm ago hmm

- Try second login in another (private) window which succeeds!
Next, using another admin acc Grant Admin to the signed in former admin user acc
- While logged in Admin update message arrives indicating success.
- Refresh page and Oops error appears once again
- Revoke admin again, refresh page and error is bypassed again
- Grant Moderator status
- Refreshed page, Oops error appeared.
- Revoke Moderation privs, restored access.
Bottom line user must be converted (via admin) to normal user status to have access.
A workaround for a admin user with blocked user account access due to Oops error, where there is an urgent need to read messages/chats and communicate with users but will not be able to access any specific admin categories or carry out any moderation duties.
While this does re-establish user acc access and communications, ultimately it does not solve the technical root of the problem as outlined in OP.
I can’t post in the “Git hang” topic as it’s closed as of Sept 28th, but while noticing some sluggish behaviour a few minutes ago I thought, oh maybe git is gone again and causing problems, and what do you know downdetector.com was showing a big outage spike for GitHub more or less at that moment. ![]()