Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Specified argument was out of the range of valid values. #1313

Closed
ebubekirtrkr opened this issue Jul 5, 2019 · 17 comments
Closed

Specified argument was out of the range of valid values. #1313

ebubekirtrkr opened this issue Jul 5, 2019 · 17 comments
Labels
bug Something isn't working upstream-dotnet

Comments

@ebubekirtrkr
Copy link

ebubekirtrkr commented Jul 5, 2019

Issue Type: Bug

When I open any python file "Specified argument was out of the range of valid values." notification occurs. Moreover, Python autocomplete can't work.
Note: I tried to update and downgrade Vscode version. I have tried on both version 1_35 and 1_36

Environment data

  • VS Code version: Code 1.35.1 (c7d83e57cd18f18026a8162d042843bda1bcf21f, 2019-06-12T14:27:31.086Z)
  • Extension version (available under the Extensions sidebar): 2019.6.22090
  • OS and version: Linux x64 4.15.0-54-generic
  • Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.15+
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: clipboard==0.0.4, random , selenium==3.141.0
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): XXX
System Info
Item Value
CPUs Intel(R) Celeron(R) CPU 1007U @ 1.50GHz (2 x 945)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: disabled_off
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: enabled_on
video_decode: unavailable_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 2
Memory (System) 3.74GB (0.11GB free)
Process Argv --unity-launch
Screen Reader no
VM 0%

Expected behaviour

XXX

Actual behaviour

XXX

Steps to reproduce:

  1. It is a pop-up notification in VSCode.

Logs

Pyhton Output Console

Starting Microsoft Python language server.
[Info  - 12:49:58 AM] Analysis cache path: /home/ebubekirtrkr/.cache/Microsoft/Python Language Server
[Info  - 12:49:58 AM] GetCurrentSearchPaths /usr/bin/python 
[Info  - 12:49:59 AM] Interpreter search paths:
[Info  - 12:49:59 AM]     /usr/lib/python2.7
[Info  - 12:49:59 AM]     /usr/lib/python2.7/plat-x86_64-linux-gnu
[Info  - 12:49:59 AM]     /usr/lib/python2.7/lib-tk
[Info  - 12:49:59 AM]     /usr/lib/python2.7/lib-dynload
[Info  - 12:49:59 AM]     /home/ebubekirtrkr/.local/lib/python2.7/site-packages
[Info  - 12:49:59 AM]     /usr/local/lib/python2.7/dist-packages
[Info  - 12:49:59 AM]     /usr/lib/python2.7/dist-packages
[Info  - 12:49:59 AM]     /usr/lib/python2.7/dist-packages/gtk-2.0
[Info  - 12:49:59 AM] User search paths:
[Info  - 12:49:59 AM]    /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2
[Info  - 12:49:59 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine
[Info  - 12:49:59 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/lib
[Info  - 12:49:59 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine/lib/endpoints-1.0
[Info  - 12:49:59 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0
[Error - 12:50:00 AM] Server initialization failed.
  Message: Specified argument was out of the range of valid values.
  Code: -32000 
   at System.ReadOnlySpan`1..ctor(Void* pointer, Int32 length)
   at Interop.Sys.DirectoryEntry.GetName(Span`1 buffer)
   at System.IO.Enumeration.FileSystemEntry.get_FileName()
   at System.IO.Enumeration.FileSystemEnumerableFactory.<>c__DisplayClass3_0.<UserFiles>b__1(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerable`1.DelegateEnumerator.ShouldIncludeEntry(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.Python.Core.IO.PathUtils.EnumerateFiles(String root, String pattern, Boolean recurse, Boolean fullPaths)+MoveNext() in E:\A\_work\1\s\src\Core\Impl\IO\PathUtils.cs:line 289
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at Microsoft.Python.Analysis.Modules.Resolution.ModuleResolutionBase.ReloadModulePaths(IEnumerable`1& rootPaths) in E:\A\_work\1\s\src\Analysis\Ast\Impl\Modules\Resolution\ModuleResolutionBase.cs:line 120
   at Microsoft.Python.Analysis.Modules.Resolution.MainModuleResolution.ReloadAsync(CancellationToken cancellationToken) in E:\A\_work\1\s\src\Analysis\Ast\Impl\Modules\Resolution\MainModuleResolution.cs:line 237
   at Microsoft.Python.Analysis.Modules.Resolution.MainModuleResolution.InitializeAsync(CancellationToken cancellationToken) in E:\A\_work\1\s\src\Analysis\Ast\Impl\Modules\Resolution\MainModuleResolution.cs:line 62
   at Microsoft.Python.Analysis.Analyzer.PythonInterpreter.LoadBuiltinTypesAsync(String root, IServiceManager sm, CancellationToken cancellationToken) in E:\A\_work\1\s\src\Analysis\Ast\Impl\Analyzer\PythonInterpreter.cs:line 59
   at Microsoft.Python.Analysis.Analyzer.PythonInterpreter.CreateAsync(InterpreterConfiguration configuration, String root, IServiceManager sm, CancellationToken cancellationToken) in E:\A\_work\1\s\src\Analysis\Ast\Impl\Analyzer\PythonInterpreter.cs:line 67
   at Microsoft.Python.LanguageServer.Implementation.Server.InitializeAsync(InitializeParams params, CancellationToken cancellationToken) in E:\A\_work\1\s\src\LanguageServer\Impl\Implementation\Server.cs:line 145
   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Initialize(JToken token, CancellationToken cancellationToken) in E:\A\_work\1\s\src\LanguageServer\Impl\LanguageServer.Lifetime.cs:line 36

Problems

No problems have been detected in the workspace so far.
@ericsnowcurrently
Copy link

Thanks for letting us know about this, @ebubekirtrkr. Where are you seeing that message? Is it a pop-up notification in VSCode or is it in one of the output panels? What is in the "Python" output panel? What about the "Problems" panel? Also, are you using Jedi or the new language server? (i.e. what is "python.jediEnabled" set to; more info #3977)

Note, you left out a bunch of helpful details that we asked for in the issue template. I've pasted the template into the issue above, so please make sure it is filled out. Thanks!

@ebubekirtrkr
Copy link
Author

I have added a little more information. Also when I turn "python.jediEnabled" on, problems not occurs.

@ericsnowcurrently
Copy link

Thanks. So this appears to be a problem with the language server. I'm going to send the the issue over to them.

@ericsnowcurrently ericsnowcurrently transferred this issue from microsoft/vscode-python Jul 11, 2019
@ericsnowcurrently ericsnowcurrently removed their assignment Jul 11, 2019
@jakebailey
Copy link
Member

How did {workspaceFolder} make it to us without having a replacement done by the extension or VS Code? {workspaceFolder}/~/ itself is very strange. @ebubekirtrkr Have you modified extraPaths?

@ebubekirtrkr
Copy link
Author

@jakebailey I have placed it in there, because I don't wanna share my directory path.

@jakebailey
Copy link
Member

Oh, I see. That's nearly the same syntax as what's in the config.

Note that I don't think putting ~ in the config is going to work; ~ is typically expanded by a shell, but not in other cases. If you could share what your extraPaths is (even if it's partially redacted), then I'd be happy to give you an alternate method to try.

@jakebailey
Copy link
Member

Actually, in context, /~/ doesn't quite make sense either.

@ebubekirtrkr
Copy link
Author

@jakebailey I edit it as what it was at beginning.

@jakebailey
Copy link
Member

We had some recent fixes around paths and Python 2.7. I'd appreciate it if you could try out our daily build by setting the following and reloading:

"python.analysis.downloadChannel": "daily"

@ebubekirtrkr
Copy link
Author

@jakebailey When I copy and paste it in settings , a notification occurs in problems section which is Unknown configuration setting. Also, in VSCode settings there is no python.analysis.downloadChannel option.
What I need to do?

@jakebailey
Copy link
Member

You can safely ignore the message. It's undocumented, and we give it out to help people test things.

@ebubekirtrkr
Copy link
Author

@jakebailey I have added what you say in settings and I reloaded VSCode. But It seems unsolved.

Pyhton Output Console

Starting Microsoft Python language server.
Downloading https://pvsc.azureedge.net/python-language-server-daily/Python-Language-Server-linux-x64.0.3.29.nupkg... complete
Unpacking archive... done
[Info  - 1:57:05 AM] Analysis cache path: /home/ebubekirtrkr/.cache/Microsoft/Python Language Server
[Info  - 1:57:05 AM] GetCurrentSearchPaths /usr/bin/python 
[Info  - 1:57:05 AM] Interpreter search paths:
[Info  - 1:57:05 AM]     /usr/lib/python2.7
[Info  - 1:57:05 AM]     /usr/lib/python2.7/plat-x86_64-linux-gnu
[Info  - 1:57:05 AM]     /usr/lib/python2.7/lib-tk
[Info  - 1:57:05 AM]     /usr/lib/python2.7/lib-dynload
[Info  - 1:57:05 AM]     /home/ebubekirtrkr/.local/lib/python2.7/site-packages
[Info  - 1:57:05 AM]     /usr/local/lib/python2.7/dist-packages
[Info  - 1:57:05 AM]     /usr/lib/python2.7/dist-packages
[Info  - 1:57:05 AM]     /usr/lib/python2.7/dist-packages/gtk-2.0
[Info  - 1:57:05 AM] User search paths:
[Info  - 1:57:05 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2
[Info  - 1:57:05 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine
[Info  - 1:57:05 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/lib
[Info  - 1:57:05 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine/lib/endpoints-1.0
[Info  - 1:57:05 AM]     /home/ebubekirtrkr/Desktop/Codes/SeleniumScripts/~/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0
[Error - 1:57:05 AM] Server initialization failed.
  Message: Specified argument was out of the range of valid values.
  Code: -32000 
   at System.ReadOnlySpan`1..ctor(Void* pointer, Int32 length)
   at Interop.Sys.DirectoryEntry.GetName(Span`1 buffer)
   at System.IO.Enumeration.FileSystemEntry.get_FileName()
   at System.IO.Enumeration.FileSystemEnumerableFactory.<>c__DisplayClass3_0.<UserFiles>b__1(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerable`1.DelegateEnumerator.ShouldIncludeEntry(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.Python.Core.IO.PathUtils.EnumerateFiles(String root, String pattern, Boolean recurse, Boolean fullPaths)+MoveNext() in E:\A\_work\2\s\src\Core\Impl\IO\PathUtils.cs:line 296
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at Microsoft.Python.Analysis.Modules.Resolution.ModuleResolutionBase.ReloadModulePaths(IEnumerable`1& rootPaths) in E:\A\_work\2\s\src\Analysis\Ast\Impl\Modules\Resolution\ModuleResolutionBase.cs:line 120
   at Microsoft.Python.Analysis.Modules.Resolution.MainModuleResolution.ReloadAsync(CancellationToken cancellationToken) in E:\A\_work\2\s\src\Analysis\Ast\Impl\Modules\Resolution\MainModuleResolution.cs:line 210
   at Microsoft.Python.Analysis.Modules.Resolution.MainModuleResolution.InitializeAsync(CancellationToken cancellationToken) in E:\A\_work\2\s\src\Analysis\Ast\Impl\Modules\Resolution\MainModuleResolution.cs:line 61
   at Microsoft.Python.Analysis.Analyzer.PythonInterpreter.LoadBuiltinTypesAsync(String root, IServiceManager sm, CancellationToken cancellationToken) in E:\A\_work\2\s\src\Analysis\Ast\Impl\Analyzer\PythonInterpreter.cs:line 59
   at Microsoft.Python.Analysis.Analyzer.PythonInterpreter.CreateAsync(InterpreterConfiguration configuration, String root, IServiceManager sm, CancellationToken cancellationToken) in E:\A\_work\2\s\src\Analysis\Ast\Impl\Analyzer\PythonInterpreter.cs:line 67
   at Microsoft.Python.LanguageServer.Implementation.Server.InitializeAsync(InitializeParams params, CancellationToken cancellationToken) in E:\A\_work\2\s\src\LanguageServer\Impl\Implementation\Server.cs:line 135
   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Initialize(JToken token, CancellationToken cancellationToken) in E:\A\_work\2\s\src\LanguageServer\Impl\LanguageServer.Lifetime.cs:line 36

@jakebailey
Copy link
Member

Those google-cloud-sdk paths, did you set up some configuration in order to add them? As in extraPaths or PYTHONPATH?

@ebubekirtrkr
Copy link
Author

Yes in settings.json there is an option.

"python.autoComplete.extraPaths": [
    "~/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2",
    "~/google-cloud-sdk/platform/google_appengine",
    "~/google-cloud-sdk/lib",
    "~/google-cloud-sdk/platform/google_appengine/lib/endpoints-1.0",
    "~/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0"
],

@jakebailey
Copy link
Member

That's probably where things are going wrong. Nothing between those settings and our use of it expands the ~ into your real $HOME. (See also #557.)

What you can try is making those paths absolute. Based on your previous logs, I'd say something like:

"python.autoComplete.extraPaths": [
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2",
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine",
    "/home/ebubekirtrkr/google-cloud-sdk/lib",
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine/lib/endpoints-1.0",
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0"
],

Note that we have other issues when it comes to the ordering of these paths; some of those may not end up working due to the way we carve out parts of folders as import roots. You may need to reorder the above deepest-first, like:

"python.autoComplete.extraPaths": [
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine/lib/endpoints-1.0",
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0"
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2",
    "/home/ebubekirtrkr/google-cloud-sdk/platform/google_appengine",
    "/home/ebubekirtrkr/google-cloud-sdk/lib",
],

@MikhailArkhipov
Copy link

The exception seems to happen deep in .NET framework. See https://github.com/dotnet/corefx/issues/34359. It is fixed in 3.0 while we are on 2.2.

@MikhailArkhipov MikhailArkhipov added the bug Something isn't working label Aug 24, 2019
@MikhailArkhipov
Copy link

MikhailArkhipov commented Dec 16, 2019

We have upgraded LS to .NET Core 3.0 a while ago in #1521

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working upstream-dotnet
Projects
None yet
Development

No branches or pull requests

4 participants