SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
282 stars 87 forks source link

Current template seems to fail #504

Closed NatElkins closed 2 years ago

NatElkins commented 2 years ago

I just tried installing the latest template and following the quickstart. It seems to fail on restore.

➜  Projects mkdir SafeStack
➜  Projects cd SafeStack 
➜  SafeStack dotnet new SAFE              
The template "SAFE-Stack Web App v3.1.1" was created successfully.
➜  SafeStack dotnet tool restore
Tool 'paket' (version '6.0.7') was restored. Available commands: paket
Tool 'fable' (version '3.2.11') was restored. Available commands: fable
Tool 'fantomas-tool' (version '4.5.2') was restored. Available commands: fantomas
Tool 'femto' (version '0.9.0') was restored. Available commands: femto

Restore was successful.
➜  SafeStack dotnet run
/Users/nat/Projects/SafeStack/.paket/Paket.Restore.targets(170,5): error MSB3073: The command "dotnet paket restore" exited with code 137. [/Users/nat/Projects/SafeStack/Build.fsproj]

The build failed. Fix the build errors and run again.
➜  SafeStack 

Here's my info:

➜  SafeStack dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.301
 Commit:    ef17233f86

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.1
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /usr/local/share/dotnet/sdk/5.0.301/

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  2.1.503 [/usr/local/share/dotnet/sdk]
  2.1.505 [/usr/local/share/dotnet/sdk]
  2.2.100 [/usr/local/share/dotnet/sdk]
  2.2.103 [/usr/local/share/dotnet/sdk]
  2.2.401 [/usr/local/share/dotnet/sdk]
  3.0.100 [/usr/local/share/dotnet/sdk]
  3.1.102 [/usr/local/share/dotnet/sdk]
  3.1.201 [/usr/local/share/dotnet/sdk]
  3.1.402 [/usr/local/share/dotnet/sdk]
  5.0.301 [/usr/local/share/dotnet/sdk]
  6.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.22 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Any thoughts?

olivercoad commented 2 years ago

Doing a search for code 137, most results seem to suggest it's related to high memory usage, and I was able to repro your error by running it in an environment with limitted memory.

Can you check how much free memory you have?

NatElkins commented 2 years ago

Doesn't seem that bad...

image

NatElkins commented 2 years ago

Here's what I see when I run dotnet paket restore:

➜  SafeStack dotnet paket restore
Failed to initialize CoreCLR, HRESULT: 0x80004005
NatElkins commented 2 years ago

Quit a bunch of things, same result:

image

NatElkins commented 2 years ago

This only seems to happen on dotnet paket restore. Other invocations of dotnet tools seem to work okay (although when they try to restore, it fails).

➜  SafeStack dotnet tool list
Package Id         Version      Commands      Manifest
-----------------------------------------------------------------------------------------------------
paket              6.0.7        paket         /Users/nat/Projects/SafeStack/.config/dotnet-tools.json
fable              3.2.11       fable         /Users/nat/Projects/SafeStack/.config/dotnet-tools.json
fantomas-tool      4.5.2        fantomas      /Users/nat/Projects/SafeStack/.config/dotnet-tools.json
femto              0.9.0        femto         /Users/nat/Projects/SafeStack/.config/dotnet-tools.json
➜  SafeStack dotnet femto
[17:24:24 INF] Analyzing project /Users/nat/Projects/SafeStack/Build.fsproj
[17:24:24 INF] Running dotnet restore against the project
[17:24:24 ERR] dotnet restore Failed with error MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
NatElkins commented 2 years ago

Updating Paket doesn't seem to resolve things either. I'll try restarting my computer soon to see if that helps.

NatElkins commented 2 years ago

Restarted, but the issue persists. When I try to restore a plain F# console app (without Paket) it works just fine.

➜  ~ cd ~/Projects
➜  Projects mkdir test_fsharp
➜  Projects cd test
➜  test cd ../test_fsharp
➜  test_fsharp dotnet new console -lang F#
The template "Console App" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /Users/nat/Projects/test_fsharp/test_fsharp.fsproj...
  Determining projects to restore...
  Restored /Users/nat/Projects/test_fsharp/test_fsharp.fsproj (in 240 ms).
Restore succeeded.

➜  test_fsharp dotnet run
Hello from F#
➜  test_fsharp cd ..
➜  Projects cd SafeStack
➜  SafeStack dotnet paket restore
Failed to initialize CoreCLR, HRESULT: 0x80004005

I will open an issue in their repo.

NatElkins commented 2 years ago

Looking at their repo I saw the following issue: https://github.com/fsprojects/Paket/issues/4088

I followed the advice, uninstalled everything using https://docs.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool?tabs=macos#step-3---uninstall-net-sdks-and-runtimes and then tried again. No issues this time around.