Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
395 stars 190 forks source link

[Issue] azd not installed correctly on mac m1 dev container for #3707

Open dfberry opened 5 months ago

dfberry commented 5 months ago

Azd doesn't work in dev container - this worked a week or two ago. It works if I run in on mac without dev container.

azd: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by azd)

Output from azd version Run azd version and copy and paste the output here:

Describe the bug

node ➜ /workspaces/cloud-infra (main) $ git log
commit 866a837edc72bb90c1c050317ebb424f027f1dc0 (HEAD -> main, origin/main, origin/HEAD)
Author: azure-sdk <azuresdk@microsoft.com>
Date:   Tue Apr 9 16:30:11 2024 +0000

    Synchronize repo from Repoman

commit 4aff7739b2e5bd1bfdcf495af1d58b32315a8e8d
Author: azure-sdk <azuresdk@microsoft.com>
Date:   Tue Mar 12 18:42:55 2024 +0000

node ➜ /workspaces/cloud-infra (main) $ azd auth login
azd: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by azd)
azd: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by azd)

To Reproduce

  1. Clone to local mac m1 14.3.1 (23D60)
  2. Open in vscode and then open dev container
  3. azd commands return error

Expected behavior A clear and concise description of what you expected to happen.

Environment Information on your environment:

Additional context image

pamelafox commented 5 months ago

I'm seeing this as well after a fresh rebuild without cache.

tomconte commented 4 months ago

Same problem on a freshly built dev container on Mac M1.

rajeshkamal5050 commented 4 months ago

@danieljurek can you take a look?

danieljurek commented 4 months ago

What is the image of the devcontainer? This can typically be found in the .devcontainer/devcontainer.json file.

dfberry commented 4 months ago
{
    "name": "Azure Developer CLI",
    "image": "mcr.microsoft.com/devcontainers/javascript-node:20-bullseye",
    "features": {
        "ghcr.io/devcontainers/features/docker-in-docker:2": {
        },
        "ghcr.io/azure/azure-dev/azd:latest": {}
    },
    "customizations": {
        "vscode": {
            "extensions": [
                "dbaeumer.vscode-eslint",
                "esbenp.prettier-vscode",
                "GitHub.vscode-github-actions",
                "ms-azuretools.azure-dev",
                "ms-azuretools.vscode-azurefunctions",
                "ms-azuretools.vscode-bicep",
                "ms-azuretools.vscode-docker",
                "ms-vscode.js-debug",
                "ms-vscode.vscode-node-azure-pack"
            ]
        }
    },
    "forwardPorts": [
        3000,
        3100
    ],
    "postCreateCommand": "",
    "remoteUser": "node",
    "hostRequirements": {
        "memory": "8gb"
    }
}

@pamelafox can you share yours as well?

danieljurek commented 4 months ago

I was able to reproduce the issue on an Apple Silicon mac. Previous releases (e.g. 1.7.0) did run successfully in this container but the current version is failing. I expect it to run properly.

Also, the current version does successfully run in other aarch64 containers (e.g. ubuntu:latest).

I suspect that this kind of error is related to a CGO compiler configuration and it's possible that this error is coming from a regression in the compile configs for ARM64 Linux owing to a recent migration of our engsys.

danieljurek commented 4 months ago

@dfberry -- I have a PR with a fix... You can try running this in your devcontainer as well.

I just verified that azd version works as expected using this build from the mcr.microsoft.com/devcontainers/javascript-node:20-bullseye container on an apple silicon mac.

curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3748/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3748 --version '' --verbose --skip-verify
dfberry commented 4 months ago

@danieljurek Works for me. Thank you for the quick fix.

image

dfberry commented 4 months ago

@danieljurek This is appearing again.

1) New clone of https://github.com/Azure-Samples/todo-nodejs-mongo-aca 2) Azd auth login fails

image

danieljurek commented 4 months ago

Reopening. This seems like a caching issue as installing azd directly int the devcontainer succeeds. I'm able to reproduce locally.

dfberry commented 4 months ago

Ok - an easy fix while waiting is to just install azd yourself.

curl -fsSL https://aka.ms/install-azd.sh | bash