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

xmlrpc ResponseError #22

Open
alazyworkaholic opened this issue Nov 14, 2020 · 5 comments
Open

xmlrpc ResponseError #22

alazyworkaholic opened this issue Nov 14, 2020 · 5 comments
Labels
state:waiting Waiting for response for reporter

Comments

@alazyworkaholic
Copy link

After leaving Dokuvimki aside for several months I fired it up again and found it won't start. Unfortunately, I don't remember at all what I might have done to the computer during that busy time that caused this issue. Dokuwiki itself continutes to run perfectly well through the browser.

Ubuntu 20.04 x64

Upon starting nvim and running DokuVimKi.

Connection to http://localhost:8766/doku.php established!
Refreshing page index!
Error detected while processing function provider#python3#Call:
line 18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 945, in dokuvimki
File "<string>", line 85, in __init__
File "<string>", line 344, in index
File "<string>", line 670, in refresh
File "/usr/local/lib/python3.8/dist-packages/dokuwikixmlrpc.py", line 114, in catch_xmlerror
  return f(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/dokuwikixmlrpc.py", line 273, in all_pages
  return self._xmlrpc.wiki.getAllPages()
File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
  return self.__send(self.__name, args)
File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
  response = self.__transport.request(
File "/usr/lib/python3.8/xmlrpc/client.py", line 1153, in request
  return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python3.8/xmlrpc/client.py", line 1169, in single_request
  return self.parse_response(resp)
File "/usr/lib/python3.8/xmlrpc/lient.py", line 1341, in parse_response
  return u.close()
File "/usr/lib/python3.8/xmlrpc/client.py", line 653, in close
  raise ResponseError
xmlrpc.client.ResponseError: ResponseError()

So I try a health check:

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/bin/python2
  - ERROR: Command error (job=6, exit code 1): `'/usr/bin/python2' -c 'import sys; sys.path.remove(""); import neovim; print(neovim.__file__)'` (in '/home/alan')
    Output: Traceback (most recent call last):  File "<string>", line 1, in <module>  File "/usr/local/lib/python2.7/dist-packages/neovim/__init__.py", line 5, in <module>    import pynvim  File "/usr/local/lib/python2.7/dist-packages/pynvim/__init__.py", line 9, in <module>    from .api import Nvim, NvimError  File "/usr/local/lib/python2.7/dist-packages/pynvim/api/__init__.py", line 7, in <module>    from .buffer import Buffer  File "/usr/local/lib/python2.7/dist-packages/pynvim/api/buffer.py", line 2, in <module>    from .common import Remote  File "/usr/local/lib/python2.7/dist-packages/pynvim/api/common.py", line 4, in <module>    from msgpack import unpackbImportError: No module named msgpack
    Stderr: Traceback (most recent call last):  File "<string>", line 1, in <module>  File "/usr/local/lib/python2.7/dist-packages/neovim/__init__.py", line 5, in <module>    import pynvim  File "/usr/local/lib/python2.7/dist-packages/pynvim/__init__.py", line 9, in <module>    from .api import Nvim, NvimError  File "/usr/local/lib/python2.7/dist-packages/pynvim/api/__init__.py", line 7, in <module>    from .buffer import Buffer  File "/usr/local/lib/python2.7/dist-packages/pynvim/api/buffer.py", line 2, in <module>    from .common import Remote  File "/usr/local/lib/python2.7/dist-packages/pynvim/api/common.py", line 4, in <module>    from msgpack import unpackbImportError: No module named msgpack
  - INFO: Python version: 2.7.18
  - INFO: pynvim version: unable to load neovim Python module
  - ERROR: pynvim is not installed.
    Error: unable to load neovim Python module
    - ADVICE:
      - Run in shell: pip install pynvim

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.8.5
  - INFO: pynvim version: 0.4.1 (outdated; from /usr/lib/python3/dist-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.4.2

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v10.19.0
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

I see the python 2 error that msgpack and pynvim are missing but I think it's irrelevant because DokuVimKi should (I think) use python3, which doesn't show any checkhealth error.

How can I find out what's gone wrong with the xmlrpc response handling?

@alazyworkaholic
Copy link
Author

alazyworkaholic commented Dec 13, 2020

I've tried installing dokuvimki on another machine that's just had a fresh OS install but get a different yet similar error:

Connection to http://192.168.2.46/dokuwiki/doku.php established!
Refreshing page index!
Error detected while processing function provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/alan/gits/dokuvimki/plugin/dokuvimki.ph", line 87, in __init__
    self.index(self.cur_ns, True)
  File "/home/alan/gits/dokuvimki/plugin/dokuvimki.py", line 346, in index
    self.refresh()
  File "/home/alan/gits/dokuvimki/plugin/dokuvimki.py", line 673, in refresh
    data = self.xmlrpc.all_pages()
  File "/home/alan/.local/lib/python3.8/site-packages-dokuwikixmlrpc.py", line 115, in catch_xmlerror
    return f(*args, **kwargs)
  File "/home/alan/.local/lib/python3.8/site-packages/dokuwikixmlrpc.py", line 274, in all_pages
    return self._xmlrpc.wiki.getAllPages()
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1153, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1169, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1341, in parse_response
    return u.close()
  File "/usr/lib/python3.8/xmlrpc/lcient.py", line 653, in close
    raise ResponseError()
xmlrpc.clientResponseError: ResponseError()

Running nvim v-.5.0-dev+941-g9c56d8e5f
Ubuntu 20.10
Connecting to DokuWiki 2020-07-29 'Hogfather'

Steps:

cd ~/gits
apt install python3-pynvim python3-pip
git clone git://github.com/kynan/dokuvimki/
pip3 install dokuwikixmlrpc
mkdir -p ~/.local/share/nvim/site/pack/dokuvimki/start
ln -s ~/gits/dokuvimki ~/.local/share/nvim/site/pack/dokuvimki/start/dokuvimki

Insert into ~/.local/share/nvim/site/pack/alazyDokuVimKi.vim

let g:DokuVimKi_USER = 'myUser'
let g:DokuVimKi_PASS = 'myP@$$'
let g:DokuVimKi_URL = 'http://192.168.2.46/dokuwiki/doku.php'
let g:DokuVimKi_INDEX_WINWIDTH = 20

Insert into ~/.config/nvim/init.vim

let alazyDokuVimKi = $HOME . "/.local/share/nvim/site/pack/dokuvimki/alazyDokuVimKi.vim"
if filereadable(alazyDokuVimKi)
    execute 'source  '.alazyDokuVimKi
endif

I'm relying on neovim/vim8 native plugin management and am using python3, but I think that should still work. Would you be able to pass on any XML-RPC Error Codes so one can have some idea of what's wrong?

xmlrpc isn't totally dead. I'm taking some agonizingly slow baby steps to figure this out but python3 dokuwikixmlrpc.py -w http://192.168.2.46/dokuwiki -u myUser -p my P@$$ --allpages returned my list of pages!

@kynan
Copy link
Owner

kynan commented Apr 3, 2021

Yes, if Vim is built with Python 3 support, that is used. Otherwise Python 2.

I've just tried NeoVim and it seems to be working for me:

$ sudo apt install -y neovim python3-pynvim
$ mkdir -p ~/.config/nvim
$ echo "source ~/.config/vim/vimrc" > ~/.config/nvim/init.vim
$ nvim +DokuVimKi

I think the URL in your Vim config may be wrong. I should be the root of your wiki, since dokuwikixmlrpc will append /lib/exe/xmlrpc.php to it.

Can you try setting it to the same URL you used when you tried via dokuwikixmlrpc.py directly?

let g:DokuVimKi_URL = 'http://192.168.2.46/dokuwiki'

@kynan
Copy link
Owner

kynan commented Apr 3, 2021

I just tried appending /doku.php to my own wiki URL and I'm seeing the following failure:

Failed to parse response. Is the DokuWiki XML-RPC server enabled?

If I disable error handling in dokuwikixmlrpc (by commenting these lines) I get the following backtrace:

Error detected while processing function <SNR>2_lod_cmd[3]..provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/path/to/dokuvimki/plugin/dokuvimki.py", line 53, in __init__
    if self.xmlrpc_init():
  File "/path/to/dokuvimki/plugin/dokuvimki.py", line 113, in xmlrpc_init
    dw_version = self.xmlrpc.dokuwiki_version
  File "/path/to/dokuwikixmlrpc/dokuwikixmlrpc.py", line 96, in catch_xmlerror
    return f(*args, **kwargs)
  File "/path/to/dokuwikixmlrpc/dokuwikixmlrpc.py", line 166, in dokuwiki_version
    return self._xmlrpc.dokuwiki.getVersion()
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1153, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1169, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1335, in parse_response
    p.feed(data)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 438, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: undefined entity: line 95, column 19

@kynan kynan added the state:waiting Waiting for response for reporter label Apr 3, 2021
@kynan
Copy link
Owner

kynan commented Oct 3, 2021

@alazyworkaholic is this still an issue for you?

@kynan
Copy link
Owner

kynan commented Jan 30, 2022

@alazyworkaholic any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:waiting Waiting for response for reporter
Projects
None yet
Development

No branches or pull requests

2 participants