Closed greggyb closed 2 years ago
Hi, For jail build - I haven't tested that, but it needs live internet connection for sure, so check that first (also there can be some ipc/mmap issues when running dotnet inside jail, so those should be also enabled, I think more details on that can be found in As for lttng, I know it's no longer available in pkg, it's been addressed already in https://github.com/dotnet/runtime/pull/63567 (you can follow the thread here https://github.com/dotnet/runtime/issues/14537#issuecomment-1006309245).
Please let me know if this helps, as this looks like duplicate of #6
Thanks for the rapid reply. Will take a look at your suggestions today and follow up here. (I'm also trying out some linux jails to see if it's more straightforward to use a packaged version of dotnet with linuxulator).
Quick notes:
Hm, then maybe it's blacklisted certificate error - have you made the fix for that (it's in the README of the repo) - I know that package validation have been disabled for FreeBSD also in main dotnet repo, but don't know if those changes are already live.
btw. last time I checked dotnet using linuxulator it wasn't working because of missing syscall's (initial plan was to use Linux binaries to bootstrap native build, but not possible at the moment, that's why we're using cross-build output).
edit: also lttng-ust issue is now resolved in main branch (added patch and removed from pkg install
)
Some more digging:
Changing jail settings has not made any difference:
I applied the change from the README:
mv /usr/share/certs/blacklisted/VeriSign_Universal_Root_Certification_Authority.pem /usr/share/certs/trusted
certctl rehash
This also made no difference.
I also get the same error when attempting to build a simple project in a Debian Buster jail environment. I followed the official instructions for installing the dotnet apt package. This yields a dotnet installation that can do some basic things (such as tell you its version or launch an fsi interactive session).
Attempting to build a project with no Nuget dependencies yields an error:
root@bust:~/letterbox# dotnet build
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/root/letterbox/letterbox.fsproj]
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Protocol not supported (api.nuget.org:443) [/root/letterbox/letterbox.fsproj]
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Protocol not supported [/root/letterbox/letterbox.fsproj]
Build FAILED.
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/root/letterbox/letterbox.fsproj]
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Protocol not supported (api.nuget.org:443) [/root/letterbox/letterbox.fsproj]
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Protocol not supported [/root/letterbox/letterbox.fsproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.70
Note this line, the first error from the build:
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/root/letterbox/letterbox.fsproj]
This is the same error text as in the build_runtime.sh
step:
(error excerpted from original issue error)
/root/dotnet-core-freebsd-source-build/runtime/artifacts/toolset/restore.proj : error : Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json.
In both cases, we see the build failing when attempting to load the service index. Both seem to be looking for a nuget repository at path .../v3/index.json.
I'm not sure what to do with this, but it appears that the issue is similar across a Linux jail and a FreeBSD jail environment, so I expect there's some issue with the jail config. Unfortunately, I'm not sure where to look next for this.
Note that I have network connectivity, including working DNS resolution and I have allowed raw sockets, so I should be able to do any network operations.
Well, if you can build outside of jail - then you know where the issue is :)
You could try to check if fetch https://api.nuget.org/v3/index.json
works inside jail, but I assume it is, as you wrote you have net/dns working.
Fetch works fine. This seems to be some dotnet functionality that is failing when running a build.
I hit other, later issues building outside of a jail (in build_installer.sh
) that I still need to troubleshoot.
So, I was able to find a solution here. Short version: the jail must have an ip6 address assigned (even if it's just a loopback address).
More in this issue on the same error: https://github.com/mono/mono/issues/21236
Specific comment with solution: https://github.com/mono/mono/issues/21236#issuecomment-948443375
I would recommend adding a note to this effect in the README. Sample to add an ip6 address with Bastille:
bastille config <jail-name> set ip6.address = fe80::2 # loopback address after the default assigned to host
Sample from jail.conf:
jail-name {
interface = bastille0;
ip4.addr = 10.0.0.11;
ip6.addr = fe80::2;
}
Note that you must make sure you do not also have a line with ip6 = disable;
.
Still troubleshooting the build, but this specific issue is done.
FreeBSD 13.0 host. FreeBSD 13.0-release jail (using BastilleBSD from pkg).
Jail config: