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

Unmet requirements: Exists=>DotNetCoreRuntime(6\.|7\.)[\d\.]+_Path exists #168

Open
frogcrush opened this issue Nov 5, 2024 · 5 comments

Comments

@frogcrush
Copy link

Having an issue when using C# scripts as part of build steps. On one build agent configured a few years ago, it works fine. On a new build agent, it shows as incompatible:

Exists=>DotNetCoreRuntime(6\.|7\.)[\d\.]+_Path exists

New build agent is running Ubuntu 24.04 and I've installed both .NET 8, and .NET 6 for troubleshooting.

@lesley29
Copy link
Member

lesley29 commented Nov 6, 2024

Hey @frogcrush,

Could you please provide a few more details:

  1. Are you using TC Cloud or running it on-premises?
  2. Are your agents self-hosted or JB-provided (if you’re using the cloud)?
  3. Have there been any recent TeamCity version upgrades on your end?
  4. Are there any other build steps in the build configuration? Sometimes, additional steps can add requirements that affect compatibility for the whole build. Specifically, I’m wondering if you might have a “dotnet test” step with dotcover coverage enabled. In one of the recent upgrades this year, bundled tools were updated (dotcover included), which might have added a new requirement. Could you please check if this is the case?
  5. Even if that assumption is valid, it doesn’t fully explain why .NET is detected on one agent but not the other. So, another question: Is the compatible agent running the same Linux version? And does it have the expected property published?

@frogcrush
Copy link
Author

  1. On-prem
  2. Self-hosted
  3. I'm on 2024.07 (build 160569) but I will try and update now.
  4. Just Docker steps:
    image
  5. The working agent is running Ubuntu 20.04 and the not working one is running 24.04. One difference I believe is that the first agent might have the package installed from the Microsoft package repo, whereas the newer one installed from the Ubuntu package repo.

@lesley29
Copy link
Member

lesley29 commented Nov 7, 2024

One difference I believe is that the first agent might have the package installed from the Microsoft package repo, whereas the newer one installed from the Ubuntu package repo.

Looks like this might be the root of the issue. Right now, the plugin assumes .NET is installed in /usr/share/dotnet when it searches for runtimes on Linux. But with the switch from Microsoft’s repo to the native Ubuntu one in recent versions, the install path has changed to /usr/lib/dotnet.

As a workaround, you can set the DOTNET_HOME environment variable to /usr/lib/dotnet before starting the agent. This should help the plugin find the installed runtimes, and you’ll see the “DotNetCoreRuntime” parameters show up as expected. Please let me know if this helps

@lesley29
Copy link
Member

lesley29 commented Nov 7, 2024

I’ve also filed an YT ticket to update the logic for discovering installed .NET runtimes in the plugin - TW-90668.

Thanks for bringing this to our attention!

@frogcrush
Copy link
Author

I can confirm your workaround for setting DOTNET_HOME as an environment variable in my systemctl service configuration worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants