alexfdezsauco / YourShipping.Monitor

YourShipping (a.k.a TuEnvio) has no public monitoring and notifications options. This is a basic app to monitoring specific departments and products from its well known uri.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The command '/bin/sh -c dotnet restore --source $NUGET_REPOSITORY_PROXY' returned a non-zero code

josedanielr opened this issue · comments

Hola

Cuando construyo la imagen me falla en ese paso, debajo pongo la salida completa. Probé con y sin VPN y nada, incluso desde el navegador accedí a uno de los ficheros que falla en descargar (https://api.nuget.org/v3-flatcontainer/telegram.bot/15.7.1/telegram.bot.15.7.1.nupkg) y sí lo descarga bien.

Qué pudiera estar sucediendo aquí?

Step 10/23 : RUN dotnet restore --source $NUGET_REPOSITORY_PROXY
 ---> Running in 7ba3df76bc56
  Determining projects to restore...
  Restored /build/src/YourShipping.Monitor/Shared/YourShipping.Monitor.Shared.csproj (in 442 ms).
  Failed to download package 'System.Text.Encoding.Extensions.4.0.11' from 'https://api.nuget.org/v3-flatcontainer/system.text.encoding.extensions/4.0.11/system.text.encoding.extensions.4.0.11.nupkg'.

  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'Telegram.Bot.15.7.1' from 'https://api.nuget.org/v3-flatcontainer/telegram.bot/15.7.1/telegram.bot.15.7.1.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'System.Text.Json.4.7.2' from 'https://api.nuget.org/v3-flatcontainer/system.text.json/4.7.2/system.text.json.4.7.2.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'Microsoft.EntityFrameworkCore.3.1.4' from 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/3.1.4/microsoft.entityframeworkcore.3.1.4.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'System.Runtime.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime/4.3.0/system.runtime.4.3.0.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'System.Collections.4.0.11' from 'https://api.nuget.org/v3-flatcontainer/system.collections/4.0.11/system.collections.4.0.11.nupkg'.
  An error occurred while sending the request.
    Transferred a partial file
  Failed to download package 'Microsoft.Extensions.DependencyInjection.3.1.7' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection/3.1.7/microsoft.extensions.dependencyinjection.3.1.7.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'Telegram.Bot.15.7.1' from 'https://api.nuget.org/v3-flatcontainer/telegram.bot/15.7.1/telegram.bot.15.7.1.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
  Failed to download package 'Microsoft.Extensions.DependencyInjection.3.1.7' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection/3.1.7/microsoft.extensions.dependencyinjection.3.1.7.nupkg'.
  The read operation failed, see inner exception.
    Transferred a partial file
/usr/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error : Failed to download package 'Telegram.Bot.15.7.1' from 'https://api.nuget.org/v3-flatcontainer/telegram.bot/15.7.1/telegram.bot.15.7.1.nupkg'. [/build/src/YourShipping.Monitor.sln]
/usr/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error : The read operation failed, see inner exception. [/build/src/YourShipping.Monitor.sln]
/usr/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error :   Transferred a partial file [/build/src/YourShipping.Monitor.sln]
/usr/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error : The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Telegram.Bot.15.7.1' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again. [/build/src/YourShipping.Monitor.sln]
/usr/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error :   Unable to find package 'Telegram.Bot.15.7.1'. [/build/src/YourShipping.Monitor.sln]
The command '/bin/sh -c dotnet restore --source $NUGET_REPOSITORY_PROXY' returned a non-zero code: 1
An error occurred when executing task 'DockerBuild'.
Error: Se han producido uno o varios errores.
        Docker: Process returned an error (exit code 1).

NuGet no requiere el uso de VPN. Al parecer "no tienes accesos a internet". Si estas ejecutando construyendo en Windows y estas detras de un proxy puedes que tengas algun problema.

Intenta ejecutar esto desde un container

    > curl -O https://api.nuget.org/v3-flatcontainer/telegram.bot/15.7.1/telegram.bot.15.7.1.nupkg

Sí estoy en Windows y no me conecto a través de un proxy.

Ya ejecuté el curl desde un contenedor que creé de mcr.microsoft.com/dotnet/core/sdk:3.1 y desde el mismo Dockerfile, en los dos casos funciona normalmente. Lo que noté que ahora cuando intenté hacer el build dio error descargando otros paquetes que no son los mismos de más arriba.

Posteé el error aquí por si era algo común o más trivial. Voy a probar otras vías a ver si doy con lo que es, tal vez sea un problema de mi entorno.

Entonces puede estar relacionado con la velocidad de conexión. Yo tengo un nexus local que me funciona de cache.

Antes de ejecutar el script de construcción asegurate que exista una variable de entorno NUGET_REPOSITORY_PROXY.

    > [System.Environment]::SetEnvironmentVariable("NUGET_REPOSITORY_PROXY","http://{HOST_IP}:{PORT}/repository/nuget.org-proxy/") 

Gracias, ya pude construir la imagen. Era por la velocidad de conexión como me dijiste. Al parecer los 2 Mbps que me da Etecsa no son suficientes para nuget :(

Por suerte tenía un Nexus también, aunque tuve que upgradearlo para que soportara nuget v3. Después de varios intentos para que cacheara todos los paquetes ya funcionó.