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

Can't add users via UI when using Postgres backend #622

Closed
greenape opened this issue Apr 15, 2019 · 1 comment · Fixed by #632
Closed

Can't add users via UI when using Postgres backend #622

greenape opened this issue Apr 15, 2019 · 1 comment · Fixed by #632
Labels
bug Something isn't working FlowAuth Issues related to FlowAuth

Comments

@greenape
Copy link
Member

Clicking the + button to add a new user in FlowAuth, when using a Postgres backend, bounces you back to the login screen.

Actual behind the scenes error:

flowauth_1                           | [2019-04-15 14:36:52,204] ERROR in app: Exception on /admin/users/false/groups [GET]
flowauth_1                           | Traceback (most recent call last):
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
flowauth_1                           |     cursor, statement, parameters, context
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
flowauth_1                           |     cursor.execute(statement, parameters)
flowauth_1                           | psycopg2.errors.InvalidTextRepresentation: invalid input syntax for integer: "false"
flowauth_1                           | LINE 3: WHERE "user".id = 'false'
flowauth_1                           |                           ^
flowauth_1                           |
flowauth_1                           |
flowauth_1                           | The above exception was the direct cause of the following exception:
flowauth_1                           |
flowauth_1                           | Traceback (most recent call last):
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
flowauth_1                           |     response = self.full_dispatch_request()
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
flowauth_1                           |     rv = self.handle_user_exception(e)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
flowauth_1                           |     reraise(exc_type, exc_value, tb)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
flowauth_1                           |     raise value
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
flowauth_1                           |     rv = self.dispatch_request()
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
flowauth_1                           |     return self.view_functions[rule.endpoint](**req.view_args)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask_login/utils.py", line 261, in decorated_view
flowauth_1                           |     return func(*args, **kwargs)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask_principal.py", line 199, in _decorated
flowauth_1                           |     rv = f(*args, **kw)
flowauth_1                           |   File "./flowauth/admin.py", line 777, in get_user_groups
flowauth_1                           |     user = User.query.filter(User.id == user_id).first_or_404()
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 425, in first_or_404
flowauth_1                           |     rv = self.first()
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3215, in first
flowauth_1                           |     ret = list(self[0:1])
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3007, in __getitem__
flowauth_1                           |     return list(res)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3317, in __iter__
flowauth_1                           |     return self._execute_and_instances(context)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3342, in _execute_and_instances
flowauth_1                           |     result = conn.execute(querycontext.statement, self._params)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
flowauth_1                           |     return meth(self, multiparams, params)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
flowauth_1                           |     return connection._execute_clauseelement(self, multiparams, params)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
flowauth_1                           |     distilled_params,
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
flowauth_1                           |     e, statement, parameters, cursor, context
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
flowauth_1                           |     util.raise_from_cause(sqlalchemy_exception, exc_info)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
flowauth_1                           |     reraise(type(exception), exception, tb=exc_tb, cause=cause)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
flowauth_1                           |     raise value.with_traceback(tb)
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
flowauth_1                           |     cursor, statement, parameters, context
flowauth_1                           |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
flowauth_1                           |     cursor.execute(statement, parameters)
flowauth_1                           | sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for integer: "false"
flowauth_1                           | LINE 3: WHERE "user".id = 'false'
flowauth_1                           |                           ^
flowauth_1                           |
flowauth_1                           | [SQL: SELECT "user".id AS user_id, "user".username AS user_username, "user"._password AS user__password, "user".is_admin AS user_is_admin
flowauth_1                           | FROM "user"
flowauth_1                           | WHERE "user".id = %(id_1)s
flowauth_1                           |  LIMIT %(param_1)s]
flowauth_1                           | [parameters: {'id_1': 'false', 'param_1': 1}]
flowauth_1                           | (Background on this error at: http://sqlalche.me/e/9h9h)
@greenape greenape added bug Something isn't working FlowAuth Issues related to FlowAuth labels Apr 15, 2019
@greenape
Copy link
Member Author

Route being hit is GET /admin/users/false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FlowAuth Issues related to FlowAuth
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant