Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.83k stars 325 forks source link

Error when installing Azurite vscode extension #2153

Closed gcarvajal1222 closed 1 year ago

gcarvajal1222 commented 1 year ago

vscode version:

Version: 1.81.1 (user setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

Steps to reproduce the issue?

Installing the extension, I get the error below: some of my teammates are able to see the same errors, while others can't

image

Have you found a mitigation/solution?

No

blueww commented 1 year ago

@gcarvajal1222

I see this issue also meet by other user with VS code 1.81.1 when install other extension. https://stackoverflow.com/questions/41530269/error-end-of-central-directory-record-signature-not-found-while-installing-ion And there's also a workaround in above link. Would you like to have a try? The Azurite extension vsix file can be download from https://marketplace.visualstudio.com/items?itemName=Azurite.azurite, by click "Download Extension" link in the right of page.

gcarvajal1222 commented 1 year ago

@blueww Thanks a lot for the response.

I am using devcontainers and my workaround was to install azurite as part of the docker build as root using npm:


ARG UBUNTU_VERSION=22.04
FROM ubuntu:$UBUNTU_VERSION

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG DEBIAN_FRONTEND=noninteractive

# Create non-root user
RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
    && apt-get update \
    && apt-get install -y sudo \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
    && chmod 0440 /etc/sudoers.d/$USERNAME

# Install npm and nodejs
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
    && apt-get install -y nodejs \
    npm

#azurite.azurite vscode extension not working properly
RUN npm install -g azurite

#switch to non-root user
USER $USERNAME
WORKDIR /home

and then in my postStartCommand, I check to see if I have the azurite.azurite installed and if not then start the services right away with azurite installed as part of the container:


extension_name="azurite.azurite"
if code --list-extensions | grep -q "$extension_name"; then
    echo "Extension $extension_name is installed"
else
    echo "Extension $extension_name is not installed, so lets start it ourselves"
    #run as root
    sudo azurite -s -l /azurite -d /azurite/debug.log
    echo "Successfully started all of Azurite Services"
fi

and this works just fine!

blueww commented 1 year ago

@gcarvajal1222

Thanks for the update!

I will close this issue as it looks has been resolved on your side. Feel free to contact us again if need any further assistance on Azurite.