{"action":"opened","issue":{"url":"https://api.github.com/repos/fedora-infra/fas/issues/195","repository_url":"https://api.github.com/repos/fedora-infra/fas","labels_url":"https://api.github.com/repos/fedora-infra/fas/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/fedora-infra/fas/issues/195/comments","events_url":"https://api.github.com/repos/fedora-infra/fas/issues/195/events","html_url":"https://github.com/fedora-infra/fas/issues/195","id":167599302,"number":195,"title":"[FAS3] No longer able to login after most recent changes in FAS_3.0 branch","user":{"login":"skrzepto","id":3166193,"avatar_url":"https://avatars.githubusercontent.com/u/3166193?v=3","gravatar_id":"","url":"https://api.github.com/users/skrzepto","html_url":"https://github.com/skrzepto","followers_url":"https://api.github.com/users/skrzepto/followers","following_url":"https://api.github.com/users/skrzepto/following{/other_user}","gists_url":"https://api.github.com/users/skrzepto/gists{/gist_id}","starred_url":"https://api.github.com/users/skrzepto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skrzepto/subscriptions","organizations_url":"https://api.github.com/users/skrzepto/orgs","repos_url":"https://api.github.com/users/skrzepto/repos","events_url":"https://api.github.com/users/skrzepto/events{/privacy}","received_events_url":"https://api.github.com/users/skrzepto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-26T12:51:12Z","updated_at":"2016-07-26T12:51:12Z","closed_at":null,"body":"## Summary\r\nWhen logging into `fasadmin` or any other account you create it errors saying\r\n\r\n```\r\nTypeError: can't compare offset-naive and offset-aware datetimes\r\n```\r\n\r\n## Steps to reproduce\r\n\r\n1. Login into any account\r\n\r\n## Expected results\r\n1. login succesfully\r\n\r\n\r\n## Misc. Notes\r\n\r\nI came across this when trying to run my unit tests but they were all failing. One thing I noticed is that if you comment out line 295 in fas/security    https://github.com/skrzepto/fas/blob/115507f3748a70313d4c7dbac48f8ae0f1930268/fas/security.py#L295\r\n\r\nit works as expected. I went through the recent git logs and I can't seem to pinpoint what change caused this.\r\n\r\n## Error Log\r\n```\r\nFROM people \r\nWHERE people.username = ?\r\n LIMIT ? OFFSET ?) AS anon_1 LEFT OUTER JOIN signed_license_agreement AS signed_license_agreement_1 ON anon_1.people_id = signed_license_agreement_1.person_id\r\n2016-07-26 07:46:47,146 INFO  [waitress:4107][sqlalchemy.engine.base.Engine:base][_execute_context:1100] (u'simon', 1, 0)\r\n2016-07-26 07:46:47,156 DEBUG [waitress:4107][fas.models.register:register][save_account_activity:50] Found record from remote IP(127.0.0.1): {}\r\n2016-07-26 07:46:47,156 DEBUG [waitress:4107][fas.models.register:register][save_account_activity:53] Parsing user_agent: {'device': {'brand': None, 'model': None, 'family': 'Other'}, 'os': {'major': None, 'patch_minor': None, 'minor': None, 'family': 'Linux', 'patch': None}, 'user_agent': {'major': '1', 'minor': '2', 'family': 'Vivaldi', 'patch': '490'}, 'string': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Vivaldi/1.2.490.43'}\r\n2016-07-26 07:46:47,157 DEBUG [waitress:4107][fas.models.register:register][save_account_activity:56] Found clien from user_agent: Vivaldi\r\n2016-07-26 07:46:47,157 DEBUG [waitress:4107][fas.models.register:register][save_account_activity:59] Found device from user_agent: Other\r\n2016-07-26 07:46:47,157 DEBUG [waitress:4107][fas.models.register:register][save_account_activity:83] Set remote location to: Unknown\r\n2016-07-26 07:46:47,162 INFO  [waitress:4107][sqlalchemy.engine.base.Engine:base][_rollback_impl:666] ROLLBACK\r\n2016-07-26 07:46:47,168 ERROR [waitress:4107][pyramid_debugtoolbar:toolbar][toolbar_tween:227] Exception at http://0.0.0.0:6543/login\r\ntraceback url: http://0.0.0.0:6543/_debug_toolbar/exception?token=b273499f91dc4180eae2&tb=140000199386960\r\nTraceback (most recent call last):\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_debugtoolbar/toolbar.py\", line 209, in toolbar_tween\r\n    response = _handler(request)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_debugtoolbar/panels/performance.py\", line 57, in resource_timer_handler\r\n    result = handler(request)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/tweens.py\", line 62, in excview_tween\r\n    reraise(*attrs['exc_info'])\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/tweens.py\", line 22, in excview_tween\r\n    response = handler(request)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_tm/__init__.py\", line 101, in tm_tween\r\n    reraise(*exc_info)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_tm/__init__.py\", line 83, in tm_tween\r\n    response = handler(request)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/router.py\", line 158, in handle_request\r\n    view_name\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/view.py\", line 547, in _call_view\r\n    response = view_callable(context, request)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/viewderivers.py\", line 442, in rendered_view\r\n    result = view(context, request)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/viewderivers.py\", line 123, in _class_requestonly_view\r\n    response = getattr(inst, attr)()\r\n  File \"/home/skrzepto/Documents/repo/fas/fas/views/home.py\", line 76, in login\r\n    result = process_login(self.request, person, password)\r\n  File \"/home/skrzepto/Documents/repo/fas/fas/security.py\", line 295, in process_login\r\n    notify(LoginSucceeded(request, person))\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/registry.py\", line 91, in notify\r\n    [ _ for _ in self.subscribers(events, None) ]\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/zope/interface/registry.py\", line 328, in subscribers\r\n    return self.adapters.subscribers(objects, provided)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/zope/interface/adapter.py\", line 596, in subscribers\r\n    subscription(*objects)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid/config/adapters.py\", line 103, in derived_subscriber\r\n    return subscriber(arg[0])\r\n  File \"/home/skrzepto/Documents/repo/fas/fas/subscribers/people.py\", line 107, in check_ssh_key\r\n    for m in person.group_membership:\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py\", line 237, in __get__\r\n    return self.impl.get(instance_state(instance), dict_)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py\", line 583, in get\r\n    value = self.callable_(state, passive)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py\", line 544, in _load_for_state\r\n    return self._emit_lazyload(session, state, ident_key, passive)\r\n  File \"<string>\", line 1, in <lambda>\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py\", line 614, in _emit_lazyload\r\n    result = q.all()\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/query.py\", line 2613, in all\r\n    return list(self)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/query.py\", line 2760, in __iter__\r\n    self.session._autoflush()\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 1293, in _autoflush\r\n    self.flush()\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2019, in flush\r\n    self._flush(objects)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2137, in _flush\r\n    transaction.rollback(_capture_exception=True)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py\", line 60, in __exit__\r\n    compat.reraise(exc_type, exc_value, exc_tb)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2101, in _flush\r\n    flush_context.execute()\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py\", line 373, in execute\r\n    rec.execute(self)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py\", line 532, in execute\r\n    uow\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 170, in save_obj\r\n    mapper, table, update)\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 634, in _emit_update_statements\r\n    lambda rec: (\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 462, in _collect_update_commands\r\n    value, state.committed_state[propkey]) is not True:\r\n  File \"/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py\", line 279, in compare_values\r\n    return x == y\r\nTypeError: can't compare offset-naive and offset-aware datetimes\r\n\r\n```"}}
{"actor":{"display_login":"skrzepto"}}