Note: There are a few cases of duplicates in user autocompletion which are being worked on.

cannot add permissions that don't have options set



Release Engineering
Balrog: Backend
11 months ago
10 months ago


(Reporter: bhearsum, Assigned: bhearsum)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



11 months ago
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/", line 69, in put
balrogadmin_1 |     return self._put(*args, transaction=trans, **kwargs)
balrogadmin_1 |   File "./auslib/admin/views/", line 19, in decorated
balrogadmin_1 |     return f(*args, changed_by=username, **kwargs)
balrogadmin_1 |   File "./auslib/admin/views/", line 57, in _put
balrogadmin_1 |     dbo.permissions.insert(changed_by, transaction=transaction, username=username, permission=permission,
balrogadmin_1 |   File "./auslib/", line 1658, in insert
balrogadmin_1 |     super(Permissions, self).insert(changed_by=changed_by, transaction=transaction, **columns)
balrogadmin_1 |   File "./auslib/", line 325, in insert
balrogadmin_1 |     return self._prepareInsert(transaction, changed_by, **columns)
balrogadmin_1 |   File "./auslib/", line 301, in _prepareInsert
balrogadmin_1 |     ret = trans.execute(query)
balrogadmin_1 |   File "./auslib/", line 122, in execute
balrogadmin_1 |     return self.conn.execute(statement)
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1358, in execute
balrogadmin_1 |     params)
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1491, in _execute_clauseelement
balrogadmin_1 |     compiled_sql, distilled_params
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1599, in _execute_context
balrogadmin_1 |     context)
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1592, in _execute_context
balrogadmin_1 |     context)
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 325, in do_execute
balrogadmin_1 |     cursor.execute(statement, parameters)
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/MySQLdb/", line 174, in execute
balrogadmin_1 |     self.errorhandler(self, exc, value)
balrogadmin_1 |   File "/usr/local/lib/python2.7/site-packages/MySQLdb/", 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

Comment 1

11 months ago
Created attachment 8787285 [details] [review]
fix default value for options
Attachment #8787285 - Flags: review?(rail)
Comment on attachment 8787285 [details] [review]
fix default value for options

Attachment #8787285 - Flags: review?(rail) → review+

Comment 3

11 months ago
Commit pushed to master at
bug 1297765: Use different default value for permission options. (#117). r=rail


10 months ago
Depends on: 1302450

Comment 4

10 months ago
This made it to production today.
Last Resolved: 10 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.