New issue
Advanced search Search tips

Issue 849832 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 3
Type: Bug

Blocking:
issue 845045



Sign in to add a comment

Build failure from cros chrome-sdk - Chromium for use with Chromium OS (Simple Chrome)

Reported by dubo...@codeweavers.com, Jun 5 2018

Issue description

Is this the most recent version:
OS + version:

Repo sync from source on 6/4/2018
Building locally on my Ubuntu 18.04 box

CPU architecture (32-bit / 64-bit): 64

What steps will reproduce the problem?

I am trying to build a Chromium browser for use with my local Chromium OS build by follow the instructions here:

https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md

After this command:

cros chrome-sdk --board=$BOARD --log-level=info

I get a python backtrace ending with:
<snip>
...
 File "/home/duboisj/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 182, in <genexpr>
    return ' '.join(ShellQuote(arg) for arg in cmd)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 83, in ShellQuote
    s = s.encode('utf-8')
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1441: ordinal not in range(128)"

This appears right after a message:

 21:52:42: INFO: Installing Goma.

It looks to me like the real problem is that the script is trying this:

curl https://clients5.google.com/cxx-compiler-service/download/downloadurl

but failing with a 401 Unauthorized error (the python string that fails appears to be a short HTML blob saying basically 'permission denied')

The complete output / backtrace I get is:

duboisj@duboisj-ubuntu:~/chromium$ !293
cros chrome-sdk --board=amd64-generic --log-level=debug
21:52:42: DEBUG: Cache dir lookup.
21:52:42: DEBUG: Configured cache_dir to '/home/duboisj/chromium/.cros_cache'
21:52:42: DEBUG: Read LKGM version from /home/duboisj/chromium/src/chromeos/CHROMEOS_LKGM: 10748.0.0
21:52:42: INFO: Installing Goma.
21:52:42: INFO: RunCommand: curl https://clients5.google.com/cxx-compiler-service/download/downloadurl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1616  100  1616    0     0   6029      0 --:--:-- --:--:-- --:--:--  6029
21:52:42: DEBUG: ending retries with error: <type 'exceptions.UnicodeDecodeError'>('ascii' codec can't decode byte 0xe2 in position 1441: ordinal not in range(128))
21:52:42: ERROR: cros chrome-sdk failed before completing.
cros: Unhandled exception:
Traceback (most recent call last):
  File "/home/duboisj/chromium/src/third_party/chromite/bin/cros", line 169, in <module>
    DoMain()
  File "/home/duboisj/chromium/src/third_party/chromite/bin/cros", line 165, in DoMain
    commandline.ScriptWrapperMain(FindTarget)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/commandline.py", line 911, in ScriptWrapperMain
    ret = target(argv[1:])
  File "/home/duboisj/chromium/src/third_party/chromite/scripts/cros.py", line 66, in main
    code = _RunSubCommand(subcommand)
  File "/home/duboisj/chromium/src/third_party/chromite/scripts/cros.py", line 51, in _RunSubCommand
    return subcommand.Run()
  File "/home/duboisj/chromium/src/third_party/chromite/cli/cros/cros_chrome_sdk.py", line 1151, in Run
    goma_dir, goma_port = self._FetchGoma()
  File "/home/duboisj/chromium/src/third_party/chromite/cli/cros/cros_chrome_sdk.py", line 1081, in _FetchGoma
    '--output', self._GOMA_TGZ])
  File "/home/duboisj/chromium/src/third_party/chromite/lib/retry_util.py", line 404, in RunCurl
    sleep=3, backoff_factor=1.6, *args, **kwargs)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/retry_util.py", line 353, in RunCommandWithRetries
    return RetryCommand(cros_build_lib.RunCommand, max_retry, *args, **kwargs)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/retry_util.py", line 325, in RetryCommand
    return GenericRetry(ShouldRetry, max_retry, functor, *args, **kwargs)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/retry_util.py", line 244, in GenericRetry
    return _run()
  File "/home/duboisj/chromium/src/third_party/chromite/lib/retry_util.py", line 177, in _Wrapper
    ret = func(*args, **kwargs)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/retry_util.py", line 243, in _run
    return functor(*args, **kwargs)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 587, in RunCommand
    logging.log(debug_level, 'RunCommand: %s', CmdToStr(cmd))
  File "/home/duboisj/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 182, in CmdToStr
    return ' '.join(ShellQuote(arg) for arg in cmd)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 182, in <genexpr>
    return ' '.join(ShellQuote(arg) for arg in cmd)
  File "/home/duboisj/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 83, in ShellQuote
    s = s.encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1441: ordinal not in range(128)

