DuendeSoftware / Support

Support for Duende Software products
20 stars 0 forks source link

Dependent packages for both BFF and Identity servers have different versions. #1382

Open LilitHakobyan opened 3 weeks ago

LilitHakobyan commented 3 weeks ago

Which version of Duende BFF are you using? BFF version 2.2.0 IdentityServer version 7.0.6 Which version of .NET are you using? .NET 8

Hello, Why do the dependent package "Microsoft.AspNetCore.Authentication.OpenIdConnect" and sub dependency "System.IdentityServer.Tokens.Jwt" for both BFF and Identity servers have different versions? For Bff version is 7.0.3 and for Identity server version is 7.1.2.

image image

May this cause the production build issues?

I am getting deployment errors regarding the 'Microsoft.IdentityModel.Tokens" package For one project where BFF installed is

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

      File name: 'Microsoft.IdentityModel.Tokens, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
         at Duende.LicenseValidator.ValidateKey(String licenseKey)
         at Duende.LicenseValidator.Initalize(ILoggerFactory loggerFactory, String productName, String key, Boolean isDevelopment) in /_/src/Duende.Bff/Licensing/LicenseValidator.cs:line 39

and for another where identity server package is installed is


System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

      File name: 'Microsoft.IdentityModel.Tokens, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
         at Duende.LicenseValidator`1.ValidateKey(String licenseKey)
         at Duende.LicenseValidator`1.Initialize(ILoggerFactory loggerFactory, String productName, String key) in /_/src/IdentityServer/Licensing/LicenseValidator.cs:line 55

Is Duende licensing involved here? We have a valid business license for Duende software.

Thanks

RolandGuijt commented 2 weeks ago

This doesn't seem related to licensing.

Within one project it's important to use the same versions of Microsoft.IdentityModel.* as we use in our packages. We get a lot of issues from customers where a mismatch leads to problems. Here's a doc that describes this. The potential problems don't include the error you're describing however.

Having two different Microsoft.IdentityModel.* versions in two separate projects shouldn't be an issue. You did mention these are deployment errors. Does this work as normal on a dev machine? And where are you trying to deploy to?

LilitHakobyan commented 2 weeks ago

Yes, it works as expected in the local dev environment. We are trying to deploy in kubernetes.

LilitHakobyan commented 1 week ago

With an updated Identity server and BFF, when running the command "dotnet list package --include-transitive | sls "Microsoft.IdentityModel|System.IdentityModel"" I got two different versions 6.35.0 and 7.1.2 , changed some package versions and now it's all in 7.1.2

`

Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2 Microsoft.IdentityModel.Protocols.OpenIdConnect 7.1.2 7.1.2 Microsoft.IdentityModel.Abstractions 7.1.2 Microsoft.IdentityModel.JsonWebTokens 7.1.2 Microsoft.IdentityModel.Logging 7.1.2 Microsoft.IdentityModel.Protocols 7.1.2 Microsoft.IdentityModel.Tokens 7.1.2 System.IdentityModel.Tokens.Jwt 7.1.2`

but the deployment issues still exist. image

image

Do you have any idea how to fix this issue?

RolandGuijt commented 6 days ago

Can you please check if the assemblies that cannot be loaded are on the actual pod and if it has the rights to read it?

LilitHakobyan commented 5 days ago

I am having difficulties checking the dlls on pods as the pods have CrashLoopBackOff status. Is there anything else that I can check meanwhile?

RolandGuijt commented 5 days ago

Nothing I can think of atm. Can you please report back as soon as you can do the checks?

LilitHakobyan commented 5 days ago

Yes, will let you know under this request.

LilitHakobyan commented 4 days ago

One update, after adding via Nuget the dependent packages that we saw in the pod error log and deploying again the error regarding the added package is gone but we had some kind of error about another package, we did the same steps and got the same kind of issue but for another package. All packages described above are related to BFF or Identity dependencies. Also, we have Microsoft.Data.SqlClient installed and this package contains similar dependencies.