๐ __print_socket error: Operation not supported within DevContainer
Opened this issue ยท 56 comments
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
Thanks for the report. Would you mind providing a reproduction repo that contains the devcontainer configuration already set up ?
Sure! Here is a minimal repro where I just tested that it still happens: https://github.com/ffMathy/biome-repro-1
Remember to start the project in the Dev Container. I also think it is necessary to run it from a Mac machine.
Hey, I appreciate you taking the time. However, I'm not able to start the dev container because some mounts seem to be missing. It looks like this may be related to your personal setup. If you could provide a minimal setup, it would go a long way.
Actually I don't think the mounts are needed to repro it. I just forgot to remove those.
@nhedger any update given my reply? I updated the repro now to remove the bind mounts.
Should be fixed in the latest nightly.
@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
I can now confirm that only our Mac users are having this issue. The people with Windows work just fine.
Thanks for the deets, I'll try to reproduce it later today
Because Biome is installed globally using PNPM
RUN pnpm install --force --global \
nx \
playwright \
biome \
vitest
and /root/.local/share/pnpm
is in the PATH
ENV PATH="/root/.local/share/pnpm:$PATH"
the extension's Path Environment strategy is resolving the Biome binary to
/root/.local/share/pnpm/biome
This fails because /root/.local/share/pnpm/biome
is not the real Biome binary, but a wrapper shell script.
There are a couple of solutions:
-
Install Biome as part of your project's dependencies (if possible), and the extension will detect the correct binary for you
-
Install the actual Biome binary globally (make sure to uninstall it from the global pnpm store)
RUN curl -L "https://github.com/biomejs/biome/releases/download/cli%2Fv1.8.3/biome-linux-x64" -o biome \ && chmod +x biome \ && mv biome /usr/local/bin/biome
I already have it installed in my project's dependencies too, as well as global. It's still happening.
The reproduction you provided did not include project dependencies. Please update your reproduction with the relevant setup.
Alright, fair enough, but then I tried installing the package with the Dockerfile command you provided.
Here's the log output:
2024-09-10 19:32:28.042 [info] internalError/io โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ร Errors occurred while executing I/O operations.
2024-09-10 19:32:28.043 [info]
Caused by:
Not supported (os error 95)
2024-09-10 19:32:28.043 [info] [Error - 7:32:28 PM] Server initialization failed.
2024-09-10 19:32:28.043 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.043 [info] [Info - 7:32:28 PM] Connection to server got closed. Server will restart.
2024-09-10 19:32:28.043 [info] true
2024-09-10 19:32:28.044 [info] [Error - 7:32:28 PM] biome client: couldn't create connection to server.
2024-09-10 19:32:28.044 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.062 [info] internalError/io โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ร Errors occurred while executing I/O operations.
Caused by:
Not supported (os error 95)
2024-09-10 19:32:28.062 [info]
2024-09-10 19:32:28.063 [info] [Error - 7:32:28 PM] Server initialization failed.
2024-09-10 19:32:28.063 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.063 [info] [Info - 7:32:28 PM] Connection to server got closed. Server will restart.
2024-09-10 19:32:28.063 [info] true
2024-09-10 19:32:28.063 [info] [Error - 7:32:28 PM] biome client: couldn't create connection to server.
2024-09-10 19:32:28.063 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.080 [info] internalError/io โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ร Errors occurred while executing I/O op
2024-09-10 19:32:28.081 [info] erations.
Caused by:
Not supported (os error 95)
2024-09-10 19:32:28.082 [info] [Error - 7:32:28 PM] Server initialization failed.
2024-09-10 19:32:28.082 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.082 [info] [Info - 7:32:28 PM] Connection to server got closed. Server will restart.
2024-09-10 19:32:28.082 [info] true
2024-09-10 19:32:28.082 [info] [Error - 7:32:28 PM] biome client: couldn't create connection to server.
2024-09-10 19:32:28.082 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.082 [info] [Error - 7:32:28 PM] Restarting server failed
2024-09-10 19:32:28.082 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.100 [info] internalError/io โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2024-09-10 19:32:28.100 [info] ร Errors occurred while executing I/O operations.
Caused by:
Not supported (os error 95)
2024-09-10 19:32:28.100 [info] [Error - 7:32:28 PM] Server initialization failed.
2024-09-10 19:32:28.100 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.100 [info] [Info - 7:32:28 PM] Connection to server got closed. Server will restart.
2024-09-10 19:32:28.100 [info] true
2024-09-10 19:32:28.101 [info] [Error - 7:32:28 PM] biome client: couldn't create connection to server.
2024-09-10 19:32:28.101 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.101 [info] [Error - 7:32:28 PM] Restarting server failed
2024-09-10 19:32:28.101 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.117 [info] internalError/io โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ร Errors occurred while executing I/O operations.
Caused by:
Not supported (os error 95)
2024-09-10 19:32:28.118 [info] [Error - 7:32:28 PM] Server initialization failed.
2024-09-10 19:32:28.118 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.118 [info] [Error - 7:32:28 PM] 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 19:32:28.118 [info] [Error - 7:32:28 PM] biome client: couldn't create connection to server.
2024-09-10 19:32:28.118 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2024-09-10 19:32:28.118 [info] [Error - 7:32:28 PM] Restarting server failed
2024-09-10 19:32:28.118 [info] Message: Pending response rejected since connection got disposed
Code: -32097
I see that you devcontainer config also references the latest stable version of the extension. Have you tried with the pre-release ?
"customizations": {
"vscode": {
"extensions": [
- "biomejs.biome"
+ "biomejs.biome@prerelease"
]
}
},
Yeah, what I just do when I start up is to manually go in and switch to prerelease in the Extensions tab after the dev container has been built the first time.
My version in the above was: v2024.9.91939
I'm wondering if that leaves the devcontainer in a weird state. When I start it with the @prerelease
, the extension starts without issues. I'm also on macOS.
Do you have the same settings in Docker as I posted above in the screenshot? More specifically, I am suspecting the "filesystem" part might be relevant.
Edit: Changing to @prerelease
in the devcontainer file doesn't help for me.
I wish the extension could somehow debug on which line it's happening. Is that possible to retrieve somehow? Then maybe I can also help a bit.
Do you have the same settings in Docker as I posted above in the screenshot? More specifically, I am suspecting the "filesystem" part might be relevant.
Edit: Changing to
@prerelease
in the devcontainer file doesn't help for me.
I actually run OrbStack by default, but I just installed Docker Desktop and confirm that it works even with the same Docker settings as shown in your screenshot.
I wish the extension could somehow debug on which line it's happening. Is that possible to retrieve somehow? Then maybe I can also help a bit.
It is possible to debug the extension, but I don't know how/if this works in a devcontainer.
Edit: looks like it's possible, I pushed a devcontainer config to the repo if you'd like to try and reproduce.
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
Okay, it started happening again. Interestingly, when it happens, if I rebuild the DevContainer, it stops happening.
I noticed that by running tests a lot, we open a lot of ports. Could it have something to do with it trying to open sockets, but being exhausted due to some maximum socket count?
Does Biome try to communicate with any form of network connection somehow?
The current version of the extension does communicate with the Biome Daemon via sockets.
I suggest you try the preview release of the extension, which changes the way the extension connects to the Daemon (it won't use sockets anymore)
Then I don't think sockets is the root cause. Because when I was using the prerelease version earlier, it'd fail in the same way with the same error.
Right now, switching to the prerelease version of Biome does indeed work, but then again, I also currently can't repro the issue with the old stable version of Biome.
So let's leave this issue open until it happens again, and I can fully decide if switching to the prerelease will work.
But since I do not believe it will, can we theorize as to what might then be causing it? What kind of file-related operations is the Biome VS Code extension trying to do?
Can it have something to do with symlinking, binary aliases, long path names, or something similar?
Can we insert more logging to maybe find the cause?
Any suggestions on how I can help? โค๏ธ
I'd like to focus on releasing the current prerelease as stable. In your previous you mentioned switching to the prerelease kinda solved it. Are you now experiencing it also on the prerelease ? If so, we can try adding some more logging when we create the LSP session.
It still happens on the pre release. For both prerelease and current stable, it doesn't happen if I rebuild my container without cache and reinstall all my dependencies.
Never tried just one of those, so not sure which one solves it.
But then after some time, it starts happening. Also on prerelease. The latest logs I posted were from the prerelease.
Here's another prerelease log of this happening:
2024-10-21 09:00:05.954 [info] [Error - 9:00:05 AM] Biome language server error
2024-10-21 09:00:05.954 [info] [Error - 9:00:05 AM] Stopping server failed
2024-10-21 09:00:05.954 [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.10.131712/out/index.js:49778:21)
at BiomeLanguageClient.stop (/root/.vscode-server/extensions/biomejs.biome-2024.10.131712/out/index.js:49749:23)
at BiomeLanguageClient.stop (/root/.vscode-server/extensions/biomejs.biome-2024.10.131712/out/index.js:50659:24)
at BiomeLanguageClient.handleConnectionError (/root/.vscode-server/extensions/biomejs.biome-2024.10.131712/out/index.js:50010:20)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at processImmediate (node:internal/timers:454:9)
2024-10-21 09:00:05.954 [info] [Error - 9:00:05 AM] biome client: couldn't create connection to server.
2024-10-21 09:00:05.954 [info] Message: Cannot call write after a stream was destroyed
Code: -32099
2024-10-21 09:00:05.954 [info] [Error - 9:00:05 AM] Biome language server closed
2024-10-21 09:00:05.954 [info] internalError/io โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ร Errors occurred while executing I/O operations.
Caused by:
Not supported (os error 95)
I am not very familiar with "dev containers", but if they rely on web technologies (e.g. JS + WASM) to run the extensions, then all these errors are expected.
They do not. They run in Docker, on a full Docker container.
You can read more here: https://containers.dev/
It's an open standard that is adopted by VS Code, but is also soon adopted by JetBrains IDEs.
So, the OS error 95 hints at the fact that the dev container doesn't support sockets. However, this is just a wild guess, so I might be wrong
But doesn't the pre-release get rid of sockets? It still happens on pre-release.
And DevContainers do support sockets. They are just Docker containers. Anything supported in Docker will run just fine.
Also, it doesn't explain why it works initially, but then (over time) doesn't work anymore.
Can we insert more log statements to figure out exactly where it is happening?
Here's something interesting.
It's python, but should still be relevant. So apparently it can happen if you perform an operation on a working directory that doesn't exist.
Could this be inside the binary locator?
Again, way more logging could help out a ton.
Probably that part of the code doesn't have much logging, but here:
The problem is that this only enables logging in Biome itself from what I read?
I am 100% sure the problem is not in Biome itself. We also have a pre-commit hook that runs the Biome CLI. It works every single time.
This happens in the VS Code extension code, not Biome.
Since you say that code doesn't have much logging, does it make sense to add it perhaps? Just with a low enough log level, so we can see where it is failing.
Biome has a lot of logging, but the part that bootstraps the Daemon doesn't
Yes, I know. That's actually my point with these past comments:
does it make sense to add logging perhaps?
way more logging could help out a ton.
Can we insert more log statements to figure out exactly where it is happening?
Sorry, I am not sure how I can be more clear here. I was actually asking if it would make sense to add more logging. If you believe so, I am willing to help out and contribute with such a PR ๐
Oh yeah, that's definitely a welcomed PR!
Just had this happen in Windows as well, but not with prerelease:
[Error - 5:52:57 PM] Biome client: couldn't create connection to server.
Error: Command "/usr/local/share/npm-global/bin/biome __print_socket" exited with code 0
Output:
(node:2064) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
at getSocket (/home/node/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:36539:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at createMessageTransports (/home/node/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:36553:16)
at LanguageClient2.createConnection (/home/node/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:15548:28)
at LanguageClient2.start (/home/node/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:15124:30)
at a.value (/home/node/.vscode-server/extensions/biomejs.biome-2.3.0/out/main.js:36249:13)
Reloading client failed: Error: Command "/usr/local/share/npm-global/bin/biome __print_socket" exited with code 0
Output:
(node:2064) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
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.
I also had this error. Could be of interest. I think it's an error in the logger somehow. It's trying to call toString on some undefined error value. If this was solved, I believe I could get more information out of it.
2024-11-22 12:43:48.997 [info] TypeError: Cannot read properties of undefined (reading 'toString')
at Object.error (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:52206:28)
at BiomeLanguageClient.handleConnectionError (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:50596:72)
at errorHandler (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:50542:20)
at /root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:50925:38
at CallbackList.invoke (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:33328:41)
at Emitter.fire (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:33390:38)
at writeErrorHandler (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:34488:24)
at CallbackList.invoke (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:33328:41)
at Emitter.fire (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:33390:38)
at StreamMessageWriter.fireError (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:33917:29)
at Socket.<anonymous> (/root/.vscode-server/extensions/biomejs.biome-2024.11.211321/out/index.js:33954:49)
at Socket.emit (node:events:519:28)
at Socket.emit (node:domain:488:12)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
at runNextTicks (node:internal/process/task_queues:64:3)
at processImmediate (node:internal/timers:454:9)
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.
What I find very strange is that none of the log statements I added in a recent PR are shown.
How can I verify that I was using the right version with that included?
Make sure you're using the latest pre-release version.
Also, ensure that the logging level is set to Debug to see the debug logging.
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.
Use the Developer: Set Log Level...
command
Great!
Here are the latest logs:
2024-11-28 11:40:16.722 [info] Biome extension 2024.11.211321 activated
2024-11-28 11:40:16.722 [debug] Trying to find Biome binary in VS Code settings
bin=
2024-11-28 11:40:16.722 [debug] Trying to find Biome binary in Node Modules
path=file:///workspaces/WATS/
2024-11-28 11:40:16.722 [debug] Found Biome binary in Node Modules
path=/workspaces/WATS/node_modules/@biomejs/cli-linux-arm64-musl/biome
strategy=Node Modules
2024-11-28 11:40:16.722 [debug] Trying to find Biome binary in VS Code settings
bin=
2024-11-28 11:40:16.722 [debug] Trying to find Biome binary in Node Modules
path=file:///workspaces/WATS/
2024-11-28 11:40:16.722 [debug] Found Biome binary in Node Modules
path=/workspaces/WATS/node_modules/@biomejs/cli-linux-arm64-musl/biome
strategy=Node Modules
2024-11-28 11:40:17.012 [debug] A Biome binary for the same version 1.9.4 already exists in the temporary location.
original=/workspaces/WATS/node_modules/@biomejs/cli-linux-arm64-musl/biome
temporary=/root/.vscode-server/data/User/globalStorage/biomejs.biome/tmp-bin/biome-1.9.4
2024-11-28 11:40:17.012 [debug] Ensure binary is executable
binary=/workspaces/WATS/node_modules/@biomejs/cli-linux-arm64-musl/biome
before=is executable: true
after=is executable: true
2024-11-28 11:40:17.065 [error] Biome language server error
error=Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
message=[object Object]
count=1
2024-11-28 11:40:17.075 [error] Failed to initialize the Biome language server
error=Error: Cannot call write after a stream was destroyed
2024-11-28 11:40:17.075 [error] Failed to start Biome extension
I think we want to see what's in message=[object Object]
, and in the stack. I've published a new pre-release that improves the logging at this line. Would you mind trying again, and see if it prints additional info ?
I tried the latest version. Here's the output.
2024-11-29 10:23:47.805 [info] Biome extension 2024.11.291004 activated
2024-11-29 10:23:48.167 [error] Biome language server error
error=Error: write EPIPE
stack=Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:161:15)
at writeGeneric (node:internal/stream_base_commons:152:3)
at Socket._writeGeneric (node:net:954:11)
at Socket._write (node:net:966:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Socket.Writable.write (node:internal/streams/writable:508:10)
at /root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:35564:30
at new Promise (<anonymous>)
at WritableStreamWrapper.write (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:35554:17)
at StreamMessageWriter.doWrite (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33980:35)
at /root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33971:31
errorMessage=write EPIPE
message=2.0
count=1
2024-11-29 10:23:48.168 [error] Failed to initialize the Biome language server
error=Error: write EPIPE
What's weird though is that now, I don't see my own logs again (the ones about locating the binary etc).
And in the LSP logs, I see a new error now:
2024-11-29 10:23:48.197 [info] TypeError: Cannot read properties of undefined (reading 'jsonrpc')
at Object.error (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:52208:28)
at BiomeLanguageClient.handleConnectionError (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:50596:72)
at errorHandler (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:50542:20)
at /root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:50925:38
at CallbackList.invoke (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33328:41)
at Emitter.fire (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33390:38)
at writeErrorHandler (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:34488:24)
at CallbackList.invoke (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33328:41)
at Emitter.fire (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33390:38)
at StreamMessageWriter.fireError (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33917:29)
at Socket.<anonymous> (/root/.vscode-server/extensions/biomejs.biome-2024.11.291004/out/index.js:33954:49)
at Socket.emit (node:events:519:28)
at Socket.emit (node:domain:488:12)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
Would you mind trying with the following setup: https://github.com/nhedger/biome-repro-devcontainer ?
Please let me know if you still have the issue with this minimal repo.
Then I just get the following error:
2024-12-03 06:32:43.532 [info] Biome extension 2024.12.22126 activated
2024-12-03 06:32:44.083 [error] Could not find the Biome binary
2024-12-03 06:32:44.083 [error] Failed to create session for project.
project=/workspaces/biome-repro-devcontainer/
2024-12-03 06:32:44.084 [info] Biome extension started
2024-12-03 06:32:44.084 [info] User-facing commands registered
2024-12-03 06:32:44.084 [info] Started listening for lockfile changes
2024-12-03 06:32:44.084 [info] Started listening for configuration changes
2024-12-03 06:32:44.084 [info] Started listening for active text editor changes
And also, the repro says to just "open in devcontainer". That's not correct. You need to hit the "Clone in Volume", not the "Reopen in container" button. That part is important!
@nhedger can you verify that you did the above, and clicked "Clone in Volume" instead of "Reopen in Container"?
Seems to work in my case, even when using Clone Repository in Container Volume
.
2024-12-09 07:42:51.021 [info] Biome extension 2024.12.22126 activated
2024-12-09 07:42:51.034 [debug] Trying to find Biome binary in VS Code settings
bin=
2024-12-09 07:42:51.035 [debug] Trying to find Biome binary in Node Modules
path=file:///workspaces/biome-repro-devcontainer/
2024-12-09 07:42:51.108 [debug] Found Biome binary in Node Modules
path=/workspaces/biome-repro-devcontainer/node_modules/@biomejs/cli-linux-arm64-musl/biome
strategy=Node Modules
2024-12-09 07:42:51.124 [debug] A Biome binary for the same version 1.9.4 already exists in the temporary location.
original=/workspaces/biome-repro-devcontainer/node_modules/@biomejs/cli-linux-arm64-musl/biome
temporary=/root/.vscode-server/data/User/globalStorage/biomejs.biome/tmp-bin/biome-1.9.4
2024-12-09 07:42:51.124 [debug] Ensure binary is executable
binary=/workspaces/biome-repro-devcontainer/node_modules/@biomejs/cli-linux-arm64-musl/biome
before=is executable: true
after=is executable: true
2024-12-09 07:42:51.197 [info] Created session for project.
project=/
2024-12-09 07:42:51.197 [info] Biome extension started
2024-12-09 07:42:51.197 [info] User-facing commands registered
2024-12-09 07:42:51.197 [info] Started listening for lockfile changes
2024-12-09 07:42:51.198 [info] Started listening for configuration changes
2024-12-09 07:42:51.198 [info] Started listening for active text editor changes
2024-12-09 07:43:14.915 [debug] Active text editor changed.
editor=/workspaces/biome-repro-devcontainer/package.json
2024-12-09 07:44:39.447 [debug] Active text editor changed.
editor=biomejs.biome.Biome