statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.65k stars 235 forks source link

Fresh .NET Install on Fedora 30 error installing nuget packages #834

Closed phillipsj closed 3 years ago

phillipsj commented 5 years ago

I keep running into this issue on Ubuntu and Fedora. After doing a fresh .NET installation, I install the global Wyam tool and everyting seems fine. However, when I execute:

wyam --recipe Blog --theme CleanBlog --update-packages --preview --watch

I get the following error:

Wyam version 2.2.4

                ,@@@@@@p
              ,@@@@@@@@@@g
            z@@@@@@@@@@@@@@@
          g@@@@@@@@@@@@@@@@@@@,
        g@@@@@@@@@@@@@@@@@@@@@@@,
      ,@@@@@@@@@@@@@@@@@@@@@@@@@@@
     ,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     $@@@@@@@@@@@@@@@@@@@@@@@@@@@@@c
     @@@@@@@@@@@@@@@@@@@@@@@@B@@@@@@
     @@@@@@@@@@@@@@@@@@@@@@@  j@@@@@
     $@@@@@@@@@@@@@@@@@@@@@F  #@@@@`
      $@@@@@@@@@@@@@@@@@@P   g@@@@P
       %@@@@@@@@@@@@@     ,g@@@@@P
        3@@@@@@@@@@@@@@@@@@@@@@B`
          `%@@@@@@@@@@@@@@@@@P
             `*%RB@@@@@RRP`
**BUILD**
Loading configuration from file:///home/phillipsj/config.wyam
Could not find configuration file at file:///home/phillipsj/config.wyam
Installing NuGet packages
    Installing packages to /home/phillipsj/.nuget/packages (using global packages folder)
        Install failed. Rolling back...
    Error while installing packages, attempting without remote repositories
    Error while installing packages, attempting to continue anyway
    NuGet packages installed in 6239 ms
Loading assemblies
    Assemblies loaded in 33 ms
Cataloging classes
    Classes cataloged in 198 ms
Error while loading configuration: System.Exception: The recipe "Blog" could not be found
   at Wyam.Configuration.Configurator.ApplyRecipe() in C:\Code\Wyam\src\core\Wyam.Configuration\Configurator.cs:line 358
   at Wyam.Configuration.Configurator.Configure(String script, FilePath configFilePath) in C:\Code\Wyam\src\core\Wyam.Configuration\Configurator.cs:line 180
   at Wyam.EngineManager.Configure() in C:\Code\Wyam\src\clients\Wyam\EngineManager.cs:line 126

I cannot determine what is causing this issue. However, I have a feeling if I try again later or tomorrow it will work without issue.

phillipsj commented 5 years ago

As you can see some packages get downloaded just fine.

image

phillipsj commented 5 years ago

However, some packages do not get downloaded correctly.

image

daveaglick commented 5 years ago

Ugh. Thanks for the detailed report. This looks exactly like #809 so we’ll track it in this issue now. Once is an anomaly...twice is a pattern.

To be honest, I’m not sure how much effort I want to put into investigating an intermittent NuGet issue at this point. If I weren’t so far along in v3, I’d absolutely consider this something that should be fixed and patched (or at least mitigated) given multiple users have reported. However, given that v3 doesn’t use the NuGet API at all and makes package resolution the responsibility of the standard NuGet project tools, any effort spent on this will only benefit in the very near term (and take away from progress on shipping v3).

All that said, I still appreciate the bug request. I’ll think on this and see if I can come up with a simple, low effort way to maybe issue a patch with some kind of retry logic or something.

phillipsj commented 5 years ago

Yep sounds good to me. I just wanted to share. It just worked for me after about an hour of waiting.

On Mon, May 13, 2019 at 8:07 PM Dave Glick notifications@github.com wrote:

Ugh. Thanks for the detailed report. This looks exactly like #809 https://github.com/Wyamio/Wyam/issues/809 so we’ll track it in this issue now. Once is an anomaly...twice is a pattern.

To be honest, I’m not sure how much effort I want to put into investigating an intermittent NuGet issue at this point. If I weren’t so far along in v3, I’d absolutely consider this something that should be fixed and patched (or at least mitigated) given multiple users have reported. However, given that v3 doesn’t use the NuGet API at all and makes package resolution the responsibility of the standard NuGet project tools, any effort spent on this will only benefit in the very near term (and take away from progress on shipping v3).

All that said, I still appreciate the bug request. I’ll think on this and see if I can come up with a simple, low effort way to maybe issue a patch with some kind of retry logic or something.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Wyamio/Wyam/issues/834?email_source=notifications&email_token=AAL63BIO6MN325OSNHX5FC3PVH7DXA5CNFSM4HMUKQC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVJ4QZA#issuecomment-492030052, or mute the thread https://github.com/notifications/unsubscribe-auth/AAL63BNP345NHRBS7XPXFCDPVH7DXANCNFSM4HMUKQCQ .

startewho commented 5 years ago

And i have the same problem on my win10 pc.and also i wait and try many times.it works.and i can find out the reason.

Vladekk commented 5 years ago

This is unfortunate thing, b/c it means we can't use build on netlify right now. And rolling back to older version does not seem to help. This means, basically, that generated site cannot be updated while either this is not fixed or v3 is shipped and config is updated to v3 (which can take some time and effort). I guess this is downside of static generators. I'd like to research this, maybe, but I currently only have machine without WSL. @daveaglick, if you have ideas and advice, how this can be debugged, i might try.

Vladekk commented 5 years ago

Okay, I think I solved it as a clutch, while we wait for Wyam v3. SImplest approach I could find is to populate packages locally and commit them into git repository. I used local wyam (unzipped into lib folder), dotnet command to run it.

It can be seen here https://github.com/Vladekk/izvne.com/commit/a5f6cb2758c7e4ec718e128e6675214f66e20196

https://github.com/Vladekk/izvne.com/commit/f081f024b8b334b5342b115b83b29f57d7523ba7

daveaglick commented 5 years ago

FYI - I just pushed out a surprise version 2.2.7 of Wyam which should resolve most of these odd NuGet errors people have been seeing. It turns out the version of the NuGet API Wyam is using isn't keeping up with what's going on with package signing and there were incompatibility issues. It shouldn't have installation problems going forward.

If you're still seeing intermittent package installation failures or getting errors about not being able to find the recipe, give the latest version a spin.

Vladekk commented 5 years ago

Thanks @daveaglick, good news. I am working on my blog sometimes, and improving there and here when I have time and resources. Appreciate your effort and really looking forward for new version with IDE support. This will really help with doing stuff like proper beautiful pagination etc, which takes more time now.

Vladekk commented 5 years ago

No luck for me, I guess. Still get errors. But now it is not critical, I think I am good to wait for next version. **BUILD** Loading configuration from file:///D:/Docs/Source/Izvne.com/Izvne.com/local.wyam Installing NuGet packages Installing packages to D:/Docs/Source/Izvne.com/Izvne.com/packages (using local packages folder) Cached package Wyam.Html 2.2.7 does not exist in packages folder Install failed. Rolling back... Error while installing packages, attempting without remote repositories Cached package Wyam.Html 2.2.7 does not exist in packages folder Error while installing packages, attempting to continue anyway NuGet packages installed in 6131 ms Loading assemblies Assemblies loaded in 68 ms Cataloging classes Classes cataloged in 83 ms Evaluating configuration script Error while loading configuration: System.IO.FileNotFoundException: Could not load file or assembly 'Wyam.Minification, Version=2.2.4.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. File name: 'Wyam.Minification, Version=2.2.4.0, Culture=neutral, PublicKeyToken=null' ---> System.IO.FileNotFoundException: Could not load the specified file. File name: 'Wyam.Minification' at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) at Script.Run() at Wyam.Configuration.Configurator.Evaluate(String code, FilePath configFilePath) in C:\Code\Wyam\Wyam\src\core\Wyam.Configuration\Configurator.cs:line 398 at Wyam.Configuration.Configurator.Configure(IFile configFile) in C:\Code\Wyam\Wyam\src\core\Wyam.Configuration\Configurator.cs:line 135 at Wyam.EngineManager.Configure() in :\Code\Wyam\Wyam\src\clients\Wyam\EngineManager.cs:line 123

daveaglick commented 5 years ago

Any chance you’ve still got it trying to load packages from a local folder due to the workaround?

Vladekk commented 5 years ago

Okay, it works now. I needed to restart shell. (ConEmu). It also works on WSL. I will try on netlify now.

Vladekk commented 5 years ago

Works on netlify! But for some reason, I needed to add line export DOTNET_ROOT=$HOME/.dotnet to build script. Now sure why, b/c same thing is in netlfiy build image dockerfile as ENV DOTNET_ROOT "/opt/buildhome/.dotnet"

daveaglick commented 3 years ago

Thanks for cleaning this one up @phillipsj - I'm obviously way behind on issue triage :)