Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bodhi randomly throws "NoSuchColumnError testcases.id" server errors for various queries #4302

Closed
decathorpe opened this issue Nov 29, 2021 · 10 comments · Fixed by #4304
Closed

Comments

@decathorpe
Copy link

This looks like a continuation of the #4287 saga but with a different database table / column involved:

{
    errors: [
        {
            "name": "NoSuchColumnError",
            "location": "body",
            "description": "Could not locate column in row for column 'testcases.id'"
        },
    ],
    status: "error"
}

This seems to happen at about the same frequency as the "bugs.id" problem that happened before bodhi 5.7.2 was deployed.

@AdamSaleh
Copy link
Contributor

Damn it. I never see problems like this when I test on staging. Looking into it.

@mattiaverga
Copy link
Contributor

@AdamSaleh can you please deploy this commit as a hotfix in prod:

diff --git a/bodhi/server/models.py b/bodhi/server/models.py
index c2506cc2..7f669904 100644
--- a/bodhi/server/models.py
+++ b/bodhi/server/models.py
@@ -1918,8 +1918,8 @@ class Update(Base):
 
     # One-to-many relationships
     comments = relationship('Comment', backref='update', cascade="all,delete,delete-orphan",
-                            order_by='Comment.timestamp')
-    builds = relationship('Build', backref='update', order_by='Build.nvr')
+                            order_by='Comment.timestamp', lazy='joined')
+    builds = relationship('Build', backref='update', order_by='Build.nvr', lazy='joined')
 
     # Many-to-many relationships
     bugs = relationship('Bug', secondary=update_bug_table, backref='updates', order_by='Bug.bug_id')

It partially reverts what I've done in #4048 , let's see if it can help... otherwise we'll need someone with a lot of experience in sqlalchemy to review our relationship joins...

@AdamSaleh
Copy link
Contributor

ok, and I definitely need to add something like this to my pre-release checklist. Because while I will try to deploy the fix asap, I am very annoyed that I can't reliably reproduce the damn thing.

AdamSaleh added a commit to AdamSaleh/bodhi that referenced this issue Nov 30, 2021
AdamSaleh added a commit to AdamSaleh/bodhi that referenced this issue Nov 30, 2021
Signed-off-by: Adam Saleh <asaleh@redhat.com>
@AdamSaleh
Copy link
Contributor

@mattiaverga PR here: #4303

@mattiaverga
Copy link
Contributor

ok, and I definitely need to add something like this to my pre-release checklist. Because while I will try to deploy the fix asap, I am very annoyed that I can't reliably reproduce the damn thing.

I assume this problem shows only when the db is under load or after some cache is full... I checked the logs yesterday 10 hours later you deployed 5.7.2 and there was no sign of the issue

@mattiaverga
Copy link
Contributor

@mattiaverga PR here: #4303

Can't we just deploy the patch through ansible to see if it's effective, rather than committing to git branch?

@AdamSaleh
Copy link
Contributor

Ok, will try to deploy from my branch

@AdamSaleh
Copy link
Contributor

Ok, hotfix is running in prod

@mattiaverga
Copy link
Contributor

Thanks. I'm attending an online course now, so I'll check logs from time to time. Everything seems fine till now.

The PR will need some changes to the tests to get the pass (not sure why in some cases the build nvr order doesn't seem to be honored, I had to change that also in my old PR).

@AdamSaleh
Copy link
Contributor

AdamSaleh commented Nov 30, 2021

Yes, had to disable those checks when building the image. Should be able to look into that/copy it from your old PR.

mattiaverga pushed a commit that referenced this issue Dec 5, 2021
Signed-off-by: Adam Saleh <asaleh@redhat.com>
mattiaverga pushed a commit that referenced this issue Dec 5, 2021
Signed-off-by: Adam Saleh <asaleh@redhat.com>
@mattiaverga mattiaverga linked a pull request Dec 5, 2021 that will close this issue
@mergify mergify bot closed this as completed in #4304 Dec 5, 2021
mergify bot pushed a commit that referenced this issue Dec 5, 2021
Signed-off-by: Adam Saleh <asaleh@redhat.com>
mergify bot pushed a commit that referenced this issue Dec 5, 2021
Signed-off-by: Adam Saleh <asaleh@redhat.com>
(cherry picked from commit b823b93)
mattiaverga pushed a commit that referenced this issue Dec 5, 2021
Signed-off-by: Adam Saleh <asaleh@redhat.com>
(cherry picked from commit b823b93)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants