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

YouCompleteMe failes to install or update #75

Closed
Ghoughpteighbteau opened this issue Sep 13, 2014 · 11 comments
Closed

YouCompleteMe failes to install or update #75

Ghoughpteighbteau opened this issue Sep 13, 2014 · 11 comments
Labels

Comments

@Ghoughpteighbteau
Copy link

Update is erroring with

x YouCompleteMe
    From https://github.com/Valloric/YouCompleteMe
     * branch            master     -> FETCH_HEAD
    Already up-to-date.
    fatal: Not a git repository: ../../../../../.git/modules/third_party/ycmd/modules/third_party/OmniSharpServer/modules/NRefactory
    Failed to recurse into submodule path 'third_party/ycmd/third_party/OmniSharpServer'
    Failed to recurse into submodule path 'third_party/ycmd'

The following is my .vimrc file:

" vim: foldmethod=marker

"{{{1 Initial config
set shell=/bin/bash "Vim must operate in a POSIX compliant shell, if you're not in one, hooo boy
set nocompatible  "Might as well actually use Vim instead of Vi

"{{{1 Vundle Settings
filetype off      "Vundle needs this off, we turn it on later

call plug#begin('~/.vim/plugged')

"set rtp+=~/.vim/bundle/Vundle.vim/
"call vundle#rc()

"So vundle will update itself
Plug 'gmarik/Vundle.vim'

"{{{2 Scroll Colors - For selecting themes
" use the COLORSCROLL command to activate it test colorthemes
Plug 'ScrollColors'

"{{{3 xoria256 colorscheme - Super awesome
Plug 'vim-scripts/xoria256.vim'

"{{{3 mustang-vim - Also Super awesome
Plug 'croaker/mustang-vim'

"{{{2 Indent Guides - Provides alternating bars for indentation
" This plugin provides 3 commands, all prefixed with IndentGuides
Plug 'Indent-Guides'
    let g:indent_guides_enable_on_vim_startup = 1
    let g:indent_guides_color_change_percent = 5

"{{{2 editorConfig - Reads .editorconfig files and obeys
Plug 'editorconfig/editorconfig-vim'

"{{{2 Tabularize - Run :Tab /pattern to format tabular data
Plug 'godlygeek/tabular'

"{{{2 NERD Commenter - An insanely over the top commenting plugin.
Plug 'scrooloose/nerdcommenter'

"{{{2 Airline - the sexy little bar at the bottom
Plug 'bling/vim-airline'
    "Set this to one if you have a Powerline patched font (google it)
    let g:airline_powerline_fonts = 1
    set laststatus=2
    set noshowmode

"{{{2 Fugitive - For sexy git integration
Plug 'fugitive.vim'

"{{{2 git-gutter - Shows changes in active repository
Plug 'airblade/vim-gitgutter'
    let g:gitgutter_diff_args = '-w' "ignore whitespace
    let g:gitgutter_sign_added = '++'
    let g:gitgutter_sign_modified = '~~'
    let g:gitgutter_sign_removed = 'xx'
    let g:gitgutter_sign_removed_first_line = '->'
    let g:gitgutter_sign_modified_removed = '~x'
    highlight link GitGutterAdd          DiffAdd
    highlight link GitGutterChange       DiffChange
    highlight link GitGutterDelete       DiffDelete
    highlight link GitGutterChangeDelete DiffChange

"{{{2 Sensible - This seems sensible, (a smattering of sensible defaults)
Plug 'tpope/vim-sensible'

"{{{2 Unimpared - A list of symetric hotkeys
" Primarily used to bubble lines, but lots of cool features
" check out :h unimpaired
Plug 'tpope/vim-unimpaired'

    "{{{3 Bubbling commands - Ctrl + up or down to bubble selections
    nmap <C-up> [e
    nmap <C-down> ]e
    vmap <C-up> [egv
    vmap <C-down> ]egv

"{{{2 match it - Makes it so % jumps XML tags correctly (and more)
Plug 'matchit.zip'

"{{{2 ZenCoding - for fast HTML completions
Plug "mattn/emmet-vim"

"{{{2 css-color - Changes background of hex squares to represent color
Plug 'skammer/vim-css-color'

"{{{2 YouCompleteMe - Advanced code completion for C languages
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
    "let g:ycm_autoclose_previw_window_after_insertion = 1
    "Special instructions: When YCM updates, it often needs a recompile
    "By default, that is done by running ~/.vim/bundle/YouCompleteMe/install.sh

"{{{2 vim-go - An entire development environment package for golang in vim
Plug 'fatih/vim-go'
    au FileType go nmap <Leader>gb <Plug>(go-doc-browser)

"{{{2 tagbar - Displays all of the tags generated by ctags/gotags. press F8
Plug 'majutsushi/tagbar'
    nmap <F8> :TagbarToggle<CR>

"{{{2 Easymotion - Allows you to add \ before a move command to do a fastmove!
Plug 'Lokaltog/vim-easymotion'
    "Single leader prefix
    map <Leader> <Plug>(easymotion-prefix)
    "easymotion search
    map  / <Plug>(easymotion-sn)
    omap / <Plug>(easymotion-tn)
    map  n <Plug>(easymotion-next)
    map  N <Plug>(easymotion-prev)
    "bothdirection search
    map  s <Plug>(easymotion-s)

"{{{2 CtrlP - Like Command T, a file explorer, use CTRL-T
Plug 'kien/ctrlp.vim'
    let g:ctrlp_map = '<c-t>'

"{{{2 Syntax bundles - All the bundles that provide syntax stuff
Plug 'Soares/fish.vim'
Plug 'octave.vim'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-lua-ftplugin'
Plug 'tfnico/vim-gradle'
Plug 'wting/rust.vim'
Plug 'cakebaker/scss-syntax.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'tpope/vim-markdown'
Plug 'nelstrom/vim-markdown-folding'
Plug 'ipoddubny/asterisk-vim'
Plug "Matt-Deacalion/vim-systemd-syntax"

call plug#end()

"{{{1 My Settings
set number      "Numberlines
set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 10
set history=700
set tabstop=4
set shiftwidth=4
set scrolloff=7
set foldmethod=syntax
let javaScript_fold=1         " JavaScript
let perl_fold=1               " Perl
let php_folding=1             " PHP
let r_syntax_folding=1        " R
let ruby_fold=1               " Ruby
let sh_fold_enabled=1         " sh
let vimsyn_folding='af'       " Vim script
let xml_syntax_folding=1      " XML

"{{{2 When searching, center the screen on the found item
"map N Nzz
"map n nzz

"{{{2 Sudo escalation commands - :W will sudo write. :Wq doesn't work :(
command! W w !sudo tee % >/dev/null

"{{{1 Some gui/nongui independent settings
"colorscheme xoria256
if has("gui_running")
    "colorscheme xoria256
    colorscheme mustang
    set go+=c
    set go-=e
    set go-=m
    set go-=T
else
    set t_Co=256
    colorscheme desert
    set ttimeoutlen=10
    augroup FastEscape
        autocmd!
        au InsertEnter * set timeoutlen=0
        au InsertLeave * set timeoutlen=1000
    augroup END
endif

"These colors are must set.
highlight DiffAdd ctermfg=234 ctermbg=151 guifg=bg guibg=#afdfaf
highlight DiffChange ctermfg=234 ctermbg=223 guifg=bg guibg=LightYellow
highlight DiffDelete ctermfg=234 ctermbg=174 guifg=bg guibg=#df8787 gui=NONE
highlight DiffText ctermfg=234 ctermbg=246 guifg=bg guibg=#949494 gui=NONE
highlight SignColumn term=standout ctermfg=248 ctermbg=8 guifg=#a8a8a8 guibg=#444444

filetype plugin indent on
@Ghoughpteighbteau
Copy link
Author

Some additional info, from what I can tell, vim-plug is installing YouCompleteMe incorrectly,

alex@alex-work ~/.v/p/YouCompleteMe (master)> git submodule update --init --recursive
fatal: Not a git repository: ../../../../../.git/modules/third_party/ycmd/modules/third_party/OmniSharpServer/modules/NRefactory
Unable to find current revision in submodule path 'third_party/ycmd/third_party/OmniSharpServer/NRefactory'
Failed to recurse into submodule path 'third_party/ycmd/third_party/OmniSharpServer'
Failed to recurse into submodule path 'third_party/ycmd'
alex@alex-work ~/.v/p/YouCompleteMe (master) [1]> git status
fatal: Not a git repository: NRefactory/../../../../../.git/modules/third_party/ycmd/modules/third_party/OmniSharpServer/modules/NRefactory
fatal: 'git status --porcelain' failed in submodule third_party/OmniSharpServer
fatal: 'git status --porcelain' failed in submodule third_party/ycmd

After deleting the folder and reinstalling manually.

