mattn/vim-gist

Error 'Post failed: Continue' even though Gist was actually published

sloria opened this issue ยท 48 comments

On Vim 7.4.1707 with the latest gist-vim (as of this writing), I am getting an error every time I run :Gist that reads

Post failed: Continue

Consequently, let g:gist_open_browser_after_post = 1 does not work.

However, the Gists actually get posted successfully.

Any ideas?

Same for neovim 0.1.3.

are you using gist.vim over http proxy?

Nope, but something strange just happened. I've tried adding a new private gist just now (after restarting neovim) and it worked... It printed the link...

m9 commented

Having same issue
full vim version information available here

Could you please upgrade webapi-vim?

I already have the latest version and managed to get the error with ':Gist -p' just now.

Could you please apply following patch to debug this issue?

diff --git a/autoload/webapi/http.vim b/autoload/webapi/http.vim
index f7b9eb2..123768e 100644
--- a/autoload/webapi/http.vim
+++ b/autoload/webapi/http.vim
@@ -159,6 +159,7 @@ function! webapi#http#get(url, ...) abort
     throw "require `curl` or `wget` command"
   endif
   if follow != 0
+    let g:debug = res
     while res =~ '^HTTP/1.\d 3' || res =~ '^HTTP/1\.\d 200 Connection established' || res =~ '^HTTP/1\.\d 100 Continue'
       let pos = stridx(res, "\r\n\r\n")
       if pos != -1
  1. Apply patch above.
  2. Gist -p
  3. :echo debug

Note that please don't paste secret contents on here.

E121: Undefined variable: debug
E15: Invalid expression: debug

Using latest neovim with vim-plug on OS X.

Maybe fixed. Could you please try latest webapi-vim.

Installed the update. Same issue.

Today, I updated webapi-vim. could you please try latest?

could be related to vim-plug, i nuked and re cloned the repo in the right place and its working. previously git log only showed last commit about curl workaround and nothing else

Updated. Worked for the first paste. Then I tried to paste again with Gist -p and it failed with:

Updating gist...                                                                                                                                                       
Post failed: Not Found

Same error here with vim.

@enkeyz do you use latest gist-vim and webapi-vim?

@mattn I did PlugUpdate before testing.

@mkozjak could you please try #205 (comment) ?

@mattn Yes, I'm using latest of everything.

+1 on this issue as well. NeoVim 0.1.4 using vim-plug.

+1, using neovim 0.1.5

The gist gets posted even with the error. However if i select just a small amount of lines and run :'<,'>Gist there is no error and the plugin behaves as expected.

mattn commented

I don't reproduce this after I fixed webapi-vim in few days ago.

Seeing the same thing with NeoVim 0.1.4 using vim-plug (all versions latest). Seems to only occur when posting to Gist, but does happen on both create and updating.

mattn commented

This is my gist that I did :Gist and :w after opening gist from :Gist -l.

https://gist.github.com/mattn/a0158a1b46da3a52cb576a6ff99ebffd/revisions

AFAICS, no problem.

It works fine if I only save a very small gist (e.g. by visual selecting a line and :'<,'>Gist, as per @JLoureir0's comment), so your example works fine @mattn. The error seems to appear when you save larger gists - in my case it failed when I tried to save over 20 lines.

mattn commented

With Vim 7.4.1707 the behavior is exactly the same as NeoVim, it post to Github but it gives out the error unless the amount of data on the gist is really small.

My version of curl is 7.48.0

I can reproduce in Vim 7.3 using this minimal vimrc, and this content.

vim -u test-vimrc
// create test file, didn't save
:Gist

As mentioned it does actually save (that gist I linked to is the result of getting that error), and doesn't seem to happen with smaller files.

screen shot 2016-05-11 at 12 17 09

mattn commented

Someone, could you please try following?

  1. download this
  2. save aa.vim in same directory
  3. :so aa.vim
mattn commented

Strange. Then your gist-vim or webapi-vim should work well.

mattn commented

Many thanks to responses for this.

I figure out that some version of curl return response that contains strange \r.

Thanks for the getting to the bottom of it @mattn - working great now.

Working good, thanks!

Thanks for the fix @mattn. Working great again.

Still getting (:Gist):

Posting it to gist...
Post failed: Not Found
Press ENTER or type command to continue

No operations are working except for when I set:

let g:gist_post_anonymous = 1

Note that :Gist -l is working so it is not an issue with my user.

MacVim
Both plugins updated just now
Using token in ~/.gist-vim

mattn commented

@mblarsen did you try with latest gist-vim and webapi-vim ?

@mattn I ran an update with vundle's :PluginUpdate should I update manually to get the latest?
Note that I can read gists but I cannot post unless anonymous.

@mattn Just tried checking out both repos. It made no difference. I can post as anonymous only, but I can connect to github and get my gists. I cannot save them after making changes.

@mattn my apologies, it turns out that my two-factor token didn't have gist access.

mattn commented

:)