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

"Error detected while processing function" after install when opening go files #2536

Closed
thingsis opened this issue Oct 6, 2019 · 15 comments · May be fixed by #2537
Closed

"Error detected while processing function" after install when opening go files #2536

thingsis opened this issue Oct 6, 2019 · 15 comments · May be fixed by #2537
Labels

Comments

@thingsis
Copy link

thingsis commented Oct 6, 2019

What did you do? (required: The issue will be closed when not provided)

Clean install of both vim and vim-go on windows with a working install of go 1.13. Everytime I load a go file I get the above error. See below for details

What did you expect to happen?

The editor to open without en error message so that I can at least :GoInstallBinaries to finish the installation - this has not yet taken place, since executing any :Go... command gives a similar error

What happened instead?

The following error:

Error detected while processing function <SNR>23_register[9]..go#lsp#DidOpen[19]..9[2]..go#util#ModuleRoot[1]..go#util#ExecInDir[9]..go#util#E
xec[17]..<SNR>25_exec[7]..<SNR>25_system:
line   11:
E484: Can't open file C:\Users\hguschov\AppData\Local\Temp\VIoAD0C.tmp
Error detected while processing function <SNR>23_register[9]..go#lsp#DidOpen[19]..9:
line    2:
E171: Missing :endif
Press ENTER or type command to continue

Configuration (MUST fill this out):

vim-go version:

master

vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):

vimrc
if has('gui_running')
  set guioptions-=T  "  no toolbar
  set guifont=Go_Mono:h12:cANSI:qDRAFT  "  Go Mono font
  colo dichromatic
  syntax on
  set lines=42 columns=142
  set guicursor+=a:blinkon0
endif
filetype plugin indent on
set backspace=indent,eol,start
:nnoremap  :NERDTreeToggle
set visualbell
set encoding=utf-8
set fileencoding=utf-8
autocmd FileType go setlocal tabstop=3 shiftwidth=3 softtabstop=3
""autocmd FileType go lcd %:p:h
set shiftwidth=3
set undofile
set undodir=~/vimfiles/undodir

Vim version (first three lines from :version):

VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:36:07)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1

Go version (go version):

Go environment

go env Output:
go version go1.13 windows/amd64
@bhcleek
Copy link
Collaborator

bhcleek commented Oct 6, 2019

@thingsis thank you for the bug report; I'll try to get this fixed quickly for you.

Does this happen for you anytime you open a go file, or only when you try opening a new Go file? Are you specifying the file to open on the command line or opening after you've started Vim?

@thingsis
Copy link
Author

thingsis commented Oct 6, 2019

It doesn't matter whether I open the file in vim or via the command line. No difference. What do you mean by only when opening a new go file?

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 6, 2019

What do you mean by only when opening a new go file?

Does it happen when you open a file that's already on disk?

I've tried duplicating this on a Windows laptop that's been tucked away in a closet without success.

The the go env section of the original bug report isn't populated. Can you please run go env from your working directory so I can see information about your Go environment? I'm also curious what your TMPDIR is set to.

I can provide a workaround for you that will keep you from seeing this error message, but I think there's something about your system that is different than others, so the workaround may simply expose other problems.

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 6, 2019

Can you give #2537 a try? I don't expect it to fully fix your issue, but it should at least eliminate the errors you're seeing now.

@thingsis
Copy link
Author

thingsis commented Oct 7, 2019

I tried this. It does get rid of those errors, but I still get
vim-go: could not determine appropriate working directory for gopls
when starting vim with a go file.

Also, :GoInstallBinaries still doesn't work. This is the output:


vim-go: motion not found. Installing github.com/fatih/motion to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading github.com/fatih/motion:
vim-go: Error installing github.com/fatih/motion:
vim-go: errcheck not found. Installing github.com/kisielk/errcheck to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading github.com/kisielk/errcheck:
vim-go: Error installing github.com/kisielk/errcheck:
vim-go: golangci-lint not found. Installing github.com/golangci/golangci-lint/cmd/golangci-lint to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading github.com/golangci/golangci-lint/cmd/golangci-lint:
vim-go: Error installing github.com/golangci/golangci-lint/cmd/golangci-lint:
vim-go: gotags not found. Installing github.com/jstemmer/gotags to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading github.com/jstemmer/gotags:
vim-go: Error installing github.com/jstemmer/gotags:
vim-go: keyify not found. Installing honnef.co/go/tools/cmd/keyify to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading honnef.co/go/tools/cmd/keyify:
vim-go: Error installing honnef.co/go/tools/cmd/keyify:
vim-go: iferr not found. Installing github.com/koron/iferr to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading github.com/koron/iferr:
vim-go: Error installing github.com/koron/iferr:
vim-go: asmfmt not found. Installing github.com/klauspost/asmfmt/cmd/asmfmt to folder C:\Users\hguschov\go\bin\
vim-go: Error downloading github.com/klauspost/asmfmt/cmd/asmfmt:
vim-go: Error installing github.com/klauspost/asmfmt/cmd/asmfmt:  

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 7, 2019

I'm wondering if your TMPDIR is missing or something. Does C:\Users\hguschov\AppData\Local\Temp exist on your system? And is writeable by you?

@thingsis
Copy link
Author

thingsis commented Oct 7, 2019

I was wondering the same and had checked that already. It exists and is writable. It even has some temporary go files in it already. It does seem strange though...

@bhcleek bhcleek added the windows label Oct 7, 2019
@bhcleek
Copy link
Collaborator

bhcleek commented Oct 7, 2019

The errors you're seeing now when running :GoInstallBinaries are also likely caused by the same problem; an inability to access a temporary directory. Can you create a directory in your $TMPDIR (e.g. C:\Users\hguschov\AppData\Local\Temp) manually?

By some chance, is vim running as a different user or with a restricted set of permissions somehow?

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 8, 2019

@thingsis I've modified #2537 such that it should output the error when running :GoInstallBinaries. To gather as much information as possible, can you give it another shot with g:go_debug=['shell-commands'] set. I'd like to know:

  1. the output from :GoInstallBinaries
  2. the output of :messages after running :GoInstallBinaries
  3. whether there are any new directories in $TMPDIR (i.e. C:\Users\hguschov\AppData\Local\Temp) after running :GoInstallBinaries.

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 21, 2019

@thingsis have you resolved your issue, or should we keep this issue open?

@thingsis
Copy link
Author

@bhcleek Let's keep it open. I am currently finishing up a project and will then gladly keep working on it. Sorry for the delay!

@lyda
Copy link

lyda commented Nov 30, 2019

I see something similar:

Error detected while processing function <SNR>58_register[9]..go#lsp#DidOpen[9].
.282[2]..<SNR>103_newlsp[355]..go#job#Start:
line   62:
E475: Invalid argument: cwd
vim-go: initializing gopls

My issue might be related to my go version:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 21 2019 04:10:35)
Included patches: 1-197, 322, 377-378, 550, 649, 651, 703, 706-707
Extra patches: 8.1.1401, 8.1.1382, 8.1.1368, 8.1.1367, 8.1.1366, 8.1.1365, 8.1.1
046, 8.1.0613, 8.1.0547, 8.1.0546, 8.1.0544, 8.1.0540, 8.1.0539, 8.1.0538, 8.1.0
506, 8.1.0208, 8.1.0206, 8.1.0205, 8.1.0189, 8.1.0177, 8.1.0067, 8.1.0066

@bhcleek
Copy link
Collaborator

bhcleek commented Nov 30, 2019

@lyda the issue you're seeing is different than @thingsis' issue. The issue you're seeing is because your version of Vim is not supported by vim-go; you have 8.0.197 with a bunch of additional patches; vim-go requires at least Vim 8.0.1453.

@bhcleek
Copy link
Collaborator

bhcleek commented Jan 12, 2020

@thingsis should we close this?

@bhcleek
Copy link
Collaborator

bhcleek commented Jan 31, 2020

closing for lack of feedback

@bhcleek bhcleek closed this as completed Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants