Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet 6 feature fails to install #473

Closed
markphip opened this issue Mar 3, 2023 · 6 comments
Closed

dotnet 6 feature fails to install #473

markphip opened this issue Mar 3, 2023 · 6 comments

Comments

@markphip
Copy link
Contributor

markphip commented Mar 3, 2023

Have a devcontainer.json like this:

    "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
    "features": {
        "ghcr.io/devcontainers/features/common-utils:2": {
            "username": "vscode",
            "configureZshAsDefaultShell": true
        },
        "ghcr.io/devcontainers/features/dotnet:1": {
            "version": "6"
        }
     }

It fails to install dotnet sdk. Here is creation.log

#16 [dev_containers_target_stage 4/7] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=common-utils_1,target=/tmp/build-features-src/common-utils_1     cp -ar /tmp/build-features-src/common-utils_1 /tmp/build-features/  && chmod -R 0700 /tmp/build-features/common-utils_1  && cd /tmp/build-features/common-utils_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/build-features/common-utils_1
2023-03-03 22:54:31.438Z: #16 0.460 ===========================================================================
#16 0.460 Feature       : Common Utilities
#16 0.460 Description   : Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.
#16 0.460 Id            : ghcr.io/devcontainers/features/common-utils
#16 0.460 Version       : 2.0.8
#16 0.460 Documentation : https://github.com/devcontainers/features/tree/main/src/common-utils
#16 0.460 Options       :2023-03-03 22:54:31.439Z: 
#16 0.460     INSTALLZSH="true"
#16 0.460     CONFIGUREZSHASDEFAULTSHELL="true"
#16 0.460     INSTALLOHMYZSH="true"
#16 0.460     UPGRADEPACKAGES="true"
#16 0.460     USERNAME="vscode"
#16 0.460     USERUID="automatic"
#16 0.460     USERGID="automatic"
#16 0.460     NONFREEPACKAGES="false"
#16 0.460 ===========================================================================
#16 0.468 Marker file found:
#16 0.469     PACKAGES_ALREADY_INSTALLED=true
#16 0.469     LOCALE_ALREADY_SET=true
#16 0.469     EXISTING_NON_ROOT_USER=vscode
#16 0.469     RC_SNIPPET_ALREADY_ADDED=true
#16 0.469     ZSH_ALREADY_INSTALLED=true
#16 0.530 Done!
2023-03-03 22:54:31.589Z: #16 DONE 0.6s

2023-03-03 22:54:31.590Z: #17 [dev_containers_target_stage 5/7] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=dotnet_3,target=/tmp/build-features-src/dotnet_3     cp -ar /tmp/build-features-src/dotnet_3 /tmp/build-features/  && chmod -R 0700 /tmp/build-features/dotnet_3  && cd /tmp/build-features/dotnet_3  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/build-features/dotnet_3
2023-03-03 22:54:31.992Z: #17 0.481 ===========================================================================
#17 0.481 Feature       : Dotnet CLI
#17 0.481 Description   : Installs the .NET CLI. Provides option of installing sdk or runtime, and option of versions to install. Uses latest version of .NET sdk as defaults to install.
#17 0.481 Id            : ghcr.io/devcontainers/features/dotnet
#17 0.481 Version       : 1.1.3
2023-03-03 22:54:31.993Z: #17 0.481 Documentation : https://github.com/devcontainers/features/tree/main/src/dotnet
#17 0.481 Options       :
#17 0.481     VERSION="6"
#17 0.481     RUNTIMEONLY="false"
#17 0.481     INSTALLUSINGAPT="true"
#17 0.481 ===========================================================================
#17 0.492 (*) Installing .NET CLI...
2023-03-03 22:54:32.143Z: #17 0.492 Detected jammy on amd64. Attempting to install dotnet from apt
#17 0.520 (!) No full or partial for package "dotnet-sdk" (resolved: "") match found in apt-cache for "6" on OS ubuntu jammy (amd64).
#17 0.520 Continuing to fallback method if available
#17 0.520 Failed to find requested version.
2023-03-03 22:54:32.444Z: #17 0.815 Get:1 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy InRelease [10.5 kB]
#17 0.869 Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
#17 0.872 Get:3 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
#17 0.882 Get:4 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy/main amd64 Packages [90.1 kB]
2023-03-03 22:54:32.896Z: #17 1.260 Get:5 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [5557 B]
#17 1.315 Get:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
#17 1.340 Get:7 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [853 kB]
2023-03-03 22:54:33.021Z: #17 1.419 Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
#17 1.521 Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
2023-03-03 22:54:33.166Z: #17 1.593 Get:10 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [883 kB]
#17 1.666 Get:11 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [823 kB]
2023-03-03 22:54:33.274Z: #17 1.765 Get:12 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
#17 1.774 Get:13 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
2023-03-03 22:54:33.855Z: #17 2.245 Get:14 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
#17 2.273 Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1123 kB]
#17 2.283 Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [880 kB]
#17 2.316 Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1187 kB]2023-03-03 22:54:33.857Z: 
#17 2.355 Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [10.9 kB]
2023-03-03 22:54:34.156Z: #17 2.515 Get:19 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB]
2023-03-03 22:54:34.259Z: #17 2.759 Get:20 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [22.4 kB]
2023-03-03 22:54:34.862Z: #17 3.253 Fetched 26.2 MB in 3s (10.3 MB/s)
#17 3.253 Reading package lists...2023-03-03 22:54:35.462Z: 
2023-03-03 22:54:36.949Z: #17 5.449 APT_DOTNET_VERSION =6.0.113-0ubuntu1~22.04.1 
#17 5.449 DOTNET_PACKAGE dotnet-sdk-6.0-source-built-artifacts
2023-03-03 22:54:37.099Z: #17 5.449 Installing 'dotnet-sdk-6.0-source-built-artifacts=6.0.113-0ubuntu1~22.04.1 '...
#17 5.482 Reading package lists...2023-03-03 22:54:37.701Z: 
#17 6.127 Building dependency tree...2023-03-03 22:54:37.852Z: 
#17 6.235 Reading state information...
2023-03-03 22:54:38.003Z: #17 6.365 The following NEW packages will be installed:
#17 6.365   dotnet-sdk-6.0-source-built-artifacts
2023-03-03 22:54:38.304Z: #17 6.692 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
#17 6.692 Need to get 2873 MB of archives.
#17 6.692 After this operation, 2917 MB of additional disk space will be used.
#17 6.692 Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 dotnet-sdk-6.0-source-built-artifacts amd64 6.0.113-0ubuntu1~22.04.1 [2873 MB]
2023-03-03 22:55:56.927Z: #17 85.37 Fetched 2873 MB in 1min 16s (37.8 MB/s)
2023-03-03 22:55:57.078Z: #17 85.44 Selecting previously unselected package dotnet-sdk-6.0-source-built-artifacts.

