New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 821201 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

CL-Status-Viewer-Server error at retrieving build hasn't started CIDB

Project Member Reported by nxia@chromium.org, Mar 12 2018

Issue description

INFO:werkzeug:127.0.0.1 - - [12/Mar/2018 15:41:14] "GET /v1/gerrit/chromium-review.googlesource.com/changes/14400/patches/1/status HTTP/1.1" 200 -
ERROR:root:Failed at getting CL status, change: gerrit_host: "chromium-review.googlesource.com"
change_number: 959615
patch_number: 1
, exception: (pymysql.err.ProgrammingError) (1064, u"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 ')' at line 3") [SQL: u'SELECT `buildTable`.id, `buildTable`.build_config, `buildTable`.start_time, `buildTable`.finish_time, `buildTable`.status, `buildTable`.waterfall, `buildTable`.build_number, `buildTable`.builder_name, `buildTable`.platform_version, `buildTable`.full_version, `buildTable`.milestone_version, `buildTable`.important, `buildTable`.buildbucket_id, `buildTable`.summary, `buildTable`.buildbot_generation, `buildTable`.master_build_id, `buildTable`.bot_hostname, `buildTable`.deadline, `buildTable`.build_type, `buildTable`.metadata_url, `buildTable`.toolchain_url \nFROM `buildTable` \nWHERE id IN ()']
Traceback (most recent call last):
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/v1.py", line 103, in GetCLStatus
    status, builds = cl_status_server.GetCLStatusAndBuilds(change)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/cl_status_server.py", line 288, in GetCLStatusAndBuilds
    builds.extend(_GetPreCQBuilds(gerrit_patch, cl_actions))
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/cl_status_server.py", line 351, in _GetPreCQBuilds
    started_build_statuses = db.GetBuildStatuses(started_builds.values())
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 115, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 1165, in GetBuildStatuses
    self.BUILD_STATUS_KEYS)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 532, in _SelectWhere
    r = self._Execute(sel)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 553, in _Execute
    *args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 577, in _ExecuteWithEngine
    return self._RunFunctorWithRetries(f)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 596, in _RunFunctorWithRetries
    functor=functor)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/retry_stats.py", line 181, in RetryWithStats
    *args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/retry_util.py", line 244, in GenericRetry
    return _run()
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/retry_util.py", line 177, in _Wrapper
    ret = func(*args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/retry_util.py", line 243, in _run
    return functor(*args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/retry_stats.py", line 168, in wrapper
    result = functor(*args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/chromite/lib/cidb.py", line 573, in <lambda>
    f = lambda: engine.execute(query, *args, **kwargs)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2064, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 166, in execute
    result = self._query(query)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 856, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1057, in _read_query_result
    result.read()
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1340, in read
    first_packet = self.connection._read_packet()
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1014, in _read_packet
    packet.check_error()
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/local/google/home/nxia/chromiumos/infra/cl_status_viewer/cl_status_viewer_server/env/local/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
ProgrammingError: (pymysql.err.ProgrammingError) (1064, u"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 ')' at line 3") [SQL: u'SELECT `buildTable`.id, `buildTable`.build_config, `buildTable`.start_time, `buildTable`.finish_time, `buildTable`.status, `buildTable`.waterfall, `buildTable`.build_number, `buildTable`.builder_name, `buildTable`.platform_version, `buildTable`.full_version, `buildTable`.milestone_version, `buildTable`.important, `buildTable`.buildbucket_id, `buildTable`.summary, `buildTable`.buildbot_generation, `buildTable`.master_build_id, `buildTable`.bot_hostname, `buildTable`.deadline, `buildTable`.build_type, `buildTable`.metadata_url, `buildTable`.toolchain_url \nFROM `buildTable` \nWHERE id IN ()']
127.0.0.1 - - [12/Mar/2018 15:42:26] "GET /v1/gerrit/chromium-review.googlesource.com/changes/959615/patches/1/status HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [12/Mar/2018 15:42:26] "GET /v1/gerrit/chromium-review.googlesource.com/changes/959615/patches/1/status HTTP/1.1" 200 -

 

Comment 1 by nxia@chromium.org, Mar 12 2018

Description: Show this description

Comment 2 by nxia@chromium.org, Mar 12 2018

Status: Assigned (was: Untriaged)
mysql> select * from clActionTable where change_number = 959615;
+----------+----------+---------------+--------------+---------------+---------------------------+--------------------------------+---------------------+---------------------+
| id       | build_id | change_number | patch_number | change_source | action                    | reason                         | timestamp           | buildbucket_id      |
+----------+----------+---------------+--------------+---------------+---------------------------+--------------------------------+---------------------+---------------------+
| 23325687 |  2375305 |        959615 |            1 | external      | speculative               | NULL                           | 2018-03-12 22:37:01 | NULL                |
| 23325690 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | daisy_spring-no-vmtest-pre-cq  | 2018-03-12 22:37:11 | NULL                |
| 23325691 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | betty-pre-cq                   | 2018-03-12 22:37:11 | NULL                |
| 23325692 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | zako-no-vmtest-pre-cq          | 2018-03-12 22:37:11 | NULL                |
| 23325693 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | nyan_blaze-no-vmtest-pre-cq    | 2018-03-12 22:37:11 | NULL                |
| 23325694 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | reef-no-vmtest-pre-cq          | 2018-03-12 22:37:11 | NULL                |
| 23325695 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | whirlwind-no-vmtest-pre-cq     | 2018-03-12 22:37:11 | NULL                |
| 23325696 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | cyan-no-vmtest-pre-cq          | 2018-03-12 22:37:11 | NULL                |
| 23325697 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | samus-no-vmtest-pre-cq         | 2018-03-12 22:37:11 | NULL                |
| 23325698 |  2375305 |        959615 |            1 | external      | validation_pending_pre_cq | kevin-arcnext-no-vmtest-pre-cq | 2018-03-12 22:37:11 | NULL                |
| 23325699 |  2375305 |        959615 |            1 | external      | screened_for_pre_cq       | NULL                           | 2018-03-12 22:37:11 | NULL                |
| 23325706 |  2375305 |        959615 |            1 | external      | trybot_launching          | daisy_spring-no-vmtest-pre-cq  | 2018-03-12 22:38:46 | 8952220430860916464 |
| 23325707 |  2375305 |        959615 |            1 | external      | trybot_launching          | betty-pre-cq                   | 2018-03-12 22:38:46 | 8952220430509482544 |
| 23325708 |  2375305 |        959615 |            1 | external      | trybot_launching          | zako-no-vmtest-pre-cq          | 2018-03-12 22:38:46 | 8952220430146230624 |
| 23325709 |  2375305 |        959615 |            1 | external      | trybot_launching          | nyan_blaze-no-vmtest-pre-cq    | 2018-03-12 22:38:46 | 8952220429722524336 |
| 23325710 |  2375305 |        959615 |            1 | external      | trybot_launching          | reef-no-vmtest-pre-cq          | 2018-03-12 22:38:46 | 8952220429175610304 |
| 23325711 |  2375305 |        959615 |            1 | external      | trybot_launching          | whirlwind-no-vmtest-pre-cq     | 2018-03-12 22:38:46 | 8952220428700350096 |
| 23325712 |  2375305 |        959615 |            1 | external      | trybot_launching          | cyan-no-vmtest-pre-cq          | 2018-03-12 22:38:46 | 8952220428357086496 |
| 23325713 |  2375305 |        959615 |            1 | external      | trybot_launching          | samus-no-vmtest-pre-cq         | 2018-03-12 22:38:46 | 8952220427977801648 |
| 23325714 |  2375305 |        959615 |            1 | external      | trybot_launching          | kevin-arcnext-no-vmtest-pre-cq | 2018-03-12 22:38:46 | 8952220427552450928 |
+----------+----------+---------------+--------------+---------------+---------------------------+--------------------------------+---------------------+---------------------+
20 rows in set (0.09 sec)

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/infra/cl_status_viewer/+/e520a7b39dc68cdd3cb0670e694ba75aa685fc01

commit e520a7b39dc68cdd3cb0670e694ba75aa685fc01
Author: Ningning Xia <nxia@google.com>
Date: Wed Mar 14 21:21:51 2018

Format start_timestamp for buildbucket builds.

1) The start_ts of buildbucket build has 16 digits, format it to 10
digits as the start_time timestamp of cidb build.
2) Do not query cidb buildTable when started_builds are empty, otherwise
mysql throws a syntax error.

BUG= chromium:816973 ,  chromium:821201 
TEST=unit_tests

Change-Id: I95343c543d570d8a83f2e1291765fad317418852
Reviewed-on: https://chromium-review.googlesource.com/959608
Commit-Ready: Ningning Xia <nxia@chromium.org>
Tested-by: Ningning Xia <nxia@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/e520a7b39dc68cdd3cb0670e694ba75aa685fc01/cl_status_viewer_server/cl_status_server_unittest.py
[modify] https://crrev.com/e520a7b39dc68cdd3cb0670e694ba75aa685fc01/cl_status_viewer_server/cl_status_server.py

Comment 4 by nxia@chromium.org, Mar 15 2018

Status: Fixed (was: Assigned)

Sign in to add a comment