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

Issue 860166 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Autotest server jobs failed to import mysql

Project Member Reported by shik@chromium.org, Jul 4

Issue description

Many builds are failing with "xxx_SERVER_JOB: FAIL" as follow:

  Traceback (most recent call last):
    File "/usr/local/autotest/server/autoserv", line 33, in <module>
      from autotest_lib.server.cros.dynamic_suite import suite
    File "/usr/local/autotest/server/cros/dynamic_suite/suite.py", line 31, in <module>
      from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
    File "/usr/local/autotest/server/cros/dynamic_suite/frontend_wrappers.py", line 15, in <module>
      from autotest_lib.server import frontend
    File "/usr/local/autotest/server/frontend.py", line 30, in <module>
      from autotest_lib.tko import db
    File "/usr/local/autotest/tko/db.py", line 13, in <module>
      import MySQLdb
    File "/usr/local/autotest/site-packages/MySQLdb/__init__.py", line 19, in <module>
      import _mysql
  ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory.

Example: https://luci-milo.appspot.com/buildbot/chromeos/eve-paladin/3561
 
Cc: mcchou@chromium.org akes...@chromium.org mortonm@chromium.org haddowk@chromium.org derat@chromium.org wzang@chromium.org gu...@chromium.org gmeinke@chromium.org cmtm@chromium.org shik@chromium.org nya@chromium.org lpique@chromium.org mattmallett@chromium.org kinaba@chromium.org
This is happening intermittently on the Chrome PFQ builders as well and fouled up last night's uprev. It's killing dummy_PassServer.sanity_SERVER_JOB in HWTest [sanity] there, e.g. http://cros-goldeneye/chromeos/healthmonitoring/buildDetails?buildbucketId=8941946317082646224.

Might be related to the recent upgrade at 853401.
( issue 853401 , just to make that auto-link)
This looks like it probably started a bit before 2018-07-03 22:43:00 PDT.
Also observed this issue on moblabs, b/111153934.

Owner: gu...@chromium.org
Status: Assigned (was: Untriaged)
This is a Test issue, not CI. Over to the Infra Deputy.
Re #4 and #7, I don't think it's related to that CL because it hasn't been pushed to prod.
Re: #8, in a server-side test, the code is packaged and tested within the server-side container. It doesn't have to be pushed to prod.
Looking at the waterfall, it looks like every paladin that runs a server test was failing with this.

paladins are turning green. Down from 30+ red paladins to 14 now.

master paladin is green.

Re #9, one question, which branch the service side testing check out? In our production, the autotest server code is on branch 'prod' other than 'master'. It would be better to make server side testing also consistent with this.
Owner: pprabhu@chromium.org
-> pprabhu for more investigation as he is the CL owner.
Re #13: As far as I know, the server-side tests from the same revision as the tested device should be used (if a 'prod' server is trying to test a R69-xxxxx.0.0 device, R69-xxxxx.0.0 test code is used, not from 'prod' or 'master'):
https://docs.google.com/document/d/1oGuXg3gz0X1VzGIlEyycvF7uDnt8i7pflPalegpT8jE/edit#
Status: Started (was: Assigned)
https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1123026 landed in the CQ because it was tested only by moblab-pre-cq, and committed from the pre-cq.

This is the second instance of this. Autotest code is clearly not ready to be submitted after being tested only on moblab-pre-cq :(

I'm removing the land-from-pre-cq config for this project.
Root cause of failure: Before CL:1123026, the MySQLdb module was imported only when db.db() function was called. After the CL, this module is imported unconditionally.

MySQLdb was never importable inside the SSP container. But autoserv imports server.cros.dynamic_suite.suite, which imports tko.db. But db.db() was never called in the context of the test.

This is what we get for being too smart with our imports.

The fix is to factor out the functions being called from server.cros.dynamic_suite.suite module, which are really unrelated to suites entirely...
Cc: -mortonm@chromium.org
Project Member

Comment 19 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/25288075f399ac91d72ebb752043e310b7e9bf53

commit 25288075f399ac91d72ebb752043e310b7e9bf53
Author: Prathmesh Prabhu <pprabhu@chromium.org>
Date: Wed Jul 11 18:26:47 2018

autotest: Do not submit autotest infrastructure code from pre-cq.

Moblab-pre-cq has proved insufficient for vetting CLs to the existing
autotest infrastructure code. In particular, moblab-vm does not run any
ssp tests, which creates a large hole in coverage.

lucifer and skylab related directories continue to be commited by pre-cq
directly.

BUG= chromium:860166 
TEST=None

Change-Id: Ia26ab526487e1aa115e63c78293dfb6fe82e81a9
Reviewed-on: https://chromium-review.googlesource.com/1129378
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>

[delete] https://crrev.com/ed74cc7a9cb43ac38a9e7bc8666105e37df909d7/tko/COMMIT-QUEUE.ini
[delete] https://crrev.com/ed74cc7a9cb43ac38a9e7bc8666105e37df909d7/scheduler/COMMIT-QUEUE.ini
[delete] https://crrev.com/ed74cc7a9cb43ac38a9e7bc8666105e37df909d7/database/COMMIT-QUEUE.ini
[delete] https://crrev.com/ed74cc7a9cb43ac38a9e7bc8666105e37df909d7/frontend/COMMIT-QUEUE.ini

Components: -Infra>Client>ChromeOS>CI
Owner: akes...@chromium.org
Aviv ended up writing a functionally equivalent CL for this, so letting him merge his (with a hack to avoid the issue seen above).
Labels: -Pri-1 Pri-2
Project Member

Comment 23 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/7f4071c3e10e819b7facfcc74691e3586fa9a7ff

commit 7f4071c3e10e819b7facfcc74691e3586fa9a7ff
Author: Aviv Keshet <akeshet@chromium.org>
Date: Tue Jul 17 09:26:17 2018

autotest: remove unneccesary indirection in tko db handle creation

We only support a mysql based tko db, yet we have indirection to fork
between different db backends that adds confusion and complexity.

 - delete db_mysql.py and move its connect method back to tko/db.py
 - delete _get_error_class frok tko/db.py

BUG=chromium:852083,  chromium:860166 
TEST=grep for db_mysql and get_error_class reveals no other callers;
examination of calls to |driver| at import time to ensure that they are
satisfied by the fake if necessary

Change-Id: I1c2d0e0daae6fc6b23c4e6c084c37c6602e777ed
Reviewed-on: https://chromium-review.googlesource.com/1135814
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>

[modify] https://crrev.com/7f4071c3e10e819b7facfcc74691e3586fa9a7ff/tko/db.py
[delete] https://crrev.com/1929fb3f1e58320857c6495d4927e3ffbca91ed2/tko/db_mysql.py

Status: Fixed (was: Started)

Sign in to add a comment