Back

error NU1301: Unable to load the service index

  • 1
  • Self Hosted
  • Functions
ilikechicken77
11 Nov, 2023, 09:17
TypeScript
Building ...
  Determining projects to restore...
/usr/local/build/StarterTemplate.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
  Failed to restore /usr/local/build/StarterTemplate.csproj (in 15.03 sec).```

The error obviously occurs due to network issues but but how do i debug it? Which containers need to have internet in order to build the functions?
The proxy setup is a little sluggish unfortunately so it works from time to time but most of the time it doesn't which i want to bypass by manually adding the proxy config..
TL;DR
The user is experiencing the error "NU1301: Unable to load the service index" when trying to build functions with Docker. They have tried setting up a local NuGet repository on the host machine, but are unsure of how to configure it for use in the building container. The user also mentions encountering TLS errors when trying to find packages. They are asking for suggestions on how to resolve these issues and how to debug network problems. Solution: - The user could try cloning the SDK repository, adding a reference to the directory, and using it as a class library. - The user can check out the provided thread on Stack Overflow
Drake
13 Nov, 2023, 01:32

Uhh new containers are spun up for each function for build

ilikechicken77
13 Nov, 2023, 14:43

makes sense but how do i make sure that they get internet access?

ilikechicken77
13 Nov, 2023, 14:46

i cant even get the default functions to work right now.. creating a new basic template with appwrite init function and appwrite deploy function for dotnet results in also in error NU1301: Unable to load the service index for source and I dont understand why

ilikechicken77
13 Nov, 2023, 14:59

*tested on 1.4.9 and 1.4.11

ilikechicken77
13 Nov, 2023, 15:15

btw. Is there a way to include the Appwrite nuget package in the function tarball so that im at least able to deploy it this way since i cant resolve the other issue right now😬

Drake
13 Nov, 2023, 20:45

How are you configuring your proxy? It sounds like you need the proxy in order to access the internet, is that right?

Drake
13 Nov, 2023, 20:46

sorry, I don't know enough about nuget to advise on this

ilikechicken77
13 Nov, 2023, 21:46

that is correct.. right now the ubuntu host machine is running a proxy setup with following envs no_proxy=*** ftp_proxy=*** https_proxy=*** http_proxy=*** . If i log into an appwrite container (e.g. executor, worker-functions..) I can curl google successfully with this setup. So if the containers have internet access the brought up containers which build the functions should have internet as well for fetching packages ??

ilikechicken77
13 Nov, 2023, 21:53

I did experiment with putting the proxy also in ./docker/config.json or directly into the docker-compose.yml but since the containers have internet access with just the system wide proxy playing with that seems unnecessary especially because i couldnt get it to work properly too

Drake
13 Nov, 2023, 21:58

That docker JSON config. That's in dockers system folder, right?

ilikechicken77
13 Nov, 2023, 22:14

Yes exactly

Drake
15 Nov, 2023, 20:31

interesting...i would expect that to apply to all containers then 🧐

ilikechicken77
16 Nov, 2023, 13:14

yes, I also tried deploying the templates of NodeJs and Dart which to my understanding all pull the appwrite sdk from network sources. Weirdly the NodeJS function deploys without issue every time but dotnet and dart cant connect to remote sources.

ilikechicken77
16 Nov, 2023, 13:15
TypeScript
Resolving dependencies...
It looks like pub.dartlang.org is having some trouble.
Pub will wait for a while before trying to connect again.
Got TLS error trying to find package pubspec at https://pub.dartlang.org.```
ilikechicken77
17 Nov, 2023, 16:58

To Bypass the Problem I setup a local nuget repository on the host machine but now I have the problem that in order to use it I have to mount the volume. I did that to a couple containers and I can access the repo from the containers but I dont know how to configure it so that it will get mounted in the container building the function? Which container is responsible for bringing up the runtimes and how can i get my volume in there?

ilikechicken77
17 Nov, 2023, 16:59
TypeScript
Building ...
  Determining projects to restore...
/usr/local/build/StarterTemplate.csproj : error NU1301: The local source '/packages' doesn't exist.
  Failed to restore /usr/local/build/StarterTemplate.csproj (in 263 ms). ```
Drake
21 Nov, 2023, 01:36

mount the volume into the build container? that sounds odd...your local repo doesn't act as a mirror in which you can connect to (presumably via HTTP)?

Drake
21 Nov, 2023, 01:38

@Aditya Oberai any suggestions about this one?

Aditya Oberai
21 Nov, 2023, 01:42

This seems to be a Docker issue that comes up when on devices with multiple network adapters

The following thread seems to cover solutions to this issue

https://stackoverflow.com/questions/50039331/unable-to-load-the-service-index-for-source-https-api-nuget-org-v3-index-json/59944594#59944594

Aditya Oberai
21 Nov, 2023, 01:43

You could clone the SDK repo, add a reference to the directory and use it as a class library if you want

https://github.com/appwrite/sdk-for-dotnet

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more