Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascript completion issue using tsserver: "RuntimeError: TSServer is not running." #3426

Closed
11 of 12 tasks
peterdutton opened this issue Jun 25, 2019 · 10 comments
Closed
11 of 12 tasks

Comments

@peterdutton
Copy link

peterdutton commented Jun 25, 2019

Issue Prelude

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

  • I have read and understood YCM's CONTRIBUTING document.
  • I have read and understood YCM's CODE_OF_CONDUCT document.
  • I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

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:

  • What did you do?

Opened a javascript file in vim.

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

  • What did you expect to happen?

Completion functionality in the JS file would be available. I am setting up javascript completion for the first time but have completion running successfully in other languages. I have run the install script using the '--ts-completer' flag and have node/npm installed. Please note that I used nvm to install node; if this is not supported please let me know.

  • What actually happened?

Completion was not available and the message "RuntimeError: TSServer is not running." was shown.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)
Included patches: 1-1453
Modified by [email protected]
Compiled by [email protected]
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    +tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          +toolbar
+cindent           +insert_expand     +path_extra        +user_commands
+clientserver      +job               +perl              +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           -python            +vreplace
+conceal           +linebreak         +python3           +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       +lua               +ruby              +X11
+dialog_con_gui    +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             +xim
+digraphs          +modify_fname      +smartindent       +xpm
+dnd               +mouse             +startuptime       +xsmp_interact
-ebcdic            +mouseshape        +statusline        +xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              +mouse_gpm         +syntax
+ex_extra          -mouse_jsbterm     +tag_binary
+extra_search      +mouse_netterm     +tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-8l5tlu/vim-8.0.1453=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-2.5 -lpthread -lgmp -ldl -lcrypt -lm


Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Client logfile: /tmp/ycm_kchdfgcu.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.6.8
-- Server has Clang support compiled in: False
-- Clang version: None
-- No extra configuration file found
-- TypeScript completer debug information:
--   TSServer not running
--   TSServer executable: /home/pdutton/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/tsserver/bin/tsserver
--   TSServer logfiles:
--     /tmp/tsserver_do2f30bo.log
--   TSServer version: None
-- Server running at: http://127.0.0.1:35015
-- Server process ID: 29361
-- Server logfiles:
--   /tmp/ycmd_35015_stdout_vovdf5bu.log
--   /tmp/ycmd_35015_stderr_92nj0x27.log

Contents of YCM, ycmd and completion engine logfiles

https://gist.github.com/peterdutton/91810a644818b24023b1c4e3dcd413fa

OS version, distribution, etc.

Ubuntu 18.04.2 LTS

Output of build/install commands

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

@puremourning
Copy link
Member

Can you get the tsserver log file too? It looks like it’s not starting.

@peterdutton
Copy link
Author

Can you get the tsserver log file too? It looks like it’s not starting.

Thanks for looking - I did include it in the gist, although it is completely empty.
(this is the file named '/tmp/tsserver_do2f30bo.log' in the gist - if you were referring to a different one please let me know.)

@bstaletic
Copy link
Collaborator

From the ycmd stderr log:

RuntimeError: Missing 'Content-Length' header

@peterdutton Can you try executing /path/to/YouCompleteMe/third_party/ycmd/third_party/tsserver/bin/tsserver

It should start the TSServer and the first message should be something like:

Content-Length: 76

{"seq":0,"type":"event","event":"typingsInstallerPid","body":{"pid":10267}}

After which, you can try feeding it some garbage like awsedrf followed by enter and TSServer should respond with something like this:

Content-Length: 978

{"seq":0,"type":"response","command":"unknown","request_seq":0,"success":false,"message":"Error processing request. Unexpected token a in JSON at position 0\nSyntaxError: Unexpected token a in JSON at position 0\n    at JSON.parse (<anonymous>)\n    at IOSession.Session.onMessage (/home/bstaletic/Temp/ycmd/third_party/tsserver/lib/node_modules/typescript/lib/tsserver.js:131657:36)\n    at Interface.<anonymous> (/home/bstaletic/Temp/ycmd/third_party/tsserver/lib/node_modules/typescript/lib/tsserver.js:132950:27)\n    at Interface.emit (events.js:193:13)\n    at Interface._onLine (readline.js:307:10)\n    at Interface._normalWrite (readline.js:448:12)\n    at ReadStream.ondata (readline.js:164:10)\n    at ReadStream.emit (events.js:193:13)\n    at addChunk (_stream_readable.js:295:12)\n    at readableAddChunk (_stream_readable.js:276:11)\n    at ReadStream.Readable.push (_stream_readable.js:231:10)\n    at TTY.onStreamRead (internal/stream_base_commons.js:154:17)"}

The important part is that each response from TSServer needs to start with "Content-Length: <some number>"

Also, it looks like you didn't have let g:ycm_log_level='debug' in your vimrc, so the logs don't contain debug messages.

@peterdutton
Copy link
Author

Thanks - I tried executing the command and it returns the "Content-Length: ..." at the beginning of the response.

Apologies, I mustn't have set the debug flag properly. I've done that now and updated the files in the gist.

@obetame
Copy link

obetame commented Sep 19, 2019

I have same output error message too

Is you vim working properly? @peterdutton

@peterdutton
Copy link
Author

I have same output error message too

Is you vim working properly? @peterdutton

No, I wasn't able to get it working unfortunately, so I'm looking at using a different completion plugin now.

@bstaletic
Copy link
Collaborator

Two things come to my mind:

@puremourning
Copy link
Member

no follow-up, no new data. likely an environment issue. If there is any new information, please raise a new issue.

@azizj1
Copy link

azizj1 commented Mar 20, 2021

Still having this issue. Any workarounds?

@puremourning
Copy link
Member

If you are having a problem please raise a new issue, completing the issue template.

@ycm-core ycm-core locked and limited conversation to collaborators Mar 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants