Skip to content

Paket restore hangs when used with docker build #3123

Closed

Description

@jackmott

Description

paket restore hangs on my project when used in a docker build. It runs very quickly when I run it outside of a docker build. While hung the mono process is pegging 1 core. The last output of paket restore --verbose is "parsing paket.dependencies"

Repro steps

paket.dependencies:

framework >= net45

nuget DotLiquid
nuget FSharp.Data
nuget FsSql
nuget MathNet.Numerics.FSharp
nuget Newtonsoft.Json
nuget Npgsql = 3.1
nuget Octokit
nuget SQLProvider
nuget Suave >= 2.3.0-beta3
nuget Suave.DotLiquid >= 2.3.0-beta3
nuget Suave.Experimental >= 2.3.0-beta3

Dockerfile:

FROM fsharp:latest
ADD . /
WORKDIR /
RUN mono .paket/paket.bootstrapper.exe
RUN mono .paket/paket.exe restore --verbose
RUN ./build.sh
ENTRYPOINT ["mono","/root/AlphaFront/bin/Release/AlphaFront.exe"]

I am running docker build with a private github repo as the context

The repo is private so I am sorry I cannot provide it.

Expected behavior

paket should work

Actual behavior

paket hangs and pegs a cpu core

Known workarounds

none

Activity

  1. forki commented on Mar 17, 2018

    @forki
    Member
  2. jackmott commented on Mar 17, 2018

    @jackmott
    Author

    @forki any workarounds?

  3. forki commented on Mar 18, 2018

    @forki
    Member
  4. matthid commented on Mar 18, 2018

    @matthid
    Member

    As long as we don’t know how to reproduce or ge it into a debugger be accident. There is not much we can do.
    Maybe some http request doesn’t timeout correctly. Or some user message pops up on the ci for some reason...

  5. atadi96 commented on Feb 21, 2019

    @atadi96

    This is rendering me unable to create a repro for an issue with FAKE 5. What can I do in this case? Sorry if this in not the right place to ask but I'm lost.

    I've also found that paket restore does not hang when called in a gitlab-runner instance with docker runner.

  6. forki commented on Feb 22, 2019

    @forki
    Member

    Sorry we still don't know what's going wrong here

  7. ajuch commented on Nov 26, 2019

    @ajuch

    I'm having the same behavior with a .net core 3.0 sdk docker image.

    paket.dependencies:

    source https://api.nuget.org/v3/index.json
    
    storage: none
    framework: netcore3.0, netstandard2.0, netstandard2.1
    nuget canopy
    nuget Selenium.WebDriver.ChromeDriver
    

    Dockerfile:

    FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env
    COPY . ./
    RUN dotnet tool restore
    RUN dotnet paket restore -v
    

    It hangs at:

    Step 5/11 : RUN dotnet paket restore -v
     ---> Running in ace15e1382a0
    Paket version 5.236.6
    found: /paket.dependencies
     - /.paket/Paket.Restore.targets already up-to-date
    Parsing /paket.dependencies
    

    So I don't think it's a mono issue...

  8. forki commented on Nov 26, 2019

    @forki
    Member

    @ajuch cool thanks for the repro. I can actually reproduce it now

  9. forki commented on Nov 26, 2019

    @forki
    Member

    I added crazy amout of logging and here we are:

    image

  10. forki commented on Nov 26, 2019

    @forki
    Member

    so the problem is in https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/PaketConfigFiles/ProjectFile.fs#L1906

    we are scanning all subfolders but inside the docker main folder we seem to run into an issue that we scan the whole file system. So what can we do?

  11. added a commit that references this issue on Nov 26, 2019
    b4baa00
  12. forki commented on Nov 26, 2019

    @forki
    Member

    this is fixed in 5.238. thanks for the repro

  13. ajuch commented on Nov 26, 2019

    @ajuch

    Thank you @forki! It works!

    Ah, I see what I did wrong... I should have put my app into a directory... But the funny thing is that I didn't see the recursive crawling when running strace dotnet paket restore.

    But it doesn't matter, now it works like a charm!

  14. forki commented on Nov 26, 2019

    @forki
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions