0

I am trying to set up a devcontainer that comes with octez-client pre-installed.

I've found that I can get it to work as long as I run the final apt-get install -y tezos-client command of the install process after the container is already running.

Ideally I would install it during the container build process to reduce the time required to spin up the container.

However, if I include the apt-get install -y tezos-client line in the build script, I always get an error (see below)

Is this avoidable? If so, is there anything I can do on the octez-client side, or will this be an issue with the devcontainer setup?

error message:

#0 64.53 Setting up tezos-client (2:17.1-0ubuntu1~jammy) ...

#0 64.56 breakpoint: Failed to write 'change' to '/sys/devices/breakpoint/uevent': Read-only file system

#0 64.56 dpkg: error processing package tezos-client (--configure):

#0 64.56  installed tezos-client package post-installation script subprocess returned error exit status 1

#0 64.56 Processing triggers for man-db (2.10.2-1) ...

#0 64.59 Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

#0 64.61 Errors were encountered while processing:

#0 64.61  tezos-client

#0 64.65 E: Sub-process /usr/bin/dpkg returned an error code (1)
#0 64.65 ERROR: Feature "bug demo" (ghcr.io/grum-tez/features_template/bug_demo) failed to install!
------
Dockerfile.extended:65
--------------------
  64 |     
  65 | >>> RUN --mount=type=bind,from=dev_containers_feature_content_source,source=bug_de
[2023-06-20T09:50:54.865Z] mo_5,target=/tmp/build-features-src/bug_demo_5 \
  66 | >>>     cp -ar /tmp/build-features-src/bug_demo_5 /tmp/dev-container-features \
  67 | >>>  && chmod -R 0755 /tmp/dev-container-features/bug_demo_5 \
  68 | >>>  && cd /tmp/dev-container-features/bug_demo_5 \
  69 | >>>  && chmod +x ./devcontainer-features-install.sh \
  70 | >>>  && ./devcontainer-features-install.sh \
  71 | >>>  && rm -rf /tmp/dev-container-features/bug_demo_5
  72 |     
--------------------
error: failed to solve: process "/bin/sh -c cp -ar /tmp/build-features-src/bug_demo_5 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/bug_demo_5  && cd /tmp/dev-container-features/bug_demo_5  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/bug_demo_5" did not complete successfully: exit code: 100
[2023-06-20T09:50:54.885Z] Stop (69534 ms): Run: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.42.0-1687254579348 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:jammy --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-dc_bug_demo-dc5dd49002b9a6367264358ed8984738df22be7038e098bbcc1a5247b4e53f77-features -f /tmp/devcontainercli-root/container-features/0.42.0-1687254579348/Dockerfile.extended /tmp/devcontainercli-root/empty-folder
[2023-06-20T09:50:54.886Z] Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.42.0-1687254579348 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:jammy --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-dc_bug_demo-dc5dd49002b9a6367264358ed8984738df22be7038e098bbcc1a5247b4e53f77-features -f /tmp/devcontainercli-root/container-features/0.42.0-1687254579348/Dockerfile.extended /tmp/devcontainercli-root/empty-folder
[2023-06-20T09:50:54.886Z]     at mte (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2003:3286)
[2023-06-20T09:50:54.886Z]     at IN (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2003:3222)
[2023-06-20T09:50:54.886Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-06-20T09:50:54.886Z]     at async Ote (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2020:3660)
[2023-06-20T09:50:54.886Z]     at async Hf (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2020:4775)
[2023-06-20T09:50:54.886Z]     at async Qre (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2151:10371)
[2023-06-20T09:50:54.887Z]     at async Zre (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2151:10112)
[2023-06-20T09:50:54.909Z] Stop (76027 ms): Run in container: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-1b93fead-819f-4598-bd6f-115c7d09d2311687254576284 --workspace-folder /workspaces/DC_bug_demo --workspace-mount-consistency cached --id-label vsch.local.repository=https://github.com/grum-tez/DC_bug_demo.git/tree/main --id-label vsch.local.repository.volume=DC_bug_demo-main-89cd92c2facc4612424c8118cc1f0a1020ca5bd75c6554bfced32695388d69cf --id-label vsch.local.repository.folder=DC_bug_demo --id-label devcontainer.config_file=/workspaces/DC_bug_demo/.devcontainer/devcontainer.json --log-level debug --log-format json --config /workspaces/DC_bug_demo/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-d6e04ef9-1716-44d5-ad4b-e8dc3a68bab7.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=DC_bug_demo-main-89cd92c2facc4612424c8118cc1f0a1020ca5bd75c6554bfced32695388d69cf,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root true
[2023-06-20T09:50:54.909Z] Exit code 1
[2023-06-20T09:50:54.909Z] Start: Run: docker rm -f e40ccf12c284514c770d59bf02874d0f90bca17ddfacf06f2ecc496457710cc6
[2023-06-20T09:50:54.912Z] Command failed: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-1b93fead-819f-4598-bd6f-115c7d09d2311687254576284 --workspace-folder /workspaces/DC_bug_demo --workspace-mount-consistency cached --id-label vsch.local.repository=https://github.com/grum-tez/DC_bug_demo.git/tree/main --id-label vsch.local.repository.volume=DC_bug_demo-main-89cd92c2facc4612424c8118cc1f0a1020ca5bd75c6554bfced32695388d69cf --id-label vsch.local.repository.folder=DC_bug_demo --id-label devcontainer.config_file=/workspaces/DC_bug_demo/.devcontainer/devcontainer.json --log-level debug --log-format json --config /workspaces/DC_bug_demo/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-d6e04ef9-1716-44d5-ad4b-e8dc3a68bab7.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=DC_bug_demo-main-89cd92c2facc4612424c8118cc1f0a1020ca5bd75c6554bfced32695388d69cf,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root true
[2023-06-20T09:50:54.912Z] Exit code 1
[2023-06-20T09:50:54.984Z] Stop (77403 ms): Run in container: /bin/sh
[2023-06-20T09:50:54.984Z] Container server terminated (code: 137, signal: null).
[2023-06-20T09:50:54.985Z] Stop (77491 ms): Run in container: /bin/sh
[2023-06-20T09:50:55.092Z] Stop (183 ms): Run: docker rm -f e40ccf12c284514c770d59bf02874d0f90bca17ddfacf06f2ecc496457710cc6
[2023-06-20T09:51:51.605Z] Start: Run: docker volume ls -q
[2023-06-20T09:51:51.667Z] Stop (62 ms): Run: docker volume ls -q
[2023-06-20T09:51:51.707Z] Start: Run: docker version --format {{.Server.APIVersion}}
[2023-06-20T09:51:51.763Z] Stop (56 ms): Run: docker version --format {{.Server.APIVersion}}
[2023-06-20T09:51:51.763Z] 1.43

References:

Example devcontainer (that will fail to build with error above. Also contains a working branch using postCreateCommand to install tezos-client): https://github.com/grum-tez/DC_bug_demo

The devcontainer features:

The buggy feature that I want to get working where the tezos-client install should happen during the container build (but fails): https://github.com/grum-tez/features_template/tree/main/src/bug_demo

The working feature where the tezos-client install happens after the container build: https://github.com/grum-tez/features_template/tree/main/src/octez-client-installer

I am using the following installation commands on ubuntu jammy:

apt-get update -y
apt-get install software-properties-common -y
add-apt-repository -y "ppa:serokell/tezos"
apt-get update
apt-get install -y tezos-client

A possibly relevant comment from GPT4:

The error message Failed to write 'change' to '/sys/devices/breakpoint/uevent': Read-only file system indicates that the tezos-client package is trying to write to a file on a read-only filesystem. Simply attempting to change permissions will not solve this issue as the entire filesystem is read-only.

It's unusual for a user-level software package like tezos-client to attempt to write to sysfs. That's typically only done by kernel-level software or device drivers.

The error you're encountering might be due to one of the following reasons:

The tezos-client package may have a bug or incorrect configuration that causes it to incorrectly attempt to write to sysfs.

The Docker container's environment may be configured in a way that the tezos-client package does not anticipate, causing it to behave incorrectly.

2
  • Permission issue? Ensure you are root during container build. Jun 20, 2023 at 15:10
  • According to the docs anything run in the feature install.sh script is run as root. I tried adding the line "runArgs": ["-u", "root"] in the devcontainer.json just in case, but it didn't seem to have an impact
    – Grum
    Jun 21, 2023 at 4:47

1 Answer 1

0

A hacky but effective solution to this problem was to call the octez-client installation commands directly with "onCreateCommand".

Running the commands in install.sh or the dockerfile did not work for me, but this did. I don't know why or how they are different.

Here's a devcontainer-feature.json that worked:

  "name": "octez-client installer",
  "id": "octez-client-installer",
  "version": "1.2.0",
  "description": "A feature to install octez-client on ubuntu 22.04 (Jammy)",
  "onCreateCommand": "sudo apt-get update -y && sudo apt-get install software-properties-common -y && sudo add-apt-repository -y \"ppa:serokell/tezos\" && sudo apt-get update -y && sudo apt-get install -y tezos-client"
}```

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.