{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/8054","repository_url":"https://api.github.com/repos/zulip/zulip","labels_url":"https://api.github.com/repos/zulip/zulip/issues/8054/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/8054/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/8054/events","html_url":"https://github.com/zulip/zulip/issues/8054","id":287763115,"number":8054,"title":"Error in searching for the character '>' in the search bar in development environment.","user":{"login":"rheaparekh","id":25330892,"avatar_url":"https://avatars0.githubusercontent.com/u/25330892?v=4","gravatar_id":"","url":"https://api.github.com/users/rheaparekh","html_url":"https://github.com/rheaparekh","followers_url":"https://api.github.com/users/rheaparekh/followers","following_url":"https://api.github.com/users/rheaparekh/following{/other_user}","gists_url":"https://api.github.com/users/rheaparekh/gists{/gist_id}","starred_url":"https://api.github.com/users/rheaparekh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rheaparekh/subscriptions","organizations_url":"https://api.github.com/users/rheaparekh/orgs","repos_url":"https://api.github.com/users/rheaparekh/repos","events_url":"https://api.github.com/users/rheaparekh/events{/privacy}","received_events_url":"https://api.github.com/users/rheaparekh/received_events","type":"User","site_admin":false},"labels":[{"id":461206935,"url":"https://api.github.com/repos/zulip/zulip/labels/area:%20search","name":"area: search","color":"bfd4f2","default":false},{"id":265216829,"url":"https://api.github.com/repos/zulip/zulip/labels/bug","name":"bug","color":"fc2929","default":true},{"id":265216832,"url":"https://api.github.com/repos/zulip/zulip/labels/help%20wanted","name":"help wanted","color":"159818","default":true},{"id":545030708,"url":"https://api.github.com/repos/zulip/zulip/labels/in%20progress","name":"in progress","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":{"login":"burek967","id":18124087,"avatar_url":"https://avatars1.githubusercontent.com/u/18124087?v=4","gravatar_id":"","url":"https://api.github.com/users/burek967","html_url":"https://github.com/burek967","followers_url":"https://api.github.com/users/burek967/followers","following_url":"https://api.github.com/users/burek967/following{/other_user}","gists_url":"https://api.github.com/users/burek967/gists{/gist_id}","starred_url":"https://api.github.com/users/burek967/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burek967/subscriptions","organizations_url":"https://api.github.com/users/burek967/orgs","repos_url":"https://api.github.com/users/burek967/repos","events_url":"https://api.github.com/users/burek967/events{/privacy}","received_events_url":"https://api.github.com/users/burek967/received_events","type":"User","site_admin":false},"assignees":[{"login":"burek967","id":18124087,"avatar_url":"https://avatars1.githubusercontent.com/u/18124087?v=4","gravatar_id":"","url":"https://api.github.com/users/burek967","html_url":"https://github.com/burek967","followers_url":"https://api.github.com/users/burek967/followers","following_url":"https://api.github.com/users/burek967/following{/other_user}","gists_url":"https://api.github.com/users/burek967/gists{/gist_id}","starred_url":"https://api.github.com/users/burek967/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burek967/subscriptions","organizations_url":"https://api.github.com/users/burek967/orgs","repos_url":"https://api.github.com/users/burek967/repos","events_url":"https://api.github.com/users/burek967/events{/privacy}","received_events_url":"https://api.github.com/users/burek967/received_events","type":"User","site_admin":false}],"milestone":null,"comments":12,"created_at":"2018-01-11T12:05:27Z","updated_at":"2018-03-09T02:32:49Z","closed_at":null,"author_association":"COLLABORATOR","body":"In the development environment, if we try to search for the character `>` in the search bar, we get the error:\r\n\r\n```\r\nFile \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1182, in _execute_context\r\n    context)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/default.py\", line 470, in do_execute\r\n    cursor.execute(statement, parameters)\r\n  File \"/srv/zulip/zerver/lib/db.py\", line 33, in execute\r\n    return wrapper_execute(self, super().execute, query, vars)\r\n  File \"/srv/zulip/zerver/lib/db.py\", line 20, in wrapper_execute\r\n    return action(sql, params)\r\npsycopg2.OperationalError: pgroonga: query_extract_keywords: failed to parse expression: Syntax error: <>||>\r\n\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/django/core/handlers/base.py\", line 185, in _get_response\r\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/django/views/decorators/csrf.py\", line 58, in wrapped_view\r\n    return view_func(*args, **kwargs)\r\n  File \"/srv/zulip/zerver/lib/rest.py\", line 124, in rest_dispatch\r\n    return target_function(request, **kwargs)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/django/utils/decorators.py\", line 149, in _wrapped_view\r\n    response = view_func(request, *args, **kwargs)\r\n  File \"/srv/zulip/zerver/decorator.py\", line 543, in _wrapped_view_func\r\n    return authenticate_log_and_execute_json(request, view_func, *args, **kwargs)\r\n  File \"/srv/zulip/zerver/decorator.py\", line 525, in authenticate_log_and_execute_json\r\n    return rate_limit()(view_func)(request, user_profile, *args, **kwargs)\r\n  File \"/srv/zulip/zerver/decorator.py\", line 686, in wrapped_func\r\n    return func(request, *args, **kwargs)\r\n  File \"/srv/zulip/zerver/lib/request.py\", line 170, in _wrapped_view_func\r\n    return view_func(request, *args, **kwargs)\r\n  File \"/srv/zulip/zerver/views/messages.py\", line 702, in get_messages_backend\r\n    query_result = list(sa_conn.execute(query).fetchall())\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 945, in execute\r\n    return meth(self, multiparams, params)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/sql/elements.py\", line 263, in _execute_on_connection\r\n    return connection._execute_clauseelement(self, multiparams, params)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1053, in _execute_clauseelement\r\n    compiled_sql, distilled_params\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1189, in _execute_context\r\n    context)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1402, in _handle_dbapi_exception\r\n    exc_info\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/util/compat.py\", line 203, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/util/compat.py\", line 186, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1182, in _execute_context\r\n    context)\r\n  File \"/srv/zulip-py3-venv/lib/python3.4/site-packages/sqlalchemy/engine/default.py\", line 470, in do_execute\r\n    cursor.execute(statement, parameters)\r\n  File \"/srv/zulip/zerver/lib/db.py\", line 33, in execute\r\n    return wrapper_execute(self, super().execute, query, vars)\r\n  File \"/srv/zulip/zerver/lib/db.py\", line 20, in wrapper_execute\r\n    return action(sql, params)\r\nsqlalchemy.exc.OperationalError: (psycopg2.OperationalError) pgroonga: query_extract_keywords: failed to parse expression: Syntax error: <>||>\r\n [SQL: 'SELECT /* get_messages */ anon_1.message_id, anon_1.flags, anon_1.subject, anon_1.rendered_content, anon_1.content_matches, anon_1.subject_matches \\nFROM ((SELECT message_id, flags, subject, rendered_content, pgroonga.match_positions_character(rendered_content, pgroonga.query_extract_keywords(%(query_extract_keywords_1)s)) AS content_matches, pgroonga.match_positions_character(subject, pgroonga.query_extract_keywords(%(query_extract_keywords_1)s)) AS subject_matches \\nFROM zerver_usermessage JOIN zerver_message ON zerver_usermessage.message_id = zerver_message.id \\nWHERE user_profile_id = %(param_1)s AND message_id >= %(message_id_1)s AND (search_pgroonga @@ %(search_pgroonga_1)s) AND message_id <= %(message_id_2)s ORDER BY message_id DESC \\n LIMIT %(param_2)s) UNION ALL (SELECT message_id, flags, subject, rendered_content, pgroonga.match_positions_character(rendered_content, pgroonga.query_extract_keywords(%(query_extract_keywords_1)s)) AS content_matches, pgroonga.match_positions_character(subject, pgroonga.query_extract_keywords(%(query_extract_keywords_1)s)) AS subject_matches \\nFROM zerver_usermessage JOIN zerver_message ON zerver_usermessage.message_id = zerver_message.id \\nWHERE user_profile_id = %(param_1)s AND message_id >= %(message_id_1)s AND (search_pgroonga @@ %(search_pgroonga_1)s) AND message_id >= %(message_id_3)s ORDER BY message_id ASC \\n LIMIT %(param_3)s)) AS anon_1 ORDER BY message_id ASC'] [parameters: {'message_id_2': 158, 'param_2': 50, 'query_extract_keywords_1': '>', 'param_1': 49, 'message_id_1': 0, 'search_pgroonga_1': '>', 'message_id_3': 159, 'param_3': 50}]\r\n```"},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/371694022","html_url":"https://github.com/zulip/zulip/issues/8054#issuecomment-371694022","issue_url":"https://api.github.com/repos/zulip/zulip/issues/8054","id":371694022,"user":{"login":"burek967","id":18124087,"avatar_url":"https://avatars1.githubusercontent.com/u/18124087?v=4","gravatar_id":"","url":"https://api.github.com/users/burek967","html_url":"https://github.com/burek967","followers_url":"https://api.github.com/users/burek967/followers","following_url":"https://api.github.com/users/burek967/following{/other_user}","gists_url":"https://api.github.com/users/burek967/gists{/gist_id}","starred_url":"https://api.github.com/users/burek967/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burek967/subscriptions","organizations_url":"https://api.github.com/users/burek967/orgs","repos_url":"https://api.github.com/users/burek967/repos","events_url":"https://api.github.com/users/burek967/events{/privacy}","received_events_url":"https://api.github.com/users/burek967/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T02:32:49Z","updated_at":"2018-03-09T02:32:49Z","author_association":"COLLABORATOR","body":"The bug shouldn't occur anymore with PGroonga 2.0.3. It was connected to function `pgroonga_query_extract_keywords` which complained about certain inputs and got fixed at https://github.com/pgroonga/pgroonga/commit/49cfcf4ce162c5edc306bf8fade57bd5ea963ce8, so I believe this issue can be closed."}}
{"actor":{"display_login":"burek967"}}