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

Issue 723865 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Internal users are reporting /home/moblab/.moblab_id error

Project Member Reported by haddowk@chromium.org, May 17 2017

Issue description


This is an intermittent fault - suspect a race condition of two callers of the get_moblab_id() function in client/common_lib/utils.py

Harden this function to reduce the possibility of a race condition


 
Owner: haddowk@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, May 19 2017

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

commit fa0412a0c2817d29ea17dbd057f51bea85b35431
Author: Keith Haddow <haddowk@chromium.org>
Date: Fri May 19 20:57:42 2017

[moblab] Harden get_moblab_id against race conditions.

Hard to reproduce report of errors when getting the moblab id - most
likely caused by two version of gs_offloader starting at the same
time trying to write to the moblab home directory.  Improve error
handling to count for this possiblity.

TEST=manual tests
BUG= chromium:723865 

Change-Id: I0e890baf9a408134b8b2995228e2a256ab6db7be
Reviewed-on: https://chromium-review.googlesource.com/508223
Commit-Ready: Keith Haddow <haddowk@chromium.org>
Tested-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Michael Tang <ntang@chromium.org>

[modify] https://crrev.com/fa0412a0c2817d29ea17dbd057f51bea85b35431/client/common_lib/utils.py

Status: Fixed (was: Started)
Status: Assigned (was: Fixed)
Seeing error like this in R59

IOError: [Errno 13] Permission denied: '/home/moblab/.moblab_id'
Traceback (most recent call last):
  File "/usr/local/autotest/frontend/afe/json_rpc/serviceHandler.py", line 120, in dispatchRequest
    results['result'] = self.invokeServiceEndpoint(meth, args)
  File "/usr/local/autotest/frontend/afe/json_rpc/serviceHandler.py", line 160, in invokeServiceEndpoint
    return meth(*args)
  File "/usr/local/autotest/frontend/afe/rpc_handler.py", line 270, in new_fn
    return f(*args, **keyword_args)
  File "/usr/local/autotest/frontend/afe/rpc_utils.py", line 1124, in verify
    return func(*args, **kwargs)
  File "/usr/local/autotest/frontend/afe/moblab_rpc_interface.py", line 439, in get_version_info
    version_response['MOBLAB_ID'] = site_utils.get_moblab_id();
  File "/usr/local/autotest/client/common_lib/site_utils.py", line 213, in get_moblab_id
    with open(moblab_id_filepath, 'w') as moblab_id_file:
IOError: [Errno 13] Permission denied: '/home/moblab/.moblab_id'

Looks like it can not be created by apache user.
Components: Infra>Client>ChromeOS
Owner: ----
Status: Available (was: Assigned)
Owner: haddowk@chromium.org
Status: Started (was: Available)
Project Member

Comment 9 by bugdroid1@chromium.org, Feb 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/07b8759fd2f58011ce1f361b623d81dbb858589e

commit 07b8759fd2f58011ce1f361b623d81dbb858589e
Author: Keith Haddow <haddowk@chromium.org>
Date: Wed Feb 14 01:41:31 2018

[moblab] Generate moblab id when the homedir is created.

Currently moblab id is generated on first use, this causes some
race conditions depending on the code path of first access.

To prevent this ensure the id is created just after the home
directory ( where the id is stored ) is created.

BUG= chromium:723865 
TEST=local test and install

Change-Id: I0d029fcf625fa8d45cb75410a79349dd58bb331c
Reviewed-on: https://chromium-review.googlesource.com/906837
Commit-Ready: Keith Haddow <haddowk@chromium.org>
Tested-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>

[modify] https://crrev.com/07b8759fd2f58011ce1f361b623d81dbb858589e/project-moblab/chromeos-base/chromeos-bsp-moblab/files/init/moblab-homedir-init.conf
[rename] https://crrev.com/07b8759fd2f58011ce1f361b623d81dbb858589e/project-moblab/chromeos-base/chromeos-bsp-moblab/chromeos-bsp-moblab-0.0.5-r83.ebuild

Status: Fixed (was: Started)

Sign in to add a comment