The python string which fails appears to contain a small HTML document informing me of a 401 Error because I don't have permission to download Goma.  In this thread:

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/sYZe7uS9E9Q

Mike F. said that a failed Goma download should not cause the cros chrome-sdk command to fail.


 
Blocking: 845045
Cc: vapier@chromium.org
Components: Infra>Goma Build
Labels: OS-Chrome
Owner: yyanagisawa@chromium.org
Status: Started (was: Unconfirmed)
Usage of RunCurl seems to be wrong.  Let me check.
Current status:
- _FetchGoma use RunCurl.  We need to set '--fail' to RunCurl to make 401 as error.
- _CheckExit checks curl stderr has 404 or not but underlying RunCommand in cros_build_lib does not set stderr to result.error, and _CheckExit fails due to accessing None type object.

Question:
- why RunCurl avoid to retry only for 404 but allow to retry 401?
Also, setting --nogoma in command line should be workaround to avoid downloading goma.
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/1a3e67e8cac7648ee27b8757904b8c359f6b300f

commit 1a3e67e8cac7648ee27b8757904b8c359f6b300f
Author: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Date: Wed Jun 06 12:00:57 2018

cros_chrome_sdk: should not raise on goma fetch failure.

Since retry_util.RunCurl without --fail, _FetchGoma did not notice
failure of download, and set strange input to the next command.
That is original cause of  crbug.com/849832 .
When we set --fail, failure of download raise retry_util.DownloadError,
we need to re-raise it as GomaError.

This cl also fixes retry_util.py to make it work with --fail.
Although it checks curl's stderr, stderr given to _CheckExit was
actually empty because there was no option to preserve it.
Also, although _CheckExit function's comment says it make 4xx error
as non-retryable error, it only checks '404 Not Found'.
This cl made all 4xx error as non-retryable error.

Bug:  849832 
Change-Id: I11aadb76b301e7f110d17c01d2cf287d8d604df4
Reviewed-on: https://chromium-review.googlesource.com/1088269
Commit-Ready: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Tested-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/1a3e67e8cac7648ee27b8757904b8c359f6b300f/cli/cros/cros_chrome_sdk.py
[modify] https://crrev.com/1a3e67e8cac7648ee27b8757904b8c359f6b300f/lib/retry_util.py

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a869adee4bb165adec09414af0e8e19fa36990bc

commit a869adee4bb165adec09414af0e8e19fa36990bc
Author: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Date: Wed Jun 06 14:41:42 2018

Roll src/third_party/chromite 522947b..1a3e67e (1 commits)

https://chromium.googlesource.com/chromiumos/chromite.git/+log/522947b..1a3e67e


git log 522947b..1a3e67e --date=short --no-merges --format='%ad %ae %s'
2018-06-06 yyanagisawa@chromium.org cros_chrome_sdk: should not raise on goma fetch failure.


Created with:
  gclient setdep -r src/third_party/chromite@1a3e67e

The AutoRoll server is located here: https://chromite-chromium-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



BUG= chromium:849832 
TBR=chrome-os-gardeners@chromium.org

Change-Id: Ibf7c3a77c7ab5e5a3312538c68e2b210f03a7fe1
Reviewed-on: https://chromium-review.googlesource.com/1088770
Reviewed-by: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Commit-Queue: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#564885}
[modify] https://crrev.com/a869adee4bb165adec09414af0e8e19fa36990bc/DEPS

Status: Fixed (was: Started)

Sign in to add a comment