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

Issue 825986 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

ImportError: No module named portage

Project Member Reported by ahass...@chromium.org, Mar 26 2018

Issue description

This morning I did a cros clean --safe and it seems it has messed up my chroot somehow that I think emerge binary has been removed. Here I logged the result of some relating commands. I'm going to clobber the chroot and make a new one. But I think there might be something wrong with cros clean --safe.


I don't even have emerge binary anymore:
(cr) ((cca3cfe...)) ahassani@ahassani ~/trunk/src/scripts
$ emerge
-bash: emerge: command not found

So basically I cannot even do build packages. Note that I have tried both repo sync and update_depot_tools.

(cr) ((cca3cfe...)) ahassani@ahassani ~/trunk/src/scripts
$ ./build_packages --board=amd64-generic
Chromium OS version information:
    CHROME_BASE=
    CHROME_BRANCH=67
    CHROME_VERSION=
    CHROMEOS_BUILD=10520
    CHROMEOS_BRANCH=0
    CHROMEOS_PATCH=2018_03_26_1251
    CHROMEOS_VERSION_STRING=10520.0.2018_03_26_1251
INFO    : Elapsed time (run_chroot_version_hooks): 0m0s
INFO    : Updating chroot
INFO    : Clearing shadow utils lockfiles under /
INFO    : Updating cross-compilers
/mnt/host/source/chromite/bin/cros_setup_toolchains: could not import chromite module: /mnt/host/source/chromite/bin/cros_setup_toolchains.py: No module named portage
Traceback (most recent call last):
  File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 169, in <module>
    DoMain()
  File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 165, in DoMain
    commandline.ScriptWrapperMain(FindTarget)
  File "/mnt/host/source/chromite/lib/commandline.py", line 890, in ScriptWrapperMain
    target = find_target_func(target)
  File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 140, in FindTarget
    module = cros_import.ImportModule(target)
  File "/mnt/host/source/chromite/lib/cros_import.py", line 44, in ImportModule
    module = __import__(target)
  File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 23, in <module>
    from chromite.lib import toolchain
  File "/mnt/host/source/chromite/lib/toolchain.py", line 24, in <module>
    import portage
ImportError: No module named portage
ERROR   : Mon Mar 26 12:51:15 PDT 2018
ERROR   :   PGID   PPID    PID     ELAPSED     TIME %CPU COMMAND
ERROR   :      8      4      8       00:11 00:00:00  1.3 -bash
ERROR   :    317      8    317       00:02 00:00:00  5.0  \_ /bin/bash ./build_packages --board=amd64-generic
ERROR   :    317    317    566       00:02 00:00:00  4.5      \_ /bin/bash /mnt/host/source/src/scripts/setup_board --quiet --board=amd64-generic --usepkg
ERROR   :    317    566    789       00:01 00:00:00  6.0          \_ /bin/bash /mnt/host/source/src/scripts/update_chroot --toolchain_boards=amd64-generic --usepkg
ERROR   :    317    789   1000       00:00 00:00:00  0.0              \_ /bin/bash /mnt/host/source/src/scripts/update_chroot --toolchain_boards=amd64-generic --usepkg
ERROR   :    317   1000   1001       00:00 00:00:00  0.0                  \_ ps f -o pgid,ppid,pid,etime,cputime,%cpu,command
ERROR   : Arguments of 789:  '--toolchain_boards=amd64-generic' '--usepkg'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :  update_chroot:85:main(), called: die_err_trap  
ERROR   : 
ERROR   : Command failed:
ERROR   :   Command 'sudo -E $(type -p cros_setup_toolchains) "${TOOLCHAIN_FLAGS[@]}"' exited with nonzero code: 1
ERROR   : Mon Mar 26 12:51:15 PDT 2018
ERROR   :   PGID   PPID    PID     ELAPSED     TIME %CPU COMMAND
ERROR   :      8      4      8       00:11 00:00:00  1.3 -bash
ERROR   :    317      8    317       00:02 00:00:00  5.0  \_ /bin/bash ./build_packages --board=amd64-generic
ERROR   :    317    317    566       00:02 00:00:00  4.5      \_ /bin/bash /mnt/host/source/src/scripts/setup_board --quiet --board=amd64-generic --usepkg
ERROR   :    317    566   1014       00:00 00:00:00  0.0          \_ /bin/bash /mnt/host/source/src/scripts/setup_board --quiet --board=amd64-generic --usepkg
ERROR   :    317   1014   1015       00:00 00:00:00  0.0              \_ ps f -o pgid,ppid,pid,etime,cputime,%cpu,command
ERROR   : Arguments of 566:  '--quiet' '--board=amd64-generic' '--usepkg'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :  setup_board:108:main(), called: die_err_trap  
ERROR   : 
ERROR   : Command failed:
ERROR   :   Command '"${SRC_ROOT}/scripts"/update_chroot ${UPDATE_ARGS}' exited with nonzero code: 1
ERROR   :   (Note bash sometimes misreports "command not found" as exit code 1 instead of 127)
ERROR   : Mon Mar 26 12:51:15 PDT 2018
ERROR   :   PGID   PPID    PID     ELAPSED     TIME %CPU COMMAND
ERROR   :      8      4      8       00:11 00:00:00  1.3 -bash
ERROR   :    317      8    317       00:02 00:00:00  5.0  \_ /bin/bash ./build_packages --board=amd64-generic
ERROR   :    317    317   1029       00:00 00:00:00  0.0      \_ /bin/bash ./build_packages --board=amd64-generic
ERROR   :    317   1029   1030       00:00 00:00:00  0.0          \_ ps f -o pgid,ppid,pid,etime,cputime,%cpu,command
ERROR   : Arguments of 317: ./build_packages '--board=amd64-generic'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :  build_packages:162:main(), called: die_err_trap  
ERROR   : 
ERROR   : Command failed:
ERROR   :   Command '"${SCRIPTS_DIR}"/setup_board --quiet --board=${FLAGS_board} "${UPDATE_ARGS[@]}"' exited with nonzero code: 1
ERROR   :   (Note bash sometimes misreports "command not found" as exit code 1 instead of 127)





 
Cc: dgarr...@chromium.org
Components: -Tools>ChromeOS-Toolchain Infra>Client>ChromeOS
To recover (if you haven't already), I would suggest doing
$cros_sdk --delete and do a cros_sdk to re-enter the chroot.

Infra team probably has a better idea of the failure you saw post cros clean.
Did you have a process inside the chroot non-stop?

If so, exit it fully, then reenter, and maybe setup board again.

Deleting the chroot is also a good idea. 
Status: WontFix (was: Untriaged)
Yeah, I exited all chroots before doing cros clean. But deleting the chroot did the job. To be sure, I did a cros clean --safe again to see if that was the cause, but nothing bad happened. So I'm guessing there was some sort of corruption in my old chroot which is gone now. Marking this as wontfix and Thanks everyone for the help.

Sign in to add a comment