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

Exception of type 'Fake.Core.DocoptException' was thrown. #4

Closed
red-swan opened this issue May 4, 2018 · 21 comments
Closed

Exception of type 'Fake.Core.DocoptException' was thrown. #4

red-swan opened this issue May 4, 2018 · 21 comments

Comments

@red-swan
Copy link

red-swan commented May 4, 2018

I'm running Windows 7, F# 4.1, DotNet Core 2.1.103. When I run the command fake.cmd or fake.sh build I get the error in the title. This looks like an exception in the arguments for the FAKE build. I've run .paket/paket.exe install and yarn install but I still get the same build error. I'm an absolute beginner in the web space so I'm sure I'm missing something obvious. Do you know what that is?
Thank you

@red-swan
Copy link
Author

red-swan commented May 4, 2018

I've run the cmd lines in the command line: dotnet restore and then dotnet fake build and am getting further in the build script. Now the error is saying:

Possible Performance degradation, could not retrieve 'https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'NETStandard.Library'', ignoring further warnings for this source
Trial1 (NuGet.GetVersions) did not yield any results, trying again.
   https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='NETStandard.Library'
   https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'NETStandard.Library'
Performance:
 - Cli parsing: 384 milliseconds
 - Packages: 2 minutes, 8 seconds
   - Disk IO: 22 milliseconds
   - Average Request Time: 21 seconds
   - Number of Requests: 6
 - Script analyzing: 228 milliseconds
 - Runtime: 2 minutes, 8 seconds
Script failed
-> Could not find versions for package NETStandard.Library on https://www.nuget.org/api/v2. (Source 'https://www.nuget.org/api/v2' yielded no results (Request 'https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='NETStandard.Library'' finished with error) (Request 'https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'NETStandard.Library'' finished with error))
-> Source 'https://www.nuget.org/api/v2' yielded no results (Request 'https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='NETStandard.Library'' finished with error) (Request 'https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'NETStandard.Library'' finished with error)
        -  Request 'https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='NETStandard.Library'' finished with error
        -> Could not retrieve data from 'https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='NETStandard.Library''
        -> HttpRequestException: An error occurred while sending the request.
        -> WinHttpException: The operation timed out
        -  Request 'https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'NETStandard.Library'' finished with error
        -> Could not retrieve data from 'https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=tolower(Id) eq 'netstandard.library''
        -> HttpRequestException: An error occurred while sending the request.
        -> WinHttpException: The operation timed out

I've added a proxy to build.fsx and the error persists.

WebRequest.DefaultWebProxy <- new System.Net.WebProxy("my-company-proxy-here", true)

Trying to track down where this NETStandard.Library is coming from.

@red-swan
Copy link
Author

red-swan commented May 4, 2018

I had already added a proxy to nuget.config, I tried adding on to obj/build.proj.NuGet.Config and still the same error: Trial1 (NuGet.GetVersions) did not yield any results, trying again

@MangelMaxime
Copy link
Owner

@forki @matthid

Any ideas guys ? I don't have a windows computer so I can't test on it. But the CI is using AppVeyor and a windows image and it's green.

@matthid
Copy link

matthid commented May 4, 2018

Please try to setup your proxy according to this documentation: https://fsprojects.github.io/Paket/faq.html#I-am-behind-a-proxy-Can-I-use-Paket

And report back if it worked

@red-swan
Copy link
Author

red-swan commented May 4, 2018

No, it did not work. I'm going to try it at home to see if it truly is a proxy issue. The v2 api and v3 apis for nuget work just fine for me in other projects, which makes me think it's a project-specific setting here. I'll continue to look. Thank you.

@matthid
Copy link

matthid commented May 4, 2018

@red-swan Basically whatever you do - documentation of paket should in theory apply to fake as well. In theory you should have the same problem with raw paket (the only difference is paket running on full framework and fake on netcore)

Regarding the title of the issue: Should we change it? I guess the docopt-exception had some reasonable error message to figure out the problem?

@red-swan
Copy link
Author

red-swan commented May 5, 2018

Well it built. Must have something to do with my proxy. But the Yarn command didn't work. I ran yarn install manually and commented it from the build process, and the build script finished just fine. However upon openin up src, the index.html is just a blank page, it's missing the img/ folder, and I'm guessing something else is wrong because nothing really worked. Really wishing I could learn Fulma with this. Feel free to close this issue; I'll return to this repo when I've practiced a bit more and might be able to figure out the issue. Thanks for putting it all together.

@MangelMaxime
Copy link
Owner

Hum sorry for your bad experience...

Perhaps you can test the fulma template doc is here and if the template works then use it as a base for your application and copy/paste code from this repo ? etc.

But if this is really a proxy problem you will probably have the same problem with the template because it use more or less the same stack as this repo.

@matthid
Copy link

matthid commented May 5, 2018

Just to add one thing: We really need this kind of feedback from new people to improve the documentation or fix bugs. Without the details we don’t know what happened. Even if you figure it out the next might run into the same issue...

The yarn command didn’t work

Can you just post the log/output you saw?

Because nothing really worked

This is kind of hard for us to fix/improve on.

I know it might take you a minute or two to provide the details but only then you will find yourself in a potentially better place next time (the same goes for the docoptexception where we have no clue how to improve or understand what happened to you)

Also, knowing the details we might be able to give shortcuts or workarounds until the problem is fixed.

@MangelMaxime
Copy link
Owner

@matthid For info, it's not OS related because @mastoj is having the same problem under OSX.

@matthid
Copy link

matthid commented May 7, 2018

@MangelMaxime You mean the proxy problem, correct?

@MangelMaxime
Copy link
Owner

MangelMaxime commented May 7, 2018

I don't know, the only error I have from @mastoj is:

darwin17 
Restore completed in 31.24 ms for /Users/tomasjansson/tmp/fulma_play/MyApp/build.proj. 
Restore completed in 62.31 ms for /Users/tomasjansson/tmp/fulma_play/MyApp/build.proj. 
Restore completed in 62.31 ms for /Users/tomasjansson/tmp/fulma_play/MyApp/build.proj. 
Usage error: Exception of type 'Fake.Core.DocoptException' was thrown.

I didn't really understand all the discussion that happen in this issue. I hope, we will have more infos to understand the problem or be able to reproduce it.

@matthid
Copy link

matthid commented May 7, 2018

Ah wow so part of the problem is that the error message is actually bad. sorry I did not get it until now. Yes that can be fixed, as part of the docoptexception there is a more interesting message within. I assume one we know that we have more clues what's actually happening

@mastoj
Copy link

mastoj commented May 8, 2018

I can just confirm the error message I got, and @MangelMaxime posted above. I haven’t had the time to look any more into the issue since I got it right before boarding a flight.

@matthid
Copy link

matthid commented May 18, 2018

Please try to upgrade fake and report back if the new message is of any use (or if there is a bug)

@StachuDotNet
Copy link

StachuDotNet commented Jul 1, 2018

Hi there. I just got this issue now with the Fulma template (cc @MangelMaxime).

@matthid Can you please clarify "upgrade FAKE"?

Trying this: paket add dotnet-fake --version 5.1.0 yields the same issue:

> dotnet fake
Usage error: Exception of type 'Fake.Core.DocoptException' was thrown.

@matthid
Copy link

matthid commented Jul 1, 2018

@StachuDotNet what does dotnet fake --version say?

@StachuDotNet
Copy link

@matthid
dotnet fake --version
FAKE 5 - F# Make (5.0.0-rc011)
FakePath: C:\Users\Stachu.nuget\packages\fake.runtime\5.0.0-rc011\lib\netstandard2.0\Fake.Runtime.dll

@matthid
Copy link

matthid commented Jul 1, 2018

@StachuDotNet Apparently you are not using 5.1, please use 5.1 and report the error you get there

@MangelMaxime
Copy link
Owner

I just updated the template to use FAKE 5.1

@matthid
Copy link

matthid commented Jul 4, 2018

Honestly I think this can be closed. Basically you get a DocoptException if you entered an invalid CLI. The fake bug here was that it didn't exactly tell you what you did wrong (but you very very likely did something wrong see --help for syntax), but that has been fixed in 5.1

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

5 participants