deploy_chrome Failure: IndexError |
|||
Issue description
Trying to flash my Chromebook via the Simple Chrome flow.
This worked for me yesterday, but today deploy_chrome is failing consistently for me:
> deploy_chrome --build-dir=out_${SDK_BOARD}/Release --to=${MYDEVICE} --debug
12:07:24: DEBUG: Configured cache_dir to '/usr/local/google/chromium/src/build/cros_cache'
12:07:24: DEBUG: GN_ARGS taken from environment: {'use_ozone': True, 'custom_toolchain': '//build/toolchain/cros:target', 'use_vaapi': True, 'ozone_platform_gbm': True, 'use_goma': True, 'use_evdev_gestures': True, 'cros_v8_snapshot_cc': '/usr/local/google/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang', 'use_system_libsync': True, 'use_v4lplugin': False, 'clang_use_chrome_plugins': False, 'cros_v8_snapshot_ar': '/usr/local/google/chromium/src/third_party/binutils/Linux_x64/Release/bin/ar', 'symbol_level': 2, 'use_cfi_cast': False, 'use_system_harfbuzz': False, 'cros_v8_snapshot_ld': '/usr/local/google/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++', 'cros_v8_snapshot_nm': '/usr/local/google/chromium/src/third_party/binutils/Linux_x64/Release/bin/nm', 'cros_board': 'eve', 'cros_host_is_clang': True, 'cros_v8_snapshot_extra_cxxflags': ' -Wno-unknown-warning-option', 'target_sysroot': '/usr/local/google/chromium/src/build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz', 'cros_host_cxx': '/usr/local/google/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++', 'cros_v8_snapshot_cxx': '/usr/local/google/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++', 'cros_host_extra_cppflags': '', 'cros_target_extra_cxxflags': '-pipe -pipe -pipe -march=corei7 -fno-split-dwarf-inlining -fdebug-info-for-profiling -D__google_stl_debug_vector=1 -Wno-unknown-warning-option -stdlib=libc++ -Wno-inline-asm', 'target_os': 'chromeos', 'cros_target_extra_cflags': '-pipe -pipe -march=corei7 -fno-split-dwarf-inlining -fdebug-info-for-profiling -Wno-unknown-warning-option -Wno-inline-asm', 'cros_v8_snapshot_extra_cflags': ' -Wno-unknown-warning-option', 'system_libdir': 'lib64', 'treat_warnings_as_errors': False, 'use_jumbo_build': False, 'blink_symbol_level': -1, 'use_system_freetype': False, 'is_clang': True, 'cros_v8_snapshot_is_clang': True, 'use_bundled_fontconfig': False, 'cros_v8_snapshot_extra_cppflags': '', 'cros_host_extra_cflags': ' -Wno-unknown-warning-option', 'cros_target_extra_cppflags': '', 'cros_host_ar': '/usr/local/google/chromium/src/third_party/binutils/Linux_x64/Release/bin/ar', 'use_xkbcommon': True, 'use_cras': True, 'icu_use_data_file': True, 'use_system_libdrm': True, 'cros_v8_snapshot_extra_ldflags': '', 'enable_nacl': True, 'linux_use_bundled_binutils': True, 'cros_target_nm': 'x86_64-cros-linux-gnu-nm', 'enable_remoting': True, 'cros_sdk_version': '10905.0.0', 'host_toolchain': '//build/toolchain/cros:host', 'use_debug_fission': True, 'use_lld': False, 'cros_target_ld': 'x86_64-cros-linux-gnu-clang++ -B/usr/local/google/chromium/src/build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.27.0-gold -Wno-unknown-warning-option', 'cros_target_cxx': 'x86_64-cros-linux-gnu-clang++ -B../../build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.27.0-gold -Wno-unknown-warning-option', 'cros_host_cc': '/usr/local/google/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang', 'cros_host_extra_cxxflags': ' -Wno-unknown-warning-option', 'cros_target_ar': 'llvm-ar', 'use_system_minigbm': True, 'is_cfi': False, 'ozone_auto_platforms': False, 'cros_host_extra_ldflags': '', 'target_cpu': 'x64', 'remove_webcore_debug_symbols': False, 'cros_target_extra_ldflags': '-Wl,-O1 -Wl,-O2 -Wl,--as-needed -stdlib=libc++', 'host_pkg_config': 'pkg-config', 'is_asan': False, 'is_debug': False, 'use_cups': True, 'cros_host_ld': '/usr/local/google/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++', 'cros_host_nm': '/usr/local/google/chromium/src/third_party/binutils/Linux_x64/Release/bin/nm', 'ozone_platform': 'gbm', 'goma_dir': '/usr/local/google/chromium/src/build/cros_cache/common/goma+2', 'cros_target_cc': 'x86_64-cros-linux-gnu-clang -B../../build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.27.0-gold -Wno-unknown-warning-option', 'use_thin_lto': False, 'use_v4l2_codec': True, 'v8_snapshot_toolchain': '//build/toolchain/cros:v8_snapshot'}
12:07:24: INFO: Staging flags taken from USE in environment: highdpi
12:07:24: INFO: Preparing device
<type 'exceptions.IndexError'>: list index out of range
Traceback (most recent call last):
File "/usr/local/google/chromium/src/third_party/chromite/lib/parallel.py", line 441, in _Run
self._task(*self._task_args, **self._task_kwargs)
File "/usr/local/google/chromium/src/third_party/chromite/lib/parallel.py", line 653, in ReturnWrapper
queue.put(fn())
File "/usr/local/google/chromium/src/third_party/chromite/scripts/deploy_chrome.py", line 122, in _GetRemoteDirSize
return int(result.output.split()[0])
IndexError: list index out of range
<type 'exceptions.IndexError'>: list index out of range
Traceback (most recent call last):
File "/usr/local/google/chromium/src/third_party/chromite/lib/parallel.py", line 441, in _Run
self._task(*self._task_args, **self._task_kwargs)
File "/usr/local/google/chromium/src/third_party/chromite/lib/parallel.py", line 653, in ReturnWrapper
queue.put(fn())
File "/usr/local/google/chromium/src/third_party/chromite/scripts/deploy_chrome.py", line 110, in _GetRemoteMountFree
line = result.output.splitlines()[1]
IndexError: list index out of range
,
Jul 25
vapier@ requested the output of the command `ssh root@${MYDEVICE} df -k /opt/google/chrome`. Here it is:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 2318144 2042444 275700 89% /
,
Jul 25
I also just tried flashing my device to a new image. Unfortunately, I'm getting the same error message.
,
Jul 25
Hmm, I don't have that problem locally. I just gsynced, and updated my image (board=link).
Try:
1. Replace ${} vars with actual values, just to eliminate the variable (so to speak).
2. Modify the code in chrome/src/third_party/chromite/scripts/deploy_chrome.py to log 'result' after line 120.
,
Jul 25
(1) Tried that, but it didn't make any difference. (2) Printing "result" directly just outputs this: 13:57:14: INFO: <chromite.lib.cros_build_lib.CommandResult object at 0x7f5256fdcd10> So, I tried outputting individual fields of result instead. result.error: 13:57:14: INFO: Warning: Permanently added '100.127.70.37' (ED25519) to the list of known hosts. result.cmd: 13:57:14: INFO: ['ssh', '-p', '22', '-oConnectionAttempts=4', '-oUserKnownHostsFile=/dev/null', '-oProtocol=2', '-oConnectTimeout=30', '-oServerAliveCountMax=3', '-oStrictHostKeyChecking=no', '-oServerAliveInterval=10', '-oNumberOfPasswordPrompts=0', '-oIdentitiesOnly=yes', '-i', '/tmp/tmpexjrAy/ssh-tmpeXhC0b/testing_rsa', 'root@100.127.70.37', '--', 'du -ks /opt/google/chrome'] result.output: 13:57:14: INFO: result.returncode: 13:57:14: INFO: 0
,
Jul 25
I meant result.output of course. The next thing to do is run the remote command on your device, which is actually: $ du -ks /opt/google/chrome It seems like somehow that device doesn't have /opt/google/chrome ??? You said you reimaged it though... I'm at a loss.
,
Jul 25
I've run the `du` command on the device as well as over SSH. In both situations, I get this output: 372228 /opt/google/chrome Running this command does not fix the issue at hand. vapier@, any other ideas?
,
Jul 25
FWIW, I also re-imaged the device to another CrOS version, but that was also unsuccessful.
,
Jul 25
what does this show: $ ssh -p 22 -oConnectionAttempts=4 -oUserKnownHostsFile=/dev/null -oProtocol=2 -oConnectTimeout=30 -oServerAliveCountMax=3 -oStrictHostKeyChecking=no -oServerAliveInterval=10 -oNumberOfPasswordPrompts=0 -oIdentitiesOnly=yes -i third_party/chromite/ssh_keys/testing_rsa root@100.127.70.37 -- du -ks /opt/google/chrome are you using emacs or tmux or something ?
,
Jul 25
$ ssh -p 22 -oConnectionAttempts=4 -oUserKnownHostsFile=/dev/null -oProtocol=2 -oConnectTimeout=30 -oServerAliveCountMax=3 -oStrictHostKeyChecking=no -oServerAliveInterval=10 -oNumberOfPasswordPrompts=0 -oIdentitiesOnly=yes -i third_party/chromite/ssh_keys/testing_rsa root@100.127.70.37 -- du -ks /opt/google/chrome Warning: Permanently added '100.127.70.37' (ED25519) to the list of known hosts. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0640 for 'third_party/chromite/ssh_keys/testing_rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "third_party/chromite/ssh_keys/testing_rsa": bad permissions root@100.127.70.37: Permission denied (publickey,keyboard-interactive).
,
Jul 25
I'm not using emacs or tmux, no.
,
Jul 25
run `chmod 0600 third_party/chromite/ssh_keys/testing_rsa` and retry the ssh command
,
Jul 25
I did that, and here is the output: $ ssh -p 22 -oConnectionAttempts=4 -oUserKnownHostsFile=/dev/null -oProtocol=2 -oConnectTimeout=30 -oServerAliveCountMax=3 -oStrictHostKeyChecking=no -oServerAliveInterval=10 -oNumberOfPasswordPrompts=0 -oIdentitiesOnly=yes -i third_party/chromite/ssh_keys/testing_rsa root@100.127.70.37 -- du -ks /opt/google/chrome Warning: Permanently added '100.127.70.37' (ED25519) to the list of known hosts. 374504 /opt/google/chrome I tried using deploy_chrome again after this, but I got the same error.
,
Jul 26
edit third_party/chromite/scripts/deploy_chrome.py and try this change: -DF_COMMAND = 'df -k %s' +DF_COMMAND = '/usr/local/bin/strace -f -s4096 -o /tmp/log df -k %s' then re-run the deploy step. if it still fails, you'll have a /tmp/log on the device you can scp off. attach that here.
,
Jul 26
After that change, the output of running `deploy_chrome` is:
$ deploy_chrome --build-dir=out_${SDK_BOARD}/Release --to=${MYDEVICE}
10:56:26: INFO: Staging flags taken from USE in environment: highdpi
10:56:26: INFO: Preparing device
10:56:26: INFO: Testing connection to the device...
10:56:29: INFO: Shutting down Chrome...
<class 'chromite.lib.cros_build_lib.RunCommandError'>: return code: 1; command: /usr/local/google/chromium/src/build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/bin/x86_64-cros-linux-gnu-strip --strip-unneeded -o /tmp/tmp1Jh2m_/chrome/chrome /usr/local/google/chromium/src/out_eve/Release/chrome
cmd=['/usr/local/google/chromium/src/build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/bin/x86_64-cros-linux-gnu-strip', '--strip-unneeded', '-o', '/tmp/tmp1Jh2m_/chrome/chrome', '/usr/local/google/chromium/src/out_eve/Release/chrome']
Traceback (most recent call last):
File "/usr/local/google/chromium/src/third_party/chromite/lib/parallel.py", line 441, in _Run
self._task(*self._task_args, **self._task_kwargs)
File "/usr/local/google/chromium/src/third_party/chromite/lib/parallel.py", line 653, in ReturnWrapper
queue.put(fn())
File "/usr/local/google/chromium/src/third_party/chromite/scripts/deploy_chrome.py", line 321, in _PrepareStagingDir
self.copy_paths, self.chrome_dir)
File "/usr/local/google/chromium/src/third_party/chromite/scripts/deploy_chrome.py", line 647, in _PrepareStagingDir
strip_flags=strip_flags, copy_paths=copy_paths)
File "/usr/local/google/chromium/src/third_party/chromite/lib/chrome_util.py", line 442, in StageChromeFromBuildDir
copied_paths += copier.Copy(build_dir, staging_dir, p, sloppy=sloppy)
File "/usr/local/google/chromium/src/third_party/chromite/lib/chrome_util.py", line 224, in Copy
self._CopyFile(p, dest, path)
File "/usr/local/google/chromium/src/third_party/chromite/lib/chrome_util.py", line 153, in _CopyFile
[self.strip_bin] + strip_flags + ['-o', dest, src])
File "/usr/local/google/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 669, in DebugRunCommand
return RunCommand(*args, **kwargs)
File "/usr/local/google/chromium/src/third_party/chromite/lib/cros_build_lib.py", line 646, in RunCommand
raise RunCommandError(msg, cmd_result)
RunCommandError: return code: 1; command: /usr/local/google/chromium/src/build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/bin/x86_64-cros-linux-gnu-strip --strip-unneeded -o /tmp/tmp1Jh2m_/chrome/chrome /usr/local/google/chromium/src/out_eve/Release/chrome
cmd=['/usr/local/google/chromium/src/build/cros_cache/chrome-sdk/tarballs/eve+10905.0.0+target_toolchain/bin/x86_64-cros-linux-gnu-strip', '--strip-unneeded', '-o', '/tmp/tmp1Jh2m_/chrome/chrome', '/usr/local/google/chromium/src/out_eve/Release/chrome']
This gets us a few steps further than before (previously, we only got to the "Preparing device" line).
After this failed, I looked in /tmp/log, but the directory did not actually exist.
,
Jul 26
that strip command is run on your build desktop, not on the device. so you should be able to run it yourself and see if it works.
,
Jul 26
Running the command doesn't succeed simply due to the fact that /tmp/tmp1Jh2m_/ does not exist after the build fails.
,
Jul 26
I've tried flashing 3 separate devices, and they all fail with the same error. Can anyone else provide any help?
,
Jul 26
the exact /tmp path is irrelevant. if it doesn't exist, pick some other random path in /tmp and try that instead.
,
Jul 26
,
Jul 26
assuming that's the -o file, that isn't a log, that's the actual Chrome binary. all that matters is that it worked, not that contents of it. so check the $? to make sure it's 0.
,
Jul 26
Sorry, but what do you mean by check the $?
,
Jul 26
$? is the standard shell variable that tells you the exit status of a command. so run the strip command and then check `echo $?` and make sure it's 0. if it's not, your system is broke. `df -h /tmp` on your desktop should show plenty of space.
,
Jul 26
At the advice of stevenjb@, I restarted by dev machine, and everything now works. Upon restart, however, I got a notice that my disk is nearly out of space. Mike, in your last comment, you mentioned "plenty of space". Does this mean that the error could have been caused by not having enough hard drive space? Presumably restarting the device would delete some temporary files and free up some space for the `deploy_chrome` command to succeed.
,
Jul 26
yes, all of your problems could easily be caused by a full or almost full /tmp a full /tmp can kill a lot of system things, not just deploy_chrome, so it's not something we normally test for. it shouldn't happen.
,
Jul 26
Should we change the error message displayed in this case to educate developers that they may want to check their remaining hard drive space? Or is this such an edge case that we should just close this bug out as WontFix?
,
Jul 26
which error message ? ;) you've run into two or three diff places, and if your /tmp as full, pretty much every use of tempfiles in chromite (there are lots) could potentially fail. as could just about every other program on your system that needs a temp file. i think "my /tmp is full" falls under "it's the sysadmin's problem". gLinux and such derivatives typically have system monitors/notifications for this thing.
,
Jul 26
Fair enough :P Closing out as WontFix. Thanks for the help! |
|||
►
Sign in to add a comment |
|||
Comment 1 by vapier@chromium.org
, Jul 25