#17 85.44 (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 21127 files and directories currently installed.)

#17 85.45 Preparing to unpack .../dotnet-sdk-6.0-source-built-artifacts_6.0.113-0ubuntu1~22.04.1_amd64.deb ...

#17 85.48 Unpacking dotnet-sdk-6.0-source-built-artifacts (6.0.113-0ubuntu1~22.04.1) ...

2023-03-03 22:56:10.607Z: #17 99.02 Setting up dotnet-sdk-6.0-source-built-artifacts (6.0.113-0ubuntu1~22.04.1) ...

2023-03-03 22:56:10.754Z: #17 99.25 ./install.sh: line 234: dotnet: command not found
2023-03-03 22:56:10.894Z: #17 99.25 ./install.sh: line 236: dotnet: command not found
#17 99.26 Done!

In this case we can switch to the dotnet:6 base image but thought I would report the problem regardless

@samruddhikhandale
Copy link
Member

Hi 👋

Interesting, I tried to create a dev container and it was successful with your dev config. Also, https://github.com/devcontainers/features/actions/runs/4328127322/jobs/7557499717 which runs test for dotnet Feature passed for all scenarios against "mcr.microsoft.com/devcontainers/base:ubuntu-22.04" image.

@markphip Wondering, what's your dev container CLI extension version? Also, are you trying locally or in a Codespace?

@markphip
Copy link
Contributor Author

markphip commented Mar 3, 2023

The log came from opening a Codespace (no prebuild)

I sporadically have had tests fail for features building on Ubuntu and never really looked closely since I was testing a bunch of different images. I wonder if the upstream apt repository is inconsistent? I thought dotnet was supposed to be in the Ubuntu upstream now? I wonder why it did not find the package? Maybe only dotnet 7 packages are available?

I will pay closer attention if I run into this myself again in the future.

@Clockwork-Muse
Copy link
Contributor

I'm hitting this too, on a local devcontainer; [email protected]

There was this issue, but the issue still persists, and here the proper package isn't being found at all (since it's not grabbing the dotnet6 or dotnet-sdk-6.0 packages, only the source-build-artifacts package)

That said, there are interesting instructions for registering the microsoft repo now, which might make things simpler. I've had conflicts on various recent debian releases because apt is complaining about duplicate keys; some of the features here (or in the community repo) place them in /etc/apt/..., and some in /usr/share/.... Note that although those instructions are only listed for Ubuntu, there are config packages for all (most?) of the listed distros.

@samruddhikhandale
Copy link
Member

Hi @Clockwork-Muse 👋

Can you paste your logs, I'd like to see what might be wrong because I am able to install .NET fine.

That said, there are interesting instructions for registering the microsoft repo now, which might make things simpler.

We do prioritize installing from Microsoft's apt if the OS allows, see here. I wonder if that's causing an issue for you, logs would be helpful in this case.

@Clockwork-Muse
Copy link
Contributor

@samruddhikhandale - Sorry I wasn't able to get to this before now.

Unfortunately, I've just re-run, and couldn't repro, and I've forgotten what other differences I may have had. I'll keep an eye out, though.

@samruddhikhandale
Copy link
Member

No worries, feel free to reopen the issue if needed.

@samruddhikhandale samruddhikhandale closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants