{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-services/syncserver/issues/62","labels_url":"https://api.github.com/repos/mozilla-services/syncserver/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-services/syncserver/issues/62/comments","events_url":"https://api.github.com/repos/mozilla-services/syncserver/issues/62/events","html_url":"https://github.com/mozilla-services/syncserver/issues/62","id":106844196,"number":62,"title":"postgresql 9.2 as storage database does not work","user":{"login":"tomashavlas","id":6549693,"avatar_url":"https://avatars.githubusercontent.com/u/6549693?v=3","gravatar_id":"","url":"https://api.github.com/users/tomashavlas","html_url":"https://github.com/tomashavlas","followers_url":"https://api.github.com/users/tomashavlas/followers","following_url":"https://api.github.com/users/tomashavlas/following{/other_user}","gists_url":"https://api.github.com/users/tomashavlas/gists{/gist_id}","starred_url":"https://api.github.com/users/tomashavlas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomashavlas/subscriptions","organizations_url":"https://api.github.com/users/tomashavlas/orgs","repos_url":"https://api.github.com/users/tomashavlas/repos","events_url":"https://api.github.com/users/tomashavlas/events{/privacy}","received_events_url":"https://api.github.com/users/tomashavlas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-16T19:20:58Z","updated_at":"2015-09-24T12:50:20Z","closed_at":null,"body":"Hello,\r\n when I try to use postgresql as backed I get following error in my httpd log\r\n\r\n[Wed Sep 16 15:02:12.144047 2015] [:error] [pid 1115] [remote 195.146.151.118:128] mod_wsgi (pid=1115): Exception occurred processing WSGI script '/usr/local/src/syncserver/syncserver.wsgi'.\r\n[Wed Sep 16 15:02:12.144558 2015] [:error] [pid 1115] [remote 195.146.151.118:128] Traceback (most recent call last):\r\n[Wed Sep 16 15:02:12.144582 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/router.py\", line 242, in __call__\r\n[Wed Sep 16 15:02:12.144610 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = self.invoke_subrequest(request, use_tweens=True)\r\n[Wed Sep 16 15:02:12.144623 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/router.py\", line 217, in invoke_subrequest\r\n[Wed Sep 16 15:02:12.144653 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handle_request(request)\r\n[Wed Sep 16 15:02:12.144667 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/tokenserver/tweens.py\", line 15, in set_x_timestamp_header_tween\r\n[Wed Sep 16 15:02:12.144687 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handler(request)\r\n[Wed Sep 16 15:02:12.144699 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/tweens.py\", line 120, in convert_non_json_responses_tween\r\n[Wed Sep 16 15:02:12.144719 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handler(request)\r\n[Wed Sep 16 15:02:12.144731 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/tweens.py\", line 96, in convert_cornice_errors_to_respcodes_tween\r\n[Wed Sep 16 15:02:12.144749 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handler(request)\r\n[Wed Sep 16 15:02:12.144761 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/tweens.py\", line 52, in set_default_accept_header_tween\r\n[Wed Sep 16 15:02:12.144790 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return handler(request)\r\n[Wed Sep 16 15:02:12.144815 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/tweens.py\", line 29, in set_x_timestamp_header_tween\r\n[Wed Sep 16 15:02:12.144855 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handler(request)\r\n[Wed Sep 16 15:02:12.144880 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/mozsvc/tweens.py\", line 94, in fuzz_backoff_headers_tween\r\n[Wed Sep 16 15:02:12.144914 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handler(request)\r\n[Wed Sep 16 15:02:12.144929 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/mozsvc/tweens.py\", line 59, in log_uncaught_exceptions_tween\r\n[Wed Sep 16 15:02:12.144949 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return handler(request)\r\n[Wed Sep 16 15:02:12.144960 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/mozsvc/tweens.py\", line 26, in catch_backend_errors_tween\r\n[Wed Sep 16 15:02:12.144978 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return handler(request)\r\n[Wed Sep 16 15:02:12.144989 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/tweens.py\", line 21, in excview_tween\r\n[Wed Sep 16 15:02:12.145007 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = handler(request)\r\n[Wed Sep 16 15:02:12.145018 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/router.py\", line 163, in handle_request\r\n[Wed Sep 16 15:02:12.145036 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = view_callable(context, request)\r\n[Wed Sep 16 15:02:12.145047 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/config/views.py\", line 596, in __call__\r\n[Wed Sep 16 15:02:12.145065 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return view(context, request)\r\n[Wed Sep 16 15:02:12.145076 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/config/views.py\", line 329, in attr_view\r\n[Wed Sep 16 15:02:12.145103 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return view(context, request)\r\n[Wed Sep 16 15:02:12.145115 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/config/views.py\", line 305, in predicate_wrapper\r\n[Wed Sep 16 15:02:12.145133 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return view(context, request)\r\n[Wed Sep 16 15:02:12.145144 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/config/views.py\", line 245, in _secured_view\r\n[Wed Sep 16 15:02:12.145161 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return view(context, request)\r\n[Wed Sep 16 15:02:12.145172 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/config/views.py\", line 355, in rendered_view\r\n[Wed Sep 16 15:02:12.145189 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     result = view(context, request)\r\n[Wed Sep 16 15:02:12.145200 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/pyramid/config/views.py\", line 501, in _requestonly_view\r\n[Wed Sep 16 15:02:12.145217 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = view(request)\r\n[Wed Sep 16 15:02:12.145228 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/cornice/service.py\", line 514, in wrapper\r\n[Wed Sep 16 15:02:12.145246 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     response = view_(request)\r\n[Wed Sep 16 15:02:12.145257 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/views/util.py\", line 53, in wrapper\r\n[Wed Sep 16 15:02:12.145274 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return decorator_func(target_func, *args, **kwds)\r\n[Wed Sep 16 15:02:12.145286 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/views/decorators.py\", line 35, in convert_storage_errors\r\n[Wed Sep 16 15:02:12.145304 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return viewfunc(request)\r\n[Wed Sep 16 15:02:12.145315 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/views/util.py\", line 53, in wrapper\r\n[Wed Sep 16 15:02:12.145332 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return decorator_func(target_func, *args, **kwds)\r\n[Wed Sep 16 15:02:12.145344 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/views/decorators.py\", line 59, in sleep_and_retry_on_conflict\r\n[Wed Sep 16 15:02:12.145362 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return viewfunc(request)\r\n[Wed Sep 16 15:02:12.145372 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/views/util.py\", line 53, in wrapper\r\n[Wed Sep 16 15:02:12.145390 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return decorator_func(target_func, *args, **kwds)\r\n[Wed Sep 16 15:02:12.145401 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/views/decorators.py\", line 180, in with_collection_lock\r\n[Wed Sep 16 15:02:12.145419 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     with lock_collection(userid, collection):\r\n[Wed Sep 16 15:02:12.145430 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/lib64/python2.7/contextlib.py\", line 17, in __enter__\r\n[Wed Sep 16 15:02:12.145466 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return self.gen.next()\r\n[Wed Sep 16 15:02:12.145482 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/storage/sql/__init__.py\", line 173, in lock_for_read\r\n[Wed Sep 16 15:02:12.145519 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     ts = session.query_scalar(\"LOCK_COLLECTION_READ\", params)\r\n[Wed Sep 16 15:02:12.145535 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/storage/sql/__init__.py\", line 727, in query_scalar\r\n[Wed Sep 16 15:02:12.145554 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return self.connection.query_scalar(query, params, default)\r\n[Wed Sep 16 15:02:12.145566 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/storage/sql/dbconnect.py\", line 650, in query_scalar\r\n[Wed Sep 16 15:02:12.145585 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     res = self.execute(query, params, annotations)\r\n[Wed Sep 16 15:02:12.145597 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/storage/sql/dbconnect.py\", line 422, in report_backend_errors_wrapper\r\n[Wed Sep 16 15:02:12.145615 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return func(self, *args, **kwds)\r\n[Wed Sep 16 15:02:12.145626 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/storage/sql/dbconnect.py\", line 516, in execute\r\n[Wed Sep 16 15:02:12.145644 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return self._exec_with_cleanup(connection, query_str, **params)\r\n[Wed Sep 16 15:02:12.145655 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/mozsvc/metrics.py\", line 183, in timed_func\r\n[Wed Sep 16 15:02:12.145673 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return func(*args, **kwds)\r\n[Wed Sep 16 15:02:12.145684 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/syncstorage/storage/sql/dbconnect.py\", line 550, in _exec_with_cleanup\r\n[Wed Sep 16 15:02:12.145702 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return connection.execute(sqltext(query_str), **params)\r\n[Wed Sep 16 15:02:12.145713 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 720, in execute\r\n[Wed Sep 16 15:02:12.145731 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return meth(self, multiparams, params)\r\n[Wed Sep 16 15:02:12.145742 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py\", line 317, in _execute_on_connection\r\n[Wed Sep 16 15:02:12.145760 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     return connection._execute_clauseelement(self, multiparams, params)\r\n[Wed Sep 16 15:02:12.145772 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 817, in _execute_clauseelement\r\n[Wed Sep 16 15:02:12.145789 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     compiled_sql, distilled_params\r\n[Wed Sep 16 15:02:12.145800 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 947, in _execute_context\r\n[Wed Sep 16 15:02:12.145817 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     context)\r\n[Wed Sep 16 15:02:12.145829 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1108, in _handle_dbapi_exception\r\n[Wed Sep 16 15:02:12.145846 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     exc_info\r\n[Wed Sep 16 15:02:12.145857 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py\", line 185, in raise_from_cause\r\n[Wed Sep 16 15:02:12.145883 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     reraise(type(exception), exception, tb=exc_tb)\r\n[Wed Sep 16 15:02:12.145895 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 940, in _execute_context\r\n[Wed Sep 16 15:02:12.145913 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     context)\r\n[Wed Sep 16 15:02:12.145924 2015] [:error] [pid 1115] [remote 195.146.151.118:128]   File \"/usr/local/src/syncserver/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py\", line 435, in do_execute\r\n[Wed Sep 16 15:02:12.145942 2015] [:error] [pid 1115] [remote 195.146.151.118:128]     cursor.execute(statement, parameters)\r\n[Wed Sep 16 15:02:12.145996 2015] [:error] [pid 1115] [remote 195.146.151.118:128] ProgrammingError: (ProgrammingError) syntax error at or near \"LOCK\"\r\n[Wed Sep 16 15:02:12.146006 2015] [:error] [pid 1115] [remote 195.146.151.118:128] LINE 1: ... user_collections WHERE userid=1 AND collection=0 LOCK IN SH...\r\n[Wed Sep 16 15:02:12.146009 2015] [:error] [pid 1115] [remote 195.146.151.118:128]                                                              ^\r\n[Wed Sep 16 15:02:12.146013 2015] [:error] [pid 1115] [remote 195.146.151.118:128]  '/* [queryName=LOCK_COLLECTION_READ] */ SELECT last_modified FROM user_collections WHERE userid=%(userid)s AND collection=%(collectionid)s LOCK IN SHARE MODE' {'userid': 1, 'collectionid': 0}"},"comment":{"url":"https://api.github.com/repos/mozilla-services/syncserver/issues/comments/142918233","html_url":"https://github.com/mozilla-services/syncserver/issues/62#issuecomment-142918233","issue_url":"https://api.github.com/repos/mozilla-services/syncserver/issues/62","id":142918233,"user":{"login":"tomashavlas","id":6549693,"avatar_url":"https://avatars.githubusercontent.com/u/6549693?v=3","gravatar_id":"","url":"https://api.github.com/users/tomashavlas","html_url":"https://github.com/tomashavlas","followers_url":"https://api.github.com/users/tomashavlas/followers","following_url":"https://api.github.com/users/tomashavlas/following{/other_user}","gists_url":"https://api.github.com/users/tomashavlas/gists{/gist_id}","starred_url":"https://api.github.com/users/tomashavlas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomashavlas/subscriptions","organizations_url":"https://api.github.com/users/tomashavlas/orgs","repos_url":"https://api.github.com/users/tomashavlas/repos","events_url":"https://api.github.com/users/tomashavlas/events{/privacy}","received_events_url":"https://api.github.com/users/tomashavlas/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T12:50:20Z","updated_at":"2015-09-24T12:50:20Z","body":"I've just checked that file and I in my version there is missing whole block:\r\n```\r\nelif \"postgres\" in self.driver:\r\n            self.driver = \"postgres\"\r\n```\r\n\r\nI suspect that there is some old version of syncstorage.\r\nHowever trying to do upgrade, or clean installation according to https://docs.services.mozilla.com/howtos/run-sync-1.5.html do not help. Any other ideas?"}}