30

This question Php dosen't insert query into database shows a page with the message:

Oops! Something Bad Happened!

A moderator confirmed that this happened when they tried to close the question:

I broke that one a few minutes ago, trying to close it.

The moderator is clueless about how this might have happened:

I have no idea how I managed that.

I'm curious about what's going on here; I've never seen this before. I assume this must be a bug of some sort. Does anyone know how this happened?

9
  • 24
    [bug]: A moderator is clueless. How could this have happened?! Jan 25, 2021 at 23:56
  • 5
    @CodyGray I know. This has shaken my faith in the entire system. ;)
    – cigien
    Jan 25, 2021 at 23:57
  • You can see the revision history for it, and it has the really wide display for the original question (revision 1). Jan 26, 2021 at 0:20
  • @1201ProgramAlarm That’s this bug: Some question revision histories are rendered with a very wide width. It doesn’t feel related to this error message. Jan 26, 2021 at 0:25
  • I can now access the page... perhaps PHP is up to it's tricks again :)
    – 10 Rep
    Jan 26, 2021 at 2:42
  • 1
    It's clear to me that SO has finally decided to ban questions with typos in the title!
    – Nick
    Jan 26, 2021 at 3:19
  • 5
    If that's the button I managed to find on this question, @Nick, I will definitely look more carefully for it in the future! Jan 26, 2021 at 3:24
  • @CodyGray Yeah, maybe that should be a moderator/gold badge privilege. Perhaps a feature-request?
    – Nick
    Jan 26, 2021 at 3:25
  • 1
    You know it's bad when Glasses is clueless.
    – M--
    Jan 26, 2021 at 19:02

2 Answers 2

23

We had a ton of SQL timeouts right around the time when this question was closed (I'm not sure about the cause of those), so it looks like the close vote from Cody was cast and took effect, but the existing close flags weren’t resolved correctly. So we have two problems:

1. The flags have NULL columns that shouldn’t be NULL.
2. The code that constructs the “closed post” notice is supposed to fail gracefully, but doesn’t in this (admittedly abnormal) situation.

I fixed the first issue (gotta love manual prod DB updates). Looking into the second now, and I’ll check for any other posts that may be in the same situation.

Update: found two more affected posts on Stack Overflow (none on other sites) and fixed those up as well. The code change is in a PR awaiting review/approval and should go out sometime tomorrow to future-proof this for next time.

6
  • 3
    So... Wrap the whole thing in a transaction? Jan 26, 2021 at 22:07
  • 15
    @RobertHarvey I'm not sure we can ...commit... to that Jan 26, 2021 at 22:14
  • 8
    Glad I could help out! :-p In all seriousness, nice debugging, Adam, and thanks for the gory details, as always. Jan 26, 2021 at 22:28
  • 1
    @MarcGravell if you feel like indulging a curious person, why isn't it practical to do as a transaction? I'm sure there's a good reason, but my curiosity is piqued, and I always enjoy the backstories from fixed bugs.
    – Ryan M Mod
    Jan 26, 2021 at 23:34
  • 2
    @RyanM oh, it probably is; I'll take a look tomorrow, if it hasn't already been investigated; I was simply trying to add some levity - plus Adam is widely acknowledged as the grand master of puns at Stack, so it seemed especially fitting. Jan 26, 2021 at 23:36
  • Ah! Well, the pun was indeed fitting :-)
    – Ryan M Mod
    Jan 27, 2021 at 1:52
16

It seems that this bug only occurs for users who are able to view/cast close votes (3k+ rep).

A user in the comments with 2.3k rep can see the question, viewing it as a 1-rep sock account also shows the question just fine, and viewing it logged out works as well:

screenshot of question, as it appears (correctly) while logged out

However, viewing it from my account (just over 10k) shows the error instead, and another user with just over 3k also shows the error.

6
  • 6
    It's giving me an error, 3083 rep.
    – Joundill
    Jan 26, 2021 at 3:49
  • 2
    I can see it if I'm not logged in.
    – Joundill
    Jan 26, 2021 at 3:50
  • 4
    @Joundill Then cast-close-votes privilege it is. Ryan solved the mystery :)
    – 41686d6564
    Jan 26, 2021 at 3:53
  • 3
    Note, also, that the close vote review task fails to load for privileged users, but is visible for unprivileged users. Jan 26, 2021 at 4:50
  • 4
    "privileged users" --> Not so privileged anymore. Oh, @Cody, what have you done?! :D
    – 41686d6564
    Jan 26, 2021 at 5:15
  • 11
    I promised I would try my best to rid the garbage from this site, @41686d6564. What are you complaining about? Jan 26, 2021 at 5:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .