ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.41k stars 2.8k forks source link

Installing jdt.ls for Java support...FAILED (Similar to #3972 & #3974) #4136

Closed blue-santa closed 1 year ago

blue-santa commented 1 year ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

(Can't install)

(Can't install)

(Can't install)

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key questions:

Tried to install YouCompleteMe using the new method now that Vundle is gone.

Include steps to reproduce here.

At the terminal, entered:

python3 /home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py --all --verbose

Include description of a minimal test case, including any actual code required to reproduce the issue.

Upon entering the above command, received the following output:

...
[100%] Linking CXX shared library /home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/ycm_core.cpython-310-x86_64-linux-gnu.so
[100%] Built target ycm_core
Installing Omnisharp v1.37.11
Using cached Omnisharp: omnisharp.http-linux-x64.tar.gz
Extracting Omnisharp to /home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/third_party/omnisharp-roslyn...DONE
Done installing Omnisharp

up to date, audited 29 packages in 2s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Cached tar file does not match checksum. Removing...
Downloading jdt.ls from http://download.eclipse.org/jdtls/snapshots/jdt-language-server-1.14.0-202207211651.tar.gz...
Traceback (most recent call last):
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 1335, in <module>
    Main()
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 1316, in Main
    EnableJavaCompleter( args )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 1105, in EnableJavaCompleter
    DownloadFileTo( url, file_name )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 209, in DownloadFileTo
    package_file.write( response.read() )
  File "/usr/lib/python3.10/http/client.py", line 481, in read
    s = self._safe_read(self.length)
  File "/usr/lib/python3.10/http/client.py", line 632, in _safe_read
    raise IncompleteRead(data, amt-len(data))
http.client.IncompleteRead: IncompleteRead(40877572 bytes read, 458361 more expected)

If you made changes to vimrc_ycm_minimal, pase them here:

<contents of ycm_vimrc_minimal>

Installation should work?

Include description of the expected behaviour.

Can't seem to download the java file properly. There's something in #3973, #3972, and #3974 that shows that this has been a problem in the past. The solution seemed to be to go directly into the files and change the url, but I couldn't be sure I was finding the correct url to change, and the thing looked a little risky so I am asking for help instead.

Include description of the observed behaviour, including actual output, screenshots, etc.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 11 2023 23:53:12)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          -ruby              +wildignore
+cursorbind        -lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        +mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-XHiCvL/vim-8.2.3995=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt -ldl -lm -lm 

Output of YcmDebugInfo

Paste output here

Output of YcmDiags

Paste output here

Output of git rev-parse HEAD in YouCompleteMe installation directory

0de94d11f9286ecd176aa8a7299aabb8646d16c9

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which enabled debug logging and other useful diagnostics. Include a link to a gist containing all of the log files listed by :YcmToggleLogs.

  1 " windows default encoding is not supported
  2 set encoding=utf-8
  3 
  4 " If you using neovim and python isn't loading, copy your python setup from your
  5 " vimrc here:
  6 "
  7 " let g:python3_host_prog = '/path/to/python3/with/neovim/module'
  8 "
  9 " But remember that neovim is not officially supported, so please reproduce in
 10 " Vim.
 11 
 12 " Enable debugging
 13 let g:ycm_keep_logfiles = 1
 14 let g:ycm_log_level = 'debug'
 15 
 16 " If the base settings don't repro, paste your existing config for YCM only,
 17 " here:
 18 " let g:ycm_....
 19 
 20 " Load YCM (only)
 21 let &rtp .= ',' . expand( '<sfile>:p:h' )
 22 filetype plugin indent on
 23 syn on

OS version, distribution, etc.

Thinkpad T490, 16GB Ram, Ubuntu 22.04 (Pop!_OS distro)

Output of build/install commands

Include link to a gist containing the invocation and entire output of install.py if reporting an installation issue.

bluesanta@pop-os:~/.vim/pack/YouCompleteMe/opt/YouCompleteme$ ./install.py --all
Generating ycmd build configuration...OK
Compiling ycmd target: ycm_core...OK
Installing Omnisharp for C# support...OK
Building gopls for go completion...OK
Setting up Tern for JavaScript completion...OK
Installing rust-analyzer for Rust support...OK
Installing jdt.ls for Java support...FAILED with exception IncompleteRead: IncompleteRead(40943108 bytes read, 392825 more expected)

The installation failed; please see above for the actual error. In order to get more information, please re-run the command, adding the --verbose flag. If you think this is a bug and you raise an issue, you MUST include the *full verbose* output.

For example, run:/usr/bin/python3 /home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py --all --verbose
puremourning commented 1 year ago

Are you able to download this file ?

http://download.eclipse.org/jdtls/snapshots/jdt-language-server-1.14.0-202207211651.tar.gz

If so, put it in /home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/third_party/eclipse.jdt.ls/target/cache/

And re-run the script. If that doesn't work, paste the full verbose output.

blue-santa commented 1 year ago

That seems to have pushed the installation process forward, although I'm not sure that everything is resolved.

Here is a gist with the output of the --verbose install script.

https://gist.github.com/blue-santa/32bc9c9ebf3fea202e5da35f619dedb1

As you can see at the bottom, there's a warning that there is an IncompleteRead error.

But the jdt file did install successfully.

blue-santa commented 1 year ago

I ran

vim -Nu ./vimrc_ycm_minimal

and then

:YcmDebugInfo

Output here:

Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_dmuwya01.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.10.6
-- Server has Clang support compiled in: True
-- Clang version: clang version 15.0.1 (https://github.com/ycm-core/llvm 708056a3d8259ce1d9fc0f15676d13b53cc23835)
-- Extra configuration file found but not loaded
-- Extra configuration path: /home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/.ycm_extra_conf.py
-- Server running at: http://127.0.0.1:46155
-- Server process ID: 196291
-- Server logfiles:
--   /tmp/ycmd_46155_stdout_vnbqcqyq.log
--   /tmp/ycmd_46155_stderr_f4nwlbru.log
-- Semantic highlighting supported: True
-- Virtual text supported: False
-- Popup windows supported: True
blue-santa commented 1 year ago

Here is the output of YcmToggleLogs

Which logfile do you wish to open (or close if already open)?
1: ycm_dmuwya01.log
2: ycmd_46155_stderr_f4nwlbru.log
3: ycmd_46155_stdout_vnbqcqyq.log

1:

b'{"filepath": "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/1", "line_num": 1, "column_num": 1, "working_dir": "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme", "file_data": {"/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/1": {"contents": "\\n", "filetypes": ["ycm_nofiletype"]}}}'
2023-03-01 15:02:16,791 - DEBUG - POST b'http://127.0.0.1:46155/debug_info'
{'content-type': 'application/json', 'x-ycm-hmac': b'q1qK6Kku4qvLWOYd3EcnOUi5leRCz3ozdTgWvJ+tMQA='}
b'{"filepath": "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/1", "line_num": 1, "column_num": 1, "working_dir": "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme", "file_data": {"/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/1": {"contents": "\\n", "filetypes": ["ycm_nofiletype"]}}}'

2:

    return _server_state.GetFiletypeCompleter( request_data[ 'filetypes' ] )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/ycmd/server_state.py", line 96, in GetFiletypeCompleter
    raise ValueError(
ValueError: No semantic completer exists for filetypes: ['ycm_nofiletype']
127.0.0.1 - - [01/Mar/2023 15:03:19] "POST /debug_info HTTP/1.1" 200 337

3:

serving on http://localhost:43807
puremourning commented 1 year ago

Please provide YcmDebugInfo and the ".log" if there is one from YcmToggleLogs, when you have a JAVA file open.

I can see that the installation of jdt.ls was successful, and that it subsequently failed to download clangd. You seem to have a problem with your internet connection.

blue-santa commented 1 year ago

I tried opening a basic HelloWorld.java file, and Ycm didn't seem to be up and running.

When I typed :YcmDebugInfo, this returned a E492: Not an editor command: YcmDebugInfo error.

In fact, I tested just now and ycm also does not seem to be operational with c++.

Test ./install.py --all --verbose on a new internet connection.

The process hung here:

bluesanta@zuko:~/.vim/pack/YouCompleteMe/opt/YouCompleteme$ ./install.py --all --verbose
Searching Python 3.10 libraries...
Found Python library: /usr/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.so
Found Python headers folder: /usr/include/python3.10
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /usr/bin/python3 (found suitable version "3.10.6", minimum required is "3.6") found components: Interpreter Development Development.Module Development.Embed 

Waited a few minutes and no further progress.

blue-santa commented 1 year ago

When I hit ^C, this was the output:

^CTraceback (most recent call last):
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 1335, in <module>
    Main()
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 1306, in Main
    DoCmakeBuilds( args )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 1271, in DoCmakeBuilds
    BuildYcmdLib( cmake, cmake_common_args, args )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 722, in BuildYcmdLib
    CheckCall( configure_command,
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 298, in CheckCall
    _CheckCall( args, **kwargs )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/third_party/ycmd/build.py", line 318, in _CheckCall
    subprocess.check_call( args, **kwargs )
  File "/usr/lib/python3.10/subprocess.py", line 364, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 347, in call
    return p.wait(timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1207, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1941, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.10/subprocess.py", line 1899, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
Traceback (most recent call last):
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/./install.py", line 50, in <module>
    Main()
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/./install.py", line 38, in Main
    CheckCall( [ sys.executable, build_file ] + sys.argv[ 1: ] )
  File "/home/bluesanta/.vim/pack/YouCompleteMe/opt/YouCompleteme/./install.py", line 25, in CheckCall
    subprocess.check_call( args, **kwargs )
  File "/usr/lib/python3.10/subprocess.py", line 364, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 347, in call
    return p.wait(timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1207, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1941, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.10/subprocess.py", line 1899, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
blue-santa commented 1 year ago

Now that Vundle is back, I tried to come back to this and get YCM to compile and activate using vim.

I deleted youcompleteme from my plugged directory and then tried to install using the

Here is a copy of the verbose output of my attempt to install.

Link to gist of error output from console when running python3 ./install.py --clangd-completer --verbose.

Ran vim -Nu ./vimrc_ycm_minimal and then YcmDebugInfo:

Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_rgrw5391.log
-- Server Python interpreter: /home/bluesanta/anaconda3/bin/python3
-- Server Python version: 3.9.13
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found but not loaded
-- Extra configuration path: /home/bluesanta/.vim/bundle/youcompleteme/.ycm_extra_conf.py
-- Server running at: http://127.0.0.1:41721
-- Server process ID: 47779
-- Server logfiles:
--   /tmp/ycmd_41721_stdout_rr_3pvvo.log
--   /tmp/ycmd_41721_stderr_qtxjzq6s.log
-- Semantic highlighting supported: True
-- Virtual text supported: False
-- Popup windows supported: True

Then YcmToggleLogs:

Which logfile do you wish to open (or close if already open)?
1: ycm_c767n6yc.log
2: ycmd_56625_stderr_qzg1xnbw.log
3: ycmd_56625_stdout_w3rxjxid.log
Type number and <Enter> or click with the mouse (q or empty cancels):  

1:

2023-03-20 00:25:36,527 - DEBUG - GET b'http://127.0.0.1:56625/ready' (None)
{'content-type': 'application/json', 'x-ycm-hmac': b'rWgCqc2iIlBqqE4bYNysPbSmMKymtEgCbbr2C1t6ZjQ='}
2023-03-20 00:25:43,425 - DEBUG - POST b'http://127.0.0.1:56625/debug_info'
{'content-type': 'application/json', 'x-ycm-hmac': b'naG8U6HNd4TogzzCtBTUvtCbEhMOPT5tZB1ybKDmrLw='}
b'{"filepath": "/home/bluesanta/.vim/bundle/youcompleteme/1", "line_num": 1, "column_num": 1, "working_dir": "/home/bluesanta/.vim/bundle/youcompleteme", "file_data": {"/home/bluesanta/.vim/bundle/youcompleteme/1": {"contents": "\\n", "filetypes": ["ycm_nofiletype"]}}}'

2:

  File "/home/bluesanta/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/handlers.py", line 402, in _GetCompleterForRequestData
    return _server_state.GetFiletypeCompleter( request_data[ 'filetypes' ] )
  File "/home/bluesanta/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/server_state.py", line 96, in GetFiletypeCompleter
    raise ValueError(
ValueError: No semantic completer exists for filetypes: ['ycm_nofiletype']
127.0.0.1 - - [20/Mar/2023 00:26:38] "POST /debug_info HTTP/1.1" 200 191

3:

serving on http://localhost:56625
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
~                                                                                                                             
/tmp/ycmd_56625_stdout_w3rxjxid.log                                                                                           
127.0.0.1 - - [20/Mar/2023 00:26:38] "POST /debug_info HTTP/1.1" 200 191
2023-03-20 00:26:56,214 - ERROR - Error retrieving completer debug info
Traceback (most recent call last):
  File "/home/bluesanta/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/handlers.py", line 337, in DebugInfo
    response[ 'completer' ] = _GetCompleterForRequestData(
  File "/home/bluesanta/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/handlers.py", line 402, in _GetCompleterForRequestData    return _server_state.GetFiletypeCompleter( request_data[ 'filetypes' ] )
  File "/home/bluesanta/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/server_state.py", line 96, in GetFiletypeCompleter
    raise ValueError(
ValueError: No semantic completer exists for filetypes: ['ycm_nofiletype']
127.0.0.1 - - [20/Mar/2023 00:26:56] "POST /debug_info HTTP/1.1" 200 191

It doesn't matter which language I try to install support for. Earlier we were having issues with Java, but it's the same issue whether I do --all during the installation process, or --clang-completer only.

I've tried uninstalling and reinstalling, and have tried on multiple internet connections.

puremourning commented 1 year ago

The problem is clearly with your internet connection or firewall causing downloads to fail.

Thanks for providing logs, but you need to do it when you have a file open where you expect YCM to work (e.g. java or c++). But if your connection is failing to download the subservers there's really not much I can suggest other than trying to download them manually.

This does not appear to be a bug, but rather a problem with your environment, so closing. If you require further assistance, check CONTRIBUTING.md and README.md for support channels.