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

Plugins not working: Websocket error "x takes exactly n arguments (n-1 given)" #275

Closed
friday opened this issue Aug 26, 2018 · 17 comments
Closed
Labels

Comments

@friday
Copy link
Member

friday commented Aug 26, 2018

Steps to reproduce:

  1. Start Ulauncher
  2. With the kill plugin installed type in kill firefox (or something else you don't mind killing if the plugin should work)

Result: Nothing (no tab completion and nothing happens on pressing enter). Only "Loading" is shown.

The same thing happens with all the plugins I've tried (npms, search files, myip)

Every time I try I get a websocket error in "ulauncher.api.client.Client.Client" that "on_message() takes exactly 3 arguments (2 given)" and sometimes "on_open() takes exactly 2 arguments (1 given)" (see log for more details).

Ulauncher version: 4.1.0.r1
Linux distro: Arch
Desktop environment: Gnome/GTK with x11
Python version: 2.7.15 (GCC 8.1.1 20180531)

Verbose log


Fix: update python-websocket-client (python2-websocket-client for Arch and Fedora) to version 0.52 or higher.

@friday
Copy link
Member Author

friday commented Aug 26, 2018

I dug around a bit and found the problem: websocket-client/websocket-client#467

Downgrading "fixed" it for me (pip2 may be simply pip on other systems depending on which Python version is the default):

sudo pip2 install --force-reinstall websocket-client==0.48.0

Update: 0.52.0 also works, but not 0.53.0

@bondzula
Copy link

I'm having the same issue and the fix works as well.

@houbaron
Copy link

Yep, I meet it, too.

2018-08-28 10:47:58,933 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event KeywordQueryEvent to "com.github.brpaz.ulauncher-hash"
com.github.brpaz.ulauncher-hash | 2018-08-28 10:47:59,004 | ERROR | websocket: error() | error from callback <bound method Client.on_message of <ulauncher.api.client.Client.Client object at 0x7fcb131ed890>>: on_message() takes exactly 3 arguments (2 given)
  File "/usr/lib/python2.7/site-packages/websocket/_app.py", line 333, in _callback
    callback(*args)

@gornostal gornostal added the bug label Aug 28, 2018
@gornostal
Copy link
Member

@friday Thanks for reporting this bug.

@gornostal gornostal added this to TODO in Next Sep 2, 2018
@CRAG666
Copy link

CRAG666 commented Sep 2, 2018

the error continues after the update
2018-09-02 15:45:11,048 | ERROR | websocket: error() | error from callback <bound method Client.on_message of <ulauncher.api.client.Client.Client object at 0x7fab6e8cec90>>: on_message() takes exactly 3 arguments (2 given)

@gornostal gornostal moved this from TODO to In Progress in Next Sep 3, 2018
@gioulisapo
Copy link

I get the same error as well.
com.github.manulaiko.ulauncher-openinbrowser | 2018-09-03 10:57:02,225 | ERROR | websocket: error() | error from callback <bound method Client.on_message of <ulauncher.api.client.Client.Client object at 0x7fe69db51910>>: on_message() takes exactly 3 arguments (2 given)

@friday
Copy link
Member Author

friday commented Sep 3, 2018

No need to paste the error. We know this is unfixed and because of websocket-client/websocket-client#467

@gornostal
Copy link
Member

The broken version of python2-websocket-client seems to be 0.49 and 0.50

I don't see how I can lock the version for that package in code, because some distros may not have the necessary version in the main repo.

So please update python-websocket-client (python2-websocket-client for Arch and Fedora) to version 0.51 or higher. Or you can downgrade the package to version 0.48.

Thanks @friday for the solution

@friday
Copy link
Member Author

friday commented Sep 6, 2018

0.51.0 is also broken. You probably meant 0.52.0, which was released just a day or so before you wrote that comment. Anyway the latest version works again, so this is fixed now 👍 Since you kept the issue open I'll let you be the judge of when to close it.

@gornostal
Copy link
Member

Thanks for the heads up.

I'm going to close it in a few weeks. By that time people will hopefully upgrade their packages and won't run into this issues.

@gornostal gornostal moved this from In Progress to Done in Next Sep 10, 2018
friday referenced this issue in websocket-client/websocket-client Sep 11, 2018
@friday
Copy link
Member Author

friday commented Sep 20, 2018

Yup. Seems like he gave up and reverted the version which was working for Ulauncher in favor of a version that didn't break other usage cases. Very confusing.

@flick36
Copy link

flick36 commented Sep 20, 2018

Yup. Seems like he gave up and reverted the version which was working for Ulauncher in favor of a version that didn't break other usage cases. Very confusing.

Sorry I delete my comment, cause i indeed found your comment, on the commit, that reverted the functionality 😅 so, what's next?

@friday
Copy link
Member Author

friday commented Sep 20, 2018

Sorry I delete my comment, cause i indeed found your comment, on the commit, that reverted the functionality so, what's next?

Not sure. I just downgraded with pip for now. See above.

I'm not the maintainer. Just trying to help out, but I guess the methods could be wrapped somehow (although this is what the websocket-client library maintainer has been trying to do/fix for the last 5 releases so maybe it's not trivial), the version could also be fixed to 0.52.0 (meaning it can't be a global dependency like now). In the longer term it could be a good idea to replace it with something more stable, well tested and mature. Based on my impressions so far that could be anything ;)

@gornostal
Copy link
Member

Based on my impressions so far that could be anything ;)

🤣

I've decided to make a workaround because I'm not sure when those breaking changes to WebSocketApp callbacks end.

@gornostal
Copy link
Member

Fixed in 4.3.0

@dnome2
Copy link

dnome2 commented Aug 14, 2019

I had 0.56.0 and I was still seeing the issue and as @friday mentioned I downgraded to 0.52.0 and still see the issue. Can someone please help, why I'm still seeing this issue?

_on_open() takes exactly 3 arguments (2 given)
2019-08-14 14:00:37,797 error from callback <bound method WebSocket._on_open of <WebSocket object at 0x10c107490>>: _on_open() takes exactly 3 arguments (2 given)

@friday
Copy link
Member Author

friday commented Aug 14, 2019

Which Ulauncher version are you using @dnome2? This was fixed a year ago.

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

8 participants