alex@alex-work ~/.v/plugged> git clone https://github.com/Valloric/YouCompleteMe.git YouCompleteMe2
Cloning into 'YouCompleteMe2'...
remote: Counting objects: 29603, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 29603 (delta 4), reused 2 (delta 0)
Receiving objects: 100% (29603/29603), 28.79 MiB | 299.00 KiB/s, done.
Resolving deltas: 100% (9450/9450), done.
Checking connectivity... done
alex@alex-work ~/.v/plugged> git status
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
alex@alex-work ~/.v/plugged [128]> cd YouCompleteMe2/
alex@alex-work ~/.v/p/YouCompleteMe2 (master)> git status
# On branch master
nothing to commit, working directory clean
alex@alex-work ~/.v/p/YouCompleteMe2 (master)> git submodule update --init --recursive
Submodule 'third_party/requests' (https://github.com/kennethreitz/requests) registered for path 'third_party/requests'
Submodule 'third_party/requests-futures' (https://github.com/ross/requests-futures) registered for path 'third_party/requests-futures'
Submodule 'third_party/ycmd' (https://github.com/Valloric/ycmd) registered for path 'third_party/ycmd'
Cloning into 'third_party/requests'...
remote: Counting objects: 14216, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14216 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (14216/14216), 5.92 MiB | 358.00 KiB/s, done.
Resolving deltas: 100% (7873/7873), done.
Checking connectivity... done
Submodule path 'third_party/requests': checked out '33735480f77891754304e7f13e3cdf83aaaa76aa'
Cloning into 'third_party/requests-futures'...
remote: Counting objects: 90, done.
remote: Total 90 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (90/90), done.
Checking connectivity... done
Submodule path 'third_party/requests-futures': checked out '98712e7d0f6be2a090b6fda2a925f85e63656b58'
Cloning into 'third_party/ycmd'...
remote: Counting objects: 6512, done.
remote: Total 6512 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6512/6512), 5.04 MiB | 201.00 KiB/s, done.
Resolving deltas: 100% (3218/3218), done.
Checking connectivity... done
Submodule path 'third_party/ycmd': checked out 'a75fbd9cfaa1c6cdcacf4b4c2e92f4c2ba01b497'
Submodule 'third_party/OmniSharpServer' (https://github.com/nosami/OmniSharpServer) registered for path 'third_party/OmniSharpServer'
Submodule 'third_party/argparse' (https://github.com/bewest/argparse) registered for path 'third_party/argparse'
Submodule 'third_party/bottle' (https://github.com/defnull/bottle) registered for path 'third_party/bottle'
Submodule 'third_party/frozendict' (https://github.com/slezica/python-frozendict) registered for path 'third_party/frozendict'
Submodule 'third_party/jedi' (https://github.com/davidhalter/jedi) registered for path 'third_party/jedi'
Submodule 'third_party/waitress' (https://github.com/Pylons/waitress) registered for path 'third_party/waitress'
Cloning into 'third_party/OmniSharpServer'...
remote: Counting objects: 5037, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5037 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5037/5037), 9.92 MiB | 602.00 KiB/s, done.
Resolving deltas: 100% (2812/2812), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/OmniSharpServer': checked out 'e52b010a7fb4557897119a634b60ddb5ae1bd211'
Submodule 'NRefactory' (https://github.com/icsharpcode/NRefactory.git) registered for path 'NRefactory'
Submodule 'cecil' (https://github.com/jbevain/cecil.git) registered for path 'cecil'
Cloning into 'NRefactory'...
remote: Counting objects: 54358, done.
remote: Total 54358 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (54358/54358), 22.26 MiB | 263.00 KiB/s, done.
Resolving deltas: 100% (44474/44474), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/OmniSharpServer/NRefactory': checked out '48bdfd73676ac5923431cf2c07b602f8e0cb2eff'
Cloning into 'cecil'...
remote: Counting objects: 3713, done.
remote: Total 3713 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3713/3713), 1.67 MiB | 439.00 KiB/s, done.
Resolving deltas: 100% (2287/2287), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/OmniSharpServer/cecil': checked out '4770957a006b34d35c7c85fbfe80e57de1ade1f9'
Cloning into 'third_party/argparse'...
remote: Counting objects: 667, done.
remote: Total 667 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (667/667), 325.09 KiB | 359.00 KiB/s, done.
Resolving deltas: 100% (397/397), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/argparse': checked out 'af60aefbbf43da32f75753f0c69f572ece654e9b'
Cloning into 'third_party/bottle'...
remote: Counting objects: 6287, done.
remote: Total 6287 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6287/6287), 4.29 MiB | 356.00 KiB/s, done.
Resolving deltas: 100% (3711/3711), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/bottle': checked out 'f1d668b4c5a2657fa4786fe170d24829f511cad9'
Cloning into 'third_party/frozendict'...
remote: Counting objects: 31, done.
remote: Total 31 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (31/31), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/frozendict': checked out 'b27053e4d11f5891319fd29eda561c130ba3112a'
Cloning into 'third_party/jedi'...
remote: Counting objects: 17801, done.
remote: Compressing objects: 100% (124/124), done.
remote: Total 17801 (delta 77), reused 0 (delta 0)
Receiving objects: 100% (17801/17801), 5.79 MiB | 251.00 KiB/s, done.
Resolving deltas: 100% (11841/11841), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/jedi': checked out 'a01e4c6b375795bb8c8ee0d4e86d4c535456f5b4'
Cloning into 'third_party/waitress'...
remote: Counting objects: 2202, done.
remote: Total 2202 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2202/2202), 826.21 KiB | 636.00 KiB/s, done.
Resolving deltas: 100% (1406/1406), done.
Checking connectivity... done
Submodule path 'third_party/ycmd/third_party/waitress': checked out '151cb1e33c08ad940b7d766ba383616f7e445d9e'

now it works. No issues with updating as well, so something odd is going on.

Now might be worth noting that I'm using /bin/bash as my shell for compatibility reasons with the vim-go plugin.

@Ghoughpteighbteau
Copy link
Author

Removed old repo, tried again, worked this time!

Difference between this installation and the last one was the last one was done in parallel with all the other plugins, on the first run of vim-plug. Is this a concurrency issue?

I don't envy you.

Yup, parrallel issue, if I remove all my plugins and install again I get this:

x YouCompleteMe
    fatal: destination path '/home/alex/.vim/plugged/YouCompleteMe' already exists and is not an empty directory.

and a follow up git submodule update --init --recursive in the YouCompleteMe repository... actually works, wtf? Something is screwy here.

@junegunn
Copy link
Owner

Strange. There shouldn't be any concurrency issue. I know there are people already using vim-plug to install/update YCM. I'll try it myself and let you know of the result.

@junegunn
Copy link
Owner

Ah, a similar thing happened to me, although not exactly the same. What happened is that the installation process timed out while doing git submodule update --init --recursive, and left the repo in an inconsistent state. I'd better find a better way to handle this, but in the meantime you can try to increase g:plug_timeout to a very large number, so that it never times out.

@junegunn
Copy link
Owner

I just succeeded to install YCM in parallel with a really large g:plug_timeout.

@junegunn junegunn added the bug label Sep 14, 2014
junegunn added a commit that referenced this issue Sep 14, 2014
If installation process is terminated during `git submodule ...`, the
directory ends up in an inconsistent directory. This commit ensures
that the directory is removed on failure.
junegunn added a commit that referenced this issue Sep 14, 2014
If installation process is terminated during `git submodule ...`, the
directory ends up in an inconsistent state. This commit ensures
that the directory is removed on failure.

Fixed Ruby 1.8.7 compatibility.
@junegunn
Copy link
Owner

Hey, I've just updated vim-plug to remove the plugin directory when timeout occurs (the process is silent for g:plug_timeout seconds), so it won't leave the directory in an inconsistent state. However, you still might need to increase g:plug_timeout anyway to be able to install YCM, although vim-plug will automatically retry with the increased limit if timeout occurs.

@Ghoughpteighbteau
Copy link
Author

I see, yah that submodule call does take some time.

OK, I'll test it again with an empty directory, to verify that the automatically increasing timeout does it's job. Then bump it up.

@junegunn
Copy link
Owner

The default number of retries is 2 (if g:plug_retries is not set), and for each retrial, vim-plug will increase the timeout by the unit timeout (g:plug_timeout) , so it goes:

  1. First try with the default 60 seconds timeout
  2. Timeout occurs during the installation, vim-plug removes the directory
  3. Retry with 120 seconds timeout
  4. If timeout occurs again, it will retry with 180 seconds limit for the last time

This scenario might eventually work for YCM unless that submodule call is unresponsive for 180 seconds. However, each failure will start from scratch, cloning the entire repository again, which can be very wasteful. So if you know in advance that YCM might take long to install, it's better to just start with a higher g:plug_timeout value.

@Ghoughpteighbteau
Copy link
Author

It works! +1 developer points.

I'm not very familiar with vimscript, so I don't know how feasible it is to add some kind of spinner for these long running operations, but It would be worth vim-plugs time. Thanks for the work!

@leebrooks0
Copy link

"if you know in advance that YCM might take long to install, it's better to just start with a higher g:plug_timeout value"

@junegunn what timeout value do you recommend for YCM?

@junegunn
Copy link
Owner

@leebrooks0 Well, I don't know I don't use it. But if I were frequently running into timeouts, I would simply set it to a very large value, like 1000, and stop worrying about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants