Closed
Bug 1297765
Opened 8 years ago
Closed 7 years ago
cannot add permissions that don't have options set
Categories
(Release Engineering Graveyard :: Applications: Balrog (backend), defect, P1)
Release Engineering Graveyard
Applications: Balrog (backend)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bhearsum, Assigned: bhearsum)
References
Details
Attachments
(2 files)
Rail noticed this while trying to grant Johan admin permissions. In production, it shows up as a 502 (which is a bit strange). I was able to reproduce locally, and got: balrogadmin_1 | 2016-08-24 17:37:02,995 - DEBUG - PID: 102 - Request: 139838539774992 - Permissions.insert#1657: granting admin to foobar with options {} balrogadmin_1 | Traceback (most recent call last): balrogadmin_1 | File "./auslib/admin/views/base.py", line 69, in put balrogadmin_1 | return self._put(*args, transaction=trans, **kwargs) balrogadmin_1 | File "./auslib/admin/views/base.py", line 19, in decorated balrogadmin_1 | return f(*args, changed_by=username, **kwargs) balrogadmin_1 | File "./auslib/admin/views/permissions.py", line 57, in _put balrogadmin_1 | dbo.permissions.insert(changed_by, transaction=transaction, username=username, permission=permission, options=form.options.data) balrogadmin_1 | File "./auslib/db.py", line 1658, in insert balrogadmin_1 | super(Permissions, self).insert(changed_by=changed_by, transaction=transaction, **columns) balrogadmin_1 | File "./auslib/db.py", line 325, in insert balrogadmin_1 | return self._prepareInsert(transaction, changed_by, **columns) balrogadmin_1 | File "./auslib/db.py", line 301, in _prepareInsert balrogadmin_1 | ret = trans.execute(query) balrogadmin_1 | File "./auslib/db.py", line 122, in execute balrogadmin_1 | return self.conn.execute(statement) balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1358, in execute balrogadmin_1 | params) balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1491, in _execute_clauseelement balrogadmin_1 | compiled_sql, distilled_params balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1599, in _execute_context balrogadmin_1 | context) balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1592, in _execute_context balrogadmin_1 | context) balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 325, in do_execute balrogadmin_1 | cursor.execute(statement, parameters) balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute balrogadmin_1 | self.errorhandler(self, exc, value) balrogadmin_1 | File "/usr/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler balrogadmin_1 | raise errorclass, errorvalue balrogadmin_1 | TransactionError: ('(ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'}, 1)\' at line 1")',) If I hack the code and remove "options" from what's about to get inserted, it works fine. Without that hack, I can still add permissions as long as they have "options" set. This is likely a regression from https://bugzilla.mozilla.org/show_bug.cgi?id=1246675.
Comment 2•8 years ago
|
||
Comment on attachment 8787285 [details] [review] fix default value for options lgtm
Attachment #8787285 -
Flags: review?(rail) → review+
Comment 3•8 years ago
|
||
Commit pushed to master at https://github.com/mozilla/balrog https://github.com/mozilla/balrog/commit/49dd520555c18d68b4f11c4c29b5c07849095452 bug 1297765: Use different default value for permission options. (#117). r=rail
Assignee | ||
Comment 4•8 years ago
|
||
This made it to production today.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•7 years ago
|
||
I don't think this worked - I hit it again in stage today.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 6•7 years ago
|
||
Upon further investigation, it looks like this regressed when we switched to swagger/connexion.
Attachment #8920184 -
Flags: review?(rail)
Assignee | ||
Updated•7 years ago
|
Priority: -- → P1
Updated•7 years ago
|
Attachment #8920184 -
Flags: review?(rail) → review+
Assignee | ||
Updated•7 years ago
|
Status: REOPENED → RESOLVED
Closed: 8 years ago → 7 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Product: Release Engineering → Release Engineering Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•