question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

installing dotnet sdk on docker image fails with the new version of dotnet-sdk-5.0-5.0.404-1.x86_64 and aspnetcore-runtime-5.0.x86_64 0:5.0.13-1

See original GitHub issue

Describe the bug

We have a dockerfile that installs the dotnet sdk using yum with the following command: RUN yum install -y dotnet-sdk-5.0. It looks like there’s a new minor version that changed sometime today that is affecting our build pipeline where it fails in this docker build with the error posted below. It seems like some KEY is missing in the process. Last time this was working earlier today was when this command was using the versions dotnet-sdk-5.0-5.0.403-1.x86_64 and aspnetcore-runtime-5.0.x86_64 0:5.0.12-1. It is now failing on the versions dotnet-sdk-5.0-5.0.404-1.x86_64 and aspnetcore-runtime-5.0.x86_64 0:5.0.13-1.

To Reproduce

You can reproduce it by running yum install -y dotnet-sdk-5.0 on a docker image.

Exceptions (if any)

Step 5/15 : RUN yum install -y dotnet-sdk-5.0
 ---> Running in 70c3a7dce38e
Loaded plugins: ovl, priorities
Resolving Dependencies
--> Running transaction check
---> Package dotnet-sdk-5.0.x86_64 0:5.0.404-1 will be installed
--> Processing Dependency: netstandard-targeting-pack-2.1 >= 2.1.0 for package: dotnet-sdk-5.0-5.0.404-1.x86_64
--> Processing Dependency: dotnet-runtime-5.0 for package: dotnet-sdk-5.0-5.0.404-1.x86_64
--> Processing Dependency: dotnet-targeting-pack-5.0 for package: dotnet-sdk-5.0-5.0.404-1.x86_64
--> Processing Dependency: dotnet-apphost-pack-5.0 for package: dotnet-sdk-5.0-5.0.404-1.x86_64
--> Processing Dependency: aspnetcore-runtime-5.0 for package: dotnet-sdk-5.0-5.0.404-1.x86_64
--> Processing Dependency: aspnetcore-targeting-pack-5.0 for package: dotnet-sdk-5.0-5.0.404-1.x86_64
--> Running transaction check
---> Package aspnetcore-runtime-5.0.x86_64 0:5.0.13-1 will be installed
---> Package aspnetcore-targeting-pack-5.0.x86_64 0:5.0.0-1 will be installed
---> Package dotnet-apphost-pack-5.0.x86_64 0:5.0.13-1 will be installed
---> Package dotnet-runtime-5.0.x86_64 0:5.0.13-1 will be installed
--> Processing Dependency: dotnet-hostfxr-5.0 >= 5.0.13 for package: dotnet-runtime-5.0-5.0.13-1.x86_64
--> Processing Dependency: dotnet-runtime-deps-5.0 >= 5.0.13 for package: dotnet-runtime-5.0-5.0.13-1.x86_64
---> Package dotnet-targeting-pack-5.0.x86_64 0:5.0.0-1 will be installed
---> Package netstandard-targeting-pack-2.1.x86_64 0:2.1.0-1 will be installed
--> Running transaction check
---> Package dotnet-hostfxr-5.0.x86_64 0:5.0.13-1 will be installed
--> Processing Dependency: dotnet-host >= 5.0.13 for package: dotnet-hostfxr-5.0-5.0.13-1.x86_64
---> Package dotnet-runtime-deps-5.0.x86_64 0:5.0.13-1 will be installed
--> Processing Dependency: libicu for package: dotnet-runtime-deps-5.0-5.0.13-1.x86_64
--> Running transaction check
---> Package dotnet-host.x86_64 0:6.0.1-1 will be installed
---> Package libicu.x86_64 0:50.2-4.amzn2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                  Arch   Version      Repository                   Size
================================================================================
Installing:
 dotnet-sdk-5.0           x86_64 5.0.404-1    packages-microsoft-com-prod  85 M
Installing for dependencies:
 aspnetcore-runtime-5.0   x86_64 5.0.13-1     packages-microsoft-com-prod 8.0 M
 aspnetcore-targeting-pack-5.0
                          x86_64 5.0.0-1      packages-microsoft-com-prod 2.1 M
 dotnet-apphost-pack-5.0  x86_64 5.0.13-1     packages-microsoft-com-prod 4.6 M
 dotnet-host              x86_64 6.0.1-1      packages-microsoft-com-prod  67 k
 dotnet-hostfxr-5.0       x86_64 5.0.13-1     packages-microsoft-com-prod 170 k
 dotnet-runtime-5.0       x86_64 5.0.13-1     packages-microsoft-com-prod  29 M
 dotnet-runtime-deps-5.0  x86_64 5.0.13-1     packages-microsoft-com-prod 2.8 k
 dotnet-targeting-pack-5.0
                          x86_64 5.0.0-1      packages-microsoft-com-prod 3.1 M
 libicu                   x86_64 50.2-4.amzn2 amzn2-core                  6.8 M
 netstandard-targeting-pack-2.1
                          x86_64 2.1.0-1      packages-microsoft-com-prod 2.1 M

Transaction Summary
================================================================================
Install  1 Package (+10 Dependent packages)

