Unable to Enter cros_sdk Environment (ubuntu 22.04)

51 views
Skip to first unread message

Randy Lai

unread,
May 22, 2025, 12:12:18 AMMay 22
to ChromiumOS Development
Hi everyone, could anyone help me? I'm unable to enter the cros_sdk environment. When I try to run the command, I encounter an issue. I'd really appreciate any help or suggestions. Thank you!"

x@x-Standard-PC-Q35-ICH9-2009:~/chromiumos$ repo sync
Fetching: 100% (275/275), done in 31.149s
Checking out: 100% (275/275), done in 0.264s
repo sync has finished successfully.
x@x-Standard-PC-Q35-ICH9-2009:~/chromiumos$ cros_sdk
cros_sdk: Unhandled exception:
Traceback (most recent call last):
  File "/home/x/chromiumos/chromite/bin/cros_sdk", line 213, in <module>
    DoMain()
  File "/home/x/chromiumos/chromite/bin/cros_sdk", line 209, in DoMain
    commandline.ScriptWrapperMain(FindTarget)
  File "/home/x/chromiumos/chromite/lib/commandline.py", line 1631, in ScriptWrapperMain
    _execute_target(target, argv, name)
  File "/home/x/chromiumos/chromite/lib/commandline.py", line 1640, in _execute_target
    ret = target(argv[1:])
          ^^^^^^^^^^^^^^^^
  File "/home/x/chromiumos/chromite/scripts/cros_sdk.py", line 869, in main
    cros_sdk_lib.MountChrootPaths(chroot)
  File "/home/x/chromiumos/chromite/lib/cros_sdk_lib.py", line 615, in MountChrootPaths
    osutils.Mount(
  File "/home/x/chromiumos/chromite/lib/osutils.py", line 1341, in Mount
    raise OSError(
FileNotFoundError: [Errno 2] Could not mount "/home/x/chromiumos" to "/home/x/chromiumos/chroot/mnt/host/source": No such file or directory



Mike Frysinger

unread,
May 22, 2025, 2:22:49 PMMay 22
to Randy Lai, ChromiumOS Development
does ~/chromiumos//chroot/mnt/host/source/ exist ?  that's baked into every SDK prebuilt.  if it's missing, your SDK is broken, and you should recreate it.
-mike

--
--
ChromiumOS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev

OpenOS Project

unread,
May 22, 2025, 2:26:23 PMMay 22
to Mike Frysinger, Randy Lai, ChromiumOS Development

Try this as well . . .

https://github.com/velzie/crumpet


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Randy Lai

unread,
May 26, 2025, 12:41:28 PMMay 26
to ChromiumOS Development, Mike Frysinger, ChromiumOS Development, Randy Lai
Hi Mike,
I am facing another issue, as described below.

Checking out: 97% (268/275) chromiumos/third_party/zephyr/hal_intelUpdating fileChecking out: 97% (269/275) chromiumos/third_party/u-bootUpdating files:  62% (2Checking out: 98% (270/275) chromiumos/third_party/zephyr/nanopbUpdating files: Checking out: 98% (271/275) chromiumos/third_party/zephyr/picolibcUpdating filesUpdating files: 100% (41276/41276), done.ng files:  97% (40038/41276)
Checking out: 99% (273/275) chromiumos/third_party/rust_cratesUpdating files:  7Updating files: 100% (6994/6994), done.
Checking out: 99% (274/275) chromiumos/third_party/zephyr/hal_stm32Updating fileUpdating files: 100% (45814/45814), done.
Checking out: 100% (275/275), done in 1m32.752s

repo sync has finished successfully.

x@x-Standard-PC-Q35-ICH9-2009:~/chromiumos$ cros_sdk
[sudo] password for x:
19:56:25.944: NOTICE: Replacing the chroot for version update None -> 2025.05.25.76891
19:56:25.946: NOTICE: Checking download of https://storage.googleapis.com/chromiumos-sdk/cros-sdk-2025.05.25.76891.tar.zst...
19:56:25.947: NOTICE: Deleting chroot: /home/x/chromiumos/chroot
19:56:25.947: NOTICE: Keeping output dir: /home/x/chromiumos/out
19:56:25.948: INFO: cros_sdk_lib.CleanupChroot.RmDir.Chroot: 0.000s
19:56:26.342: NOTICE: Downloading tarball cros-sdk-2025.05.25.76891.tar.zst ...
19:58:47.307: NOTICE: Creating chroot. This may take a few minutes...
19:58:48.969: INFO: Fetched CIPD package infra/tools/cipd/linux-amd64:421c4e26cdc255043f811b46e6cdd83b840dff8b3a331489481ca75511a64f86
19:58:50.603: INFO: run: tar --sparse -xf /home/x/chromiumos/.cache/sdks/cros-sdk-2025.05.25.76891.tar.zst --directory /home/x/chromiumos/chroot --use-compress-program /home/x/chromiumos/.cache/cipd/packages/chromiumos/infra/tools/zstd/abrFYnkC7NRoeegtP-DBjpFl2qboH8T8LC-9CevwR38C/bin/pzstd
19:58:53.179: INFO: cros_sdk_lib.ChrootCreator.run.ExtractSdkTarball: 5.867s
19:58:53.184: INFO: cros_sdk_lib.ChrootCreator.run: 5.877s
19:58:53.185: INFO: cros_sdk_lib.CreateChroot: 5.878s

cros_sdk: Unhandled exception:
Traceback (most recent call last):
  File "/home/x/chromiumos/chromite/lib/compression_lib.py", line 442, in extract_tarball
    result = rc_func(cmd, capture_output=True, encoding="utf-8")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/x/chromiumos/chromite/lib/cros_build_lib.py", line 866, in run
    raise RunCommandError(msg, cmd_result)
chromite.lib.cros_build_lib.RunCommandError: return code: 2; command: tar --sparse -xf /home/x/chromiumos/.cache/sdks/cros-sdk-2025.05.25.76891.tar.zst --directory /home/x/chromiumos/chroot --use-compress-program /home/x/chromiumos/.cache/cipd/packages/chromiumos/infra/tools/zstd/abrFYnkC7NRoeegtP-DBjpFl2qboH8T8LC-9CevwR38C/bin/pzstd
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

cmd=['tar', '--sparse', '-xf', '/home/x/chromiumos/.cache/sdks/cros-sdk-2025.05.25.76891.tar.zst', '--directory', '/home/x/chromiumos/chroot', '--use-compress-program', '/home/x/chromiumos/.cache/cipd/packages/chromiumos/infra/tools/zstd/abrFYnkC7NRoeegtP-DBjpFl2qboH8T8LC-9CevwR38C/bin/pzstd']

The above exception was the direct cause of the following exception:


Traceback (most recent call last):
  File "/home/x/chromiumos/chromite/bin/cros_sdk", line 213, in <module>
    DoMain()
  File "/home/x/chromiumos/chromite/bin/cros_sdk", line 209, in DoMain
    commandline.ScriptWrapperMain(FindTarget)
  File "/home/x/chromiumos/chromite/lib/commandline.py", line 1631, in ScriptWrapperMain
    _execute_target(target, argv, name)
  File "/home/x/chromiumos/chromite/lib/commandline.py", line 1640, in _execute_target
    ret = target(argv[1:])
          ^^^^^^^^^^^^^^^^
  File "/home/x/chromiumos/chromite/scripts/cros_sdk.py", line 860, in main
    cros_sdk_lib.CreateChroot(
  File "/home/x/chromiumos/chromite/lib/metrics_lib.py", line 304, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/x/chromiumos/chromite/lib/cros_sdk_lib.py", line 1451, in CreateChroot
    ChrootCreator(*args, **kwargs).run()
  File "/home/x/chromiumos/chromite/lib/metrics_lib.py", line 304, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/x/chromiumos/chromite/lib/cros_sdk_lib.py", line 1434, in run
    compression_lib.extract_tarball(self.sdk_tarball, self.chroot.path)
  File "/home/x/chromiumos/chromite/lib/compression_lib.py", line 444, in extract_tarball
    raise TarballError(
chromite.lib.compression_lib.TarballError: An error occurred when attempting to untar /home/x/chromiumos/.cache/sdks/cros-sdk-2025.05.25.76891.tar.zst:
return code: 2; command: tar --sparse -xf /home/x/chromiumos/.cache/sdks/cros-sdk-2025.05.25.76891.tar.zst --directory /home/x/chromiumos/chroot --use-compress-program /home/x/chromiumos/.cache/cipd/packages/chromiumos/infra/tools/zstd/abrFYnkC7NRoeegtP-DBjpFl2qboH8T8LC-9CevwR38C/bin/pzstd
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

cmd=['tar', '--sparse', '-xf', '/home/x/chromiumos/.cache/sdks/cros-sdk-2025.05.25.76891.tar.zst', '--directory', '/home/x/chromiumos/chroot', '--use-compress-program', '/home/x/chromiumos/.cache/cipd/packages/chromiumos/infra/tools/zstd/abrFYnkC7NRoeegtP-DBjpFl2qboH8T8LC-9CevwR38C/bin/pzstd']

Mike Frysinger

unread,
May 26, 2025, 11:17:57 PMMay 26
to Randy Lai, ChromiumOS Development
sounds like your system ran out of resources unpacking the SDK.  you can check `dmesg` or similar to see why it's failing.
-mike

Randy Lai

unread,
May 26, 2025, 11:34:22 PMMay 26
to ChromiumOS Development, Mike Frysinger, ChromiumOS Development, Randy Lai
Thanks it work,
I used 'dmesg' and found an OOM issue as below:
[59867.638808] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/us...@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-2a749408-4d1d-4797-8fa0-42f27e9c220a.scope,task=ld-linux-x86-64,pid=24922,uid=0
[59867.638830] Out of memory: Killed process 24922 (ld-linux-x86-64) total-vm:8516996kB, anon-rss:6510820kB, file-rss:256kB, shmem-rss:0kB, UID:0 pgtables:15240kB oom_score_adj:0
Then, I added swap memory to fix the issue
x@x-Standard-PC-Q35-ICH9-2009:~/chromiumos$ free -h
               total        used        free      shared  buff/cache   available
Mem:           7.8Gi       550Mi       6.5Gi       6.0Mi       761Mi       6.9Gi
Swap:           15Gi       946Mi        15Gi
Reply all
Reply to author
Forward
0 new messages