FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

System.Array Not Found Error

Open samueleaton opened this issue 2 years ago • 4 comments

I'm running with fsautocomplete --background-service-enabled --verbose and the logs show:

fsautocomplete: [13:55:47.620 INF] [Compiler] Finished Service_ParseAndCheckFileInProject: /Users/same/dev/REDACTED.fs_ProjectId=/Users/same/dev/REDACTED.fs.fsproj-Failed_Aborted

fsautocomplete: [13:55:47.620 INF] [Checker] ParseAndCheckFileInProject - "/Users/same/dev/REDACTED.fs" completed with errors: [{"Range": {"File": "unknown", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "$type": "Rng"}, "Severity": {"$type": "Error"}, "Message": "internal error: One or more errors occurred. (Assembly: The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array)", "Subcategory": "parameter", "ErrorNumber": 193, "ErrorNumberPrefix": "FS", "ErrorNumberText": "FS0193", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "StartLine": 0, "EndLine": 0, "StartColumn": 0, "EndColumn": 0, "FileName": "unknown", "$type": "FSharpDiagnostic"}]

fsautocomplete: [13:55:47.620 INF] [LSP] PositionHandler - Cached typecheck results not yet available for /Users/same/dev/REDACTED.fs

fsautocomplete: [13:55:47.640 INF] [Compiler] Finished Service_ParseAndCheckFileInProject: /Users/same/dev/REDACTED.fs_ProjectId=/Users/same/dev/REDACTED.fs.fsproj-Failed_Aborted

The main error being internal error: One or more errors occurred. (Assembly: The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array)

I'm on an Arm Mac, and running dotnet 7.0.100-preview.7.22377.5.

When I run the Troubleshoot Server command in Sublime Text, the server doesn't respond with any output:

Troubleshooting: fsautocomplete

Version

  • LSP: 1.18.0
  • Sublime Text: 4126

Server Test Run

  • exit code: 0
  • output

Server Configuration

  • command
[
  "fsautocomplete", 
  "--background-service-enabled", 
  "--verbose"
]
  • shell command
fsautocomplete --background-service-enabled --verbose
  • selector
source.fsharp

samueleaton avatar Aug 31 '22 21:08 samueleaton

We don't currently support running on 6.0.400 or the 7.0.100 previews, though there is a WIP PR [#999] that tracks adding and releasing that support.

baronfel avatar Aug 31 '22 21:08 baronfel

@baronfel I downgraded to 6.0.400 and still getting the same error. Although I think the version in my project shouldn't matter, since the fsautocomplete tool has it's own version in the tool bundle, no?

samueleaton avatar Aug 31 '22 22:08 samueleaton

I would expect the same error in certain situations on 6.0.400 - as I said we don't support it fully at the moment. The FSAC tool does not bundle the SDK in any way - in fact the opposite, it relies on the version of the SDK you point it at implicitly via your global.json.

baronfel avatar Aug 31 '22 22:08 baronfel

Oh sorry i misread as you support 6.0.400 not the 7.0.100 preview. My mistake. Downgraded my project global.json to 6.0.302 and it works now.

samueleaton avatar Sep 01 '22 04:09 samueleaton

Hello, @baronfel . Is version 0.58.2 supposed to be working with 7.0.100 sdk ? Because in my case the same error still happening.

gbtb avatar Dec 17 '22 13:12 gbtb

I installed .NET SDK 6.0.302 (dotnet-sdk-6.0=6.0.302-1 from apt) but this error still happens.

Due to this error, some of following requests (semanticTokens) ~fail~ don't work, unable to retrieve check results.

This is log from ionide-vscode-fsharp:

[14:02:42.456 INF] [Checker] ParseAndCheckFileInProject - "/home/owner/repo/fs-playground/Program.fs" completed with errors: [{"Range": {"File": "unknown", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "$type": "Rng"}, "Severity": {"$type": "Error"}, "Message": "internal error: One or more errors occurred. (Assembly: The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array)", "Subcategory": "parameter", "ErrorNumber": 193, "ErrorNumberPrefix": "FS", "ErrorNumberText": "FS0193", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "StartLine": 0, "EndLine": 0, "StartColumn": 0, "EndColumn": 0, "FileName": "unknown", "$type": "FSharpDiagnostic"}]

Machine Info
  • Operating system: Linux
  • Arch: x64
  • VSCode: 1.74.2
  • UI Kind: Desktop
  • Ionide: 7.4.0
  • Runtime: netcore
  • Dotnet version: 6.0.302

vain0x avatar Jan 02 '23 05:01 vain0x

The crash is coming from https://github.com/fsharp/FsAutoComplete/blob/d74332594a29b8bae412032a2e75a4818f7a633f/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs#L810

The solution seems to be to manually provide additional arguments to fsac at startup. --state-directory $PWD/.ionide. The directory is used to store the cache.

This works for me on linux with neovim-lsp client.

kaashyapan avatar Jan 10 '23 16:01 kaashyapan

Interesting - we should default to CWD for that parameter (see https://github.com/fsharp/FsAutoComplete/blob/main/src/FsAutoComplete/Parser.fs#L91-L97), does something about that cause a problem? Should we change the default for that 'state directory' to something other than the current directory?

baronfel avatar Jan 10 '23 16:01 baronfel

The crash is coming from

https://github.com/fsharp/FsAutoComplete/blob/d74332594a29b8bae412032a2e75a4818f7a633f/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs#L810

The solution seems to be to manually provide additional arguments to fsac at startup. --state-directory $PWD/.ionide. The directory is used to store the cache.

This works for me on linux with neovim-lsp client.

Adaptive doesn't use the state-directory so setting that wouldn't change its behavior.


Anything related to System.Array not being found is most likely an upstream issue with proj-info.

TheAngryByrd avatar Jan 10 '23 17:01 TheAngryByrd

I might get the same error. This happens upon trying to launch it within Helix.

Full log, see line 84

The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array

Thanks a lot

dotnet --version 7.0.102

fsautocomplete --version 0.58.4+379321556d666825ef0ba1f30e16ddc293abb512

ShalokShalom avatar Feb 12 '23 19:02 ShalokShalom

Closing this as I haven't seen this report in a while. If you're still experiencing this after a dotnet restore -c Debug then enable a binlog for your solution image

TheAngryByrd avatar Jul 14 '23 02:07 TheAngryByrd