Total download size: 141 M
Installed size: 406 M
Downloading packages:
warning: /var/cache/yum/x86_64/2/packages-microsoft-com-prod/packages/aspnetcore-targeting-pack-5.0.0.rpm: Header V4 RSA/SHA256 Signature, key ID be1229cf: NOKEY
Public key for aspnetcore-targeting-pack-5.0.0.rpm is not installed
--------------------------------------------------------------------------------
Total                                               35 MB/s | 141 MB  00:04     
Retrieving key from https://packages.microsoft.com/keys/microsoft.asc
Importing GPG key 0xBE1229CF:
 Userid     : "Microsoft (Release signing) <gpgsecurity@microsoft.com>"
 Fingerprint: bc52 8686 b50d 79e3 39d3 721c eb3e 94ad be12 29cf
 From       : https://packages.microsoft.com/keys/microsoft.asc
warning: /var/cache/yum/x86_64/2/packages-microsoft-com-prod/packages/dotnet-runtime-5.0.13-cm.1-x64.rpm: Header V4 RSA/SHA256 Signature, key ID 3135ce90: NOKEY
Retrieving key from https://packages.microsoft.com/keys/microsoft.asc


The GPG keys listed for the "packages-microsoft-com-prod" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


 Failing package is: dotnet-runtime-5.0-5.0.13-1.x86_64
 GPG Keys are configured as: https://packages.microsoft.com/keys/microsoft.asc

The command '/bin/sh -c yum install -y dotnet-sdk-5.0' returned a non-zero code: 1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Breadkentycommented, Jan 5, 2022

@leecow Thank you so much for looking into this, I completely forgot to update this issue. Im quite sure it was related to the issue you mentioned but the problem seems like it resolved itself the following day.

0reactions
leecowcommented, Jan 5, 2022

OK, I think I see that you’re using Amazon Linux.

I set up a clean docker image and registered packages.microsoft.com using the repo text file rather than the rpm to make confirm behavior without explicitly install the gpg key and that worked fine.

Results of yum install dotnet-sdk-5.0

Installing:
 dotnet-sdk-5.0                                         x86_64                         5.0.404-1                              packages-microsoft-com-prod                          85 M
Installing for dependencies:
 aspnetcore-runtime-5.0                                 x86_64                         5.0.13-1                               packages-microsoft-com-prod                         8.0 M
 aspnetcore-targeting-pack-5.0                          x86_64                         5.0.0-1                                packages-microsoft-com-prod                         2.1 M
 dotnet-apphost-pack-5.0                                x86_64                         5.0.13-1                               packages-microsoft-com-prod                         4.6 M
 dotnet-host                                            x86_64                         6.0.1-1                                packages-microsoft-com-prod                          67 k
 dotnet-hostfxr-5.0                                     x86_64                         5.0.13-1                               packages-microsoft-com-prod                         170 k
 dotnet-runtime-5.0                                     x86_64                         5.0.13-1                               packages-microsoft-com-prod                          29 M
 dotnet-runtime-deps-5.0                                x86_64                         5.0.13-1                               packages-microsoft-com-prod                         2.8 k
 dotnet-targeting-pack-5.0                              x86_64                         5.0.0-1                                packages-microsoft-com-prod                         3.1 M
 libicu                                                 x86_64                         50.2-4.amzn2                           amzn2-core                                          6.8 M
 netstandard-targeting-pack-2.1                         x86_64                         2.1.0-1                                packages-microsoft-com-prod                         2.1 M

During install, I was prompted to accept the Microsoft key.

Retrieving key from https://packages.microsoft.com/keys/microsoft.asc
Importing GPG key 0xBE1229CF:
 Userid     : "Microsoft (Release signing) <gpgsecurity@microsoft.com>"
 Fingerprint: bc52 8686 b50d 79e3 39d3 721c eb3e 94ad be12 29cf
 From       : https://packages.microsoft.com/keys/microsoft.asc
Is this ok [y/N]: y

And dotnet --info after install completed.

bash-4.2# dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.404
 Commit:    72c68b830a

Runtime Environment:
 OS Name:     amzn
 OS Version:  2
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.404/

Host (useful for support):
  Version: 5.0.13
  Commit:  b3afe99225

.NET SDKs installed:
  5.0.404 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
bash-4.2# dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.404
 Commit:    72c68b830a

Runtime Environment:
 OS Name:     amzn
 OS Version:  2
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.404/

Host (useful for support):
  Version: 5.0.13
  Commit:  b3afe99225

.NET SDKs installed:
  5.0.404 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

I then tried the same but manually imported the signature key and used packages-microsoft-prod.rpm to set up the repo registration. Installation also completed successfully and I did not get the signature challenge as mentioned earlier. It might be worthwhile for you to add this to your Dockerfile.

Here’s everything I ran up to the sdk install step…

bash-4.2# rpm --import https://packages.microsoft.com/keys/microsoft.asc
bash-4.2# wget http://packages.microsoft.com/config/fedora/34/packages-microsoft-prod.rpm
--2022-01-05 01:39:33--  http://packages.microsoft.com/config/fedora/34/packages-microsoft-prod.rpm
Resolving packages.microsoft.com (packages.microsoft.com)... 104.42.185.173
Connecting to packages.microsoft.com (packages.microsoft.com)|104.42.185.173|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7003 (6.8K) [application/x-redhat-package-manager]
Saving to: 'packages-microsoft-prod.rpm'

100%[==============================================================================================================================================>] 7,003       --.-K/s   in 0.001s

2022-01-05 01:39:33 (5.11 MB/s) - 'packages-microsoft-prod.rpm' saved [7003/7003]

bash-4.2# rpm -ivh packages-microsoft-prod.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:packages-microsoft-prod-1.0-1    ################################# [100%]
bash-4.2# yum install dotnet-sdk-5.0

We did have some file propagation issues for a day or so after release which may have led to this. @Breadkenty, please let us know if this is still an issue for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found