Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] devcontainer docker image build failure (chmod: cannot access .../cmdline-tools/10.0/bin) #37842

Open
martin-flaska opened this issue Mar 3, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@martin-flaska
Copy link

Reproduction steps

I was following setup steps for Visual Studio Code Development and got this error after the step 11:
At the bottom right of your Visual Studio Code window you should have a new box prompting you to re-open the window as a container. Hit yes.

[+] Building 174.0s (8/9)                                        docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 4.38kB                                     0.0s
 => WARN: InvalidDefaultArgInFrom: Default value for ARG ghcr.io/project-  0.0s
 => [internal] load metadata for ghcr.io/project-chip/chip-build-vscode:9  1.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/6] FROM ghcr.io/project-chip/chip-build-vscode:97@sha256:bc192bac3  0.0s
 => CACHED [2/6] RUN apt-get update     && apt-get install -y locales      0.0s
 => CACHED [3/6] RUN (getent passwd 1000 && userdel -f $(getent passwd 10  0.0s
 => CACHED [4/6] RUN curl https://raw.githubusercontent.com/restyled-io/r  0.0s
 => ERROR [5/6] RUN mkdir -p /opt/android/sdk     && chown -R vscode:vs  172.6s
------                                                                          
 > [5/6] RUN mkdir -p /opt/android/sdk     && chown -R vscode:vscode     /opt/android/sdk `# NXP uses a patch_sdk script to change SDK files`     /opt/android/sdk     /opt/espressif/tools     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "inc_lp" -print0 | xargs -0 chown -R vscode:vscode     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "inc_hp" -print0 | xargs -0 chown -R vscode:vscode     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "project_lp" -print0 | xargs -0 chown -R vscode:vscode     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "project_hp" -print0 | xargs -0 chown -R vscode:vscode     && chmod -R +x     /opt/android/sdk/cmdline-tools/10.0/bin `# sdkmanager for accepting licenses`    && chmod -R +w     /opt/espressif/tools     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "inc_lp" -print0 | xargs -0 chmod -R +w     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "inc_hp" -print0 | xargs -0 chmod -R +w     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "project_lp" -print0 | xargs -0 chmod -R +w     && find /opt/ameba/ambd_sdk_with_chip_non_NDA -name "project_hp" -print0 | xargs -0 chmod -R +w     && git config --global --add safe.directory "*"     && ::
172.5 chmod: cannot access '/opt/android/sdk/cmdline-tools/10.0/bin': No such file or directory

By commenting lines:

&& chmod -R +x \
    $ANDROID_HOME/cmdline-tools/10.0/bin `# sdkmanager for accepting licenses`\

I was able to build the container succesfully:

[4640 ms] Start: Run: /bin/sh -c bash .devcontainer/build.sh --tag matter-dev-environment:local --version 97
[+] Building 292.1s (10/10) FINISHED                             docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 4.38kB                                     0.0s
 => WARN: InvalidDefaultArgInFrom: Default value for ARG ghcr.io/project-  0.0s
 => [internal] load metadata for ghcr.io/project-chip/chip-build-vscode:9  1.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/6] FROM ghcr.io/project-chip/chip-build-vscode:97@sha256:bc192bac3  0.0s
 => CACHED [2/6] RUN apt-get update     && apt-get install -y locales      0.0s
 => CACHED [3/6] RUN (getent passwd 1000 && userdel -f $(getent passwd 10  0.0s
 => CACHED [4/6] RUN curl https://raw.githubusercontent.com/restyled-io/r  0.0s
 => [5/6] RUN mkdir -p /opt/android/sdk     && chown -R vscode:vscode    174.4s
 => [6/6] RUN sed -i '/^TIZEN_SDK_DATA_PATH/d' /opt/tizen-sdk/sdk.info     0.5s
 => exporting to image                                                   115.9s
 => => exporting layers                                                  115.8s
 => => writing image sha256:445552f05195bb4eaa13ce3af2d929bcb2c571f31af41  0.0s
 => => naming to docker.io/library/matter-dev-environment:local            0.0s

Done. Press any key to close the terminal.

I have no idea what was the root cause for this issue. But this line

chmod -R +x \
    $ANDROID_HOME/cmdline-tools/10.0/bin `# sdkmanager for accepting licenses`\

seems to be incorrect here, if ANDROID_HOME is /opt/android/sdk/ which is just created before this command, witghout installing cmdline-tools.

Unfortunatelly, I do not have all the logs before this happened first time.

Environment:

Kubuntu 24.04 VM

martin@vm-kubuntu:~/Dev/repositories/connectedhomeip$ uname -a
Linux vm-vantage 6.8.0-53-generic #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
martin@vm-kubuntu:~/Dev/repositories/connectedhomeip$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:        24.04
Codename:       noble

Bug prevalence

Whenever I do this - open VS code from the repo src tree, step #8 (I did not try to reinstall my OS env)

GitHub hash of the SDK that was being used

7c1d6f7

Platform

vscode

Platform Version(s)

1.97.2

Anything else?

Just followed steps in https://project-chip.github.io/connectedhomeip-doc/VSCODE_DEVELOPMENT.html.
I checked out latest master (at the time this problem happened it was 7c1d6f7).

@martin-flaska martin-flaska added bug Something isn't working needs triage labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant