biome-vscode: πŸ› __print_socket error: Operation not supported within DevContainer

VS Code version

1.91.1

Extension version

2.3.0

Biome version

0.3.3

Operating system

  • Windows
  • macOS
  • Linux

Description

[Error - 8:52:56 AM] Biome client: couldn't create connection to server.
Error: Command "/root/.vscode-server/data/User/workspaceStorage/239514837f70024c3fa8574e87e6a278/biomejs.biome/biome __print_socket" exited with code 1
Output:
internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Operation not supported (os error 95)
  
	at getSocket (/root/.vscode-server/extensions/biomejs.biome-2.2.2/out/main.js:36605:11)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async createMessageTransports (/root/.vscode-server/extensions/biomejs.biome-2.2.2/out/main.js:36619:16)
	at async LanguageClient2.createConnection (/root/.vscode-server/extensions/biomejs.biome-2.2.2/out/main.js:15598:28)
	at async LanguageClient2.start (/root/.vscode-server/extensions/biomejs.biome-2.2.2/out/main.js:15174:30)
	at async activate (/root/.vscode-server/extensions/biomejs.biome-2.2.2/out/main.js:36368:3)
	at async o.n (/vscode/vscode-server/bin/linux-arm64/5c3e652f63e798a5ac2f31ffd0d863669328dc4c/out/vs/workbench/api/node/extensionHostProcess.js:144:6237)
	at async o.m (/vscode/vscode-server/bin/linux-arm64/5c3e652f63e798a5ac2f31ffd0d863669328dc4c/out/vs/workbench/api/node/extensionHostProcess.js:144:6200)
	at async o.l (/vscode/vscode-server/bin/linux-arm64/5c3e652f63e798a5ac2f31ffd0d863669328dc4c/out/vs/workbench/api/node/extensionHostProcess.js:144:5657)

Steps to reproduce

Use the following Dockerfile as your DevContainer in VS Code, with the β€œdev-container” multi-stage image as the target:

FROM node:lts AS npm-packages
WORKDIR /src


FROM pulumi/pulumi-base:3.124.0 AS pulumi


FROM node:lts AS kubectl
WORKDIR /usr/local/bin

# install kubectl: https://stackoverflow.com/questions/51717471/how-to-install-kubectl-in-kubernetes-container-through-docker-image
RUN curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" \
    && chmod +x ./kubectl \
    && curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 \
    && chmod +x get_helm.sh && ./get_helm.sh


FROM node:lts AS dev-container
WORKDIR /src
SHELL ["/bin/bash", "-c"]

# install global NPM packages
RUN npm install --force --global pnpm
RUN SHELL=bash pnpm setup
ENV PNPM_HOME="/root/.local/share/pnpm"
ENV PATH="/root/.local/share/pnpm:$PATH"
RUN pnpm install --force --global \
  nx \
  playwright \
  biome \
  vitest

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
  --mount=type=cache,target=/var/lib/apt,sharing=locked \
  apt update && \
  playwright install-deps && \
  playwright install && \
  apt-get install --no-install-recommends -y \
  less \
  # install root certificates
  ca-certificates \
  # install JQ, needed for SSO integration for AWS: https://stackoverflow.com/questions/71789124/unable-to-use-jq-inside-docker-container-even-after-installing-jq-as-part-of-the
  jq \
  # install Azure CLI, needed for SSO integration for AWS: https://stackoverflow.com/questions/62030499/azure-cli-in-a-docker-container
  curl \
  apt-transport-https \
  lsb-release gnupg \
  # install Vim (often used to modify EKS ConfigMap): https://stackoverflow.com/questions/31515863/how-to-run-vi-on-docker-container
  vim \
  # install xdg to support opening browsers from within the devcontainer, needed for AWS SSO.
  xdg-utils \
  # install Python (needed for installation of UV)
  python3 \
  python3-pip \
  python3-dev \
  python3-venv \
  # install GCC (needed for installation of UV)
  gcc \
  # install and groff unzip (needed for installation of AWS CLI)
  unzip \
  groff

# install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
    unzip awscliv2.zip && ./aws/install

# install uv (needed for installing from requirements.txt)
RUN python3 -m pip install uv --break-system-packages

# install root certificates
COPY .devcontainer/certs/* /usr/local/share/ca-certificates/
RUN update-ca-certificates

# install Docker: https://stackoverflow.com/questions/44451859/how-to-install-docker-in-docker-container
RUN curl -fsSL https://get.docker.com | sh

# install GitHub CLI: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
  && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
  && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
  && apt update \
  && apt install gh -y

# install Python packages
COPY requirements.txt ./
RUN python3 -m venv /venv
ENV VIRTUAL_ENV=/venv
ENV PATH="${PATH}:/venv/bin"
RUN uv pip install --prerelease=allow -r requirements.txt 

# copy Pulumi binaries
ENV PATH="${PATH}:/root/pulumi/bin"
COPY --chmod=755 --from=pulumi /pulumi/bin /root/pulumi/bin
RUN pulumi version

# copy kubectl binaries
ENV PATH="${PATH}:/root/bin/kubectl"
COPY --chmod=755 --from=kubectl /usr/local/bin /root/bin/kubectl
RUN kubectl version --client=true

# sleeping forever is required for DevContainers.
CMD [ "sleep", "infinity" ]

I am running Docker on Mac, but the image is a Linux image.

Expected behavior

I expected it to not fail.

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Logs

Biome binary found at /workspaces/WATS/node_modules/.pnpm/@biomejs+cli-linux-arm64@1.8.3/node_modules/@biomejs/cli-linux-arm64/biome
Copying binary to temporary folder: file:///root/.vscode-server/data/User/workspaceStorage/e9d52a12c52088523ba00cfaa5b63593/biomejs.biome/biome
Executing Biome from: /root/.vscode-server/data/User/workspaceStorage/e9d52a12c52088523ba00cfaa5b63593/biomejs.biome/biome
[cli-stderr] data 222
[cli-stderr] end
[cli-stderr] finish
[cli-stdout] end
[cli-stdout] finish
[cli] exit 1
[Error - 3:16:00 PM] Biome client: couldn't create connection to server.
Error: Command "/root/.vscode-server/data/User/workspaceStorage/e9d52a12c52088523ba00cfaa5b63593/biomejs.biome/biome __print_socket" exited with code 1
Output:
internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Operation not supported (os error 95)
  


	at getSocket (/root/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:36539:11)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async createMessageTransports (/root/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:36553:16)
	at async LanguageClient2.createConnection (/root/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:15548:28)
	at async LanguageClient2.start (/root/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:15124:30)
	at async activate (/root/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:36294:3)
	at async c.n (/vscode/vscode-server/bin/linux-arm64/f1e16e1e6214d7c44d078b1f0607b2388f29d729/out/vs/workbench/api/node/extensionHostProcess.js:146:6384)
	at async c.m (/vscode/vscode-server/bin/linux-arm64/f1e16e1e6214d7c44d078b1f0607b2388f29d729/out/vs/workbench/api/node/extensionHostProcess.js:146:6347)
	at async c.l (/vscode/vscode-server/bin/linux-arm64/f1e16e1e6214d7c44d078b1f0607b2388f29d729/out/vs/workbench/api/node/extensionHostProcess.js:146:5804)
[cli-stdout] close
[cli] close 1
[cli-stderr] close

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 57 (56 by maintainers)

Most upvoted comments

More information has arrived.

2024-11-22 12:43:47.965 [info] Biome extension 2024.11.211321 activated
2024-11-22 12:43:48.921 [info] Copying binary to temporary location.
	original=/workspaces/WATS/node_modules/@biomejs/cli-linux-arm64-musl/biome
	destination=/root/.vscode-server/data/User/globalStorage/biomejs.biome/tmp-bin/biome-1.9.4
2024-11-22 12:43:48.989 [error] Biome language server error
	error=Error: write EPIPE
	message=[object Object]
	count=1
2024-11-22 12:43:48.990 [error] Failed to initialize the Biome language server
	error=Error: write EPIPE
2024-11-22 12:43:48.990 [error] Failed to start Biome extension
2024-11-22 12:43:48.990 [info] Biome extension started
2024-11-22 12:43:48.991 [info] User-facing commands registered
2024-11-22 12:43:48.991 [info] Started listening for lockfile changes
2024-11-22 12:43:48.991 [info] Started listening for configuration changes
2024-11-22 12:43:48.991 [info] Started listening for active text editor changes

Not sure why it’s copying to that destination. That destination is inside VS Code’s DevContainer files. I think this could be the root cause. It should copy to another directory, perhaps preferably inside /tmp or something.

The destination is inside the container due to how vscode-server works. This is a location provided by the VS Code API that extension authors can use to store global data related to the extension.

I’m unsure if this is why it fails, though. You could try to change the location and compile your own version of the extension to check if it happens when using a different destination.

@nhedger can you verify that you did the above, and clicked β€œClone in Volume” instead of β€œReopen in Container”?

Biome version 0.3.3

biome 0.3.3 looks a bit like https://www.npmjs.com/package/biome?

Manage environment variables in a sane way. Never push up secrets again!

Wondering if there’s a problem pnpm i -g biome somewhere in the vscode setup here, when it should have been pnpm i -g @biomejs/biome?

Bit me at least once.

After switching away from PNPM to Bun, all my issues (even with the old Biome) went away.

So must be related to how node_modules gets built.

In our project, we also had a .npmrc of these contents:

symlink=true
shamefully-hoist=true

The reproduction you provided did not include project dependencies. Please update your reproduction with the relevant setup.

@nhedger this is still an issue in the latest nightly. Can you reopen this?

Log output (from β€œBiome LSP”):

2024-09-10 06:40:59.221 [info] [Error - 6:40:59 AM] Server initialization failed.
2024-09-10 06:40:59.221 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.221 [info] [Error - 6:40:59 AM] biome client: couldn't create connection to server.
2024-09-10 06:40:59.221 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.221 [info] [Info  - 6:40:59 AM] Connection to server got closed. Server will restart.
2024-09-10 06:40:59.221 [info] true
2024-09-10 06:40:59.221 [info] internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Not supported (os error 95)
  


2024-09-10 06:40:59.221 [info] [Error - 6:40:59 AM] Server initialization failed.
2024-09-10 06:40:59.221 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.221 [info] [Error - 6:40:59 AM] biome client: couldn't create connection to server.
2024-09-10 06:40:59.221 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.221 [info] [Error - 6:40:59 AM] Restarting server failed
2024-09-10 06:40:59.221 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.221 [info] [Info  - 6:40:59 AM] Connection to server got closed. Server will restart.
2024-09-10 06:40:59.221 [info] true
2024-09-10 06:40:59.256 [info] internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Not supported (os error 95)
  


2024-09-10 06:40:59.266 [info] [Error - 6:40:59 AM] Client biome: connection to server is erroring. Shutting down server.
2024-09-10 06:40:59.266 [info] [Error - 6:40:59 AM] Stopping server failed
2024-09-10 06:40:59.266 [info] Error: Client is not running and can't be stopped. It's current state is: starting
    at BiomeLanguageClient.shutdown (/root/.vscode-server/extensions/biomejs.biome-2024.9.91939/out/index.js:46792:20)
    at BiomeLanguageClient.stop (/root/.vscode-server/extensions/biomejs.biome-2024.9.91939/out/index.js:46763:22)
    at BiomeLanguageClient.stop (/root/.vscode-server/extensions/biomejs.biome-2024.9.91939/out/index.js:47643:23)
    at BiomeLanguageClient.handleConnectionError (/root/.vscode-server/extensions/biomejs.biome-2024.9.91939/out/index.js:47024:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at processImmediate (node:internal/timers:449:9)
2024-09-10 06:40:59.266 [info] [Error - 6:40:59 AM] Server initialization failed.
2024-09-10 06:40:59.266 [info]   Message: write EPIPE
  Code: -32099 
2024-09-10 06:40:59.266 [info] [Error - 6:40:59 AM] biome client: couldn't create connection to server.
2024-09-10 06:40:59.266 [info]   Message: write EPIPE
  Code: -32099 
2024-09-10 06:40:59.266 [info] [Error - 6:40:59 AM] Restarting server failed
2024-09-10 06:40:59.266 [info]   Message: write EPIPE
  Code: -32099 
2024-09-10 06:40:59.266 [info] [Info  - 6:40:59 AM] Connection to server got closed. Server will restart.
2024-09-10 06:40:59.266 [info] true
2024-09-10 06:40:59.292 [info] internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Not supported (os error 95)
  


2024-09-10 06:40:59.293 [info] [Error - 6:40:59 AM] Server initialization failed.
2024-09-10 06:40:59.293 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.293 [info] [Error - 6:40:59 AM] biome client: couldn't create connection to server.
2024-09-10 06:40:59.293 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.293 [info] [Error - 6:40:59 AM] Restarting server failed
2024-09-10 06:40:59.293 [info]   Message: Cannot call write after a stream was destroyed
  Code: -32099 
2024-09-10 06:40:59.293 [info] [Info  - 6:40:59 AM] Connection to server got closed. Server will restart.
2024-09-10 06:40:59.293 [info] true
2024-09-10 06:40:59.310 [info] internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Not supported (os error 95)
  


2024-09-10 06:40:59.312 [info] internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Γ— Errors occurred while executing I/O operations.
    
    Caused by:
      Not supported (os error 95)
  


2024-09-10 06:40:59.324 [info] [Error - 6:40:59 AM] Server initialization failed.
2024-09-10 06:40:59.324 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-09-10 06:40:59.324 [info] [Error - 6:40:59 AM] The biome server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
2024-09-10 06:40:59.324 [info] [Error - 6:40:59 AM] biome client: couldn't create connection to server.
2024-09-10 06:40:59.324 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097