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 Creating Demo Extension Following Developer Guide #1328

Open
3 tasks done
pbragamiranda opened this issue Dec 4, 2023 · 2 comments
Open
3 tasks done

Error Creating Demo Extension Following Developer Guide #1328

pbragamiranda opened this issue Dec 4, 2023 · 2 comments
Labels

Comments

@pbragamiranda
Copy link

Environment

Ubuntu 22.04.3 LTS

Bug description

Hi everyone,

I'm trying to create my first extension following the development tutorial but running into issues.

After copying the code to main.py, I attempted to run the file using the recommended Debugging & Logging approach, but I encountered an error.

I've looked into the extension.py class in the Ulauncher repository for debugging, but I didn't have much luck.

Here are my logs:

VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054 python3 ~/.local/share/ulauncher/extensions/kagi-search/main.py
kagi-search | 2023-12-04 21:46:18,674 | ERROR | ulauncher.api.client.Client: on_error() | WS Client error Connection to the remote host was lost.
kagi-search | 2023-12-04 21:46:18,674 | ERROR | websocket: error() | error from callback <function Client.connect.<locals>.<lambda> at 0x7f78dce34670>: Client.connect.<locals>.<lambda>() takes 1 positional argument but 3 were given
kagi-search | 2023-12-04 21:46:18,674 | ERROR | ulauncher.api.client.Client: on_error() | WS Client error Client.connect.<locals>.<lambda>() takes 1 positional argument but 3 were given

python3 -V

Python 3.10.12

thanks in advance!

Log output

kagi-search | 2023-12-04 21:46:18,674 | ERROR | ulauncher.api.client.Client: on_error() | WS Client error Connection to the remote host was lost.
kagi-search | 2023-12-04 21:46:18,674 | ERROR | websocket: error() | error from callback <function Client.connect.<locals>.<lambda> at 0x7f78dce34670>: Client.connect.<locals>.<lambda>() takes 1 positional argument but 3 were given
kagi-search | 2023-12-04 21:46:18,674 | ERROR | ulauncher.api.client.Client: on_error() | WS Client error Client.connect.<locals>.<lambda>() takes 1 positional argument but 3 were given

Communication guidelines

  • I have read and agree with Ulauncher's communication guidelines and checked the troubleshooting page for self-help.

Not an extension issue

  • This issue applies to the Ulauncher application, not a specific extension.

Ulauncher v6

  • I have made sure the bug isn't already fixed in v6.
@friday
Copy link
Member

friday commented Dec 5, 2023

It's probably because of #1274.

You can copy your extension to ~/.local/share/ulauncher/extensions/your-extension
Then kill ulauncher (systemctl --user stop ulauncher if you are using systemd) and run ulauncher -v --dev in a terminal to get log output.

Also see #869. This is all changed now for v6. I never used the documented way and it's now unsupported/removed in v6 which will basically do the above but in more convenient ways without requiring restarts.

@pbragamiranda
Copy link
Author

Hey, @friday. Thanks for your reply.

I'm able to get the logs output when I run ulauncher -v --dev. My problem is when I try to run the basic example extension listed on the development tutorial.

When I run: VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054 python3 ~/.local/share/ulauncher/extensions/kagi-search/main.py

I get:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/utils/SimpleWebSocketServer.py", line 273, in _handleData
    self.handleConnected()
  File "/usr/lib/python3/dist-packages/ulauncher/api/server/ExtensionController.py", line 98, in handleConnected
    raise Exception('Incorrect path %s' % self.request.path)
Exception: Incorrect path /

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/utils/SimpleWebSocketServer.py", line 659, in serveforever
    client._handleData()
  File "/usr/lib/python3/dist-packages/ulauncher/utils/SimpleWebSocketServer.py", line 275, in _handleData
    raise Exception('handshake failed: %s' % e) from e
Exception: handshake failed: Incorrect path /

friday added a commit that referenced this issue Feb 18, 2024
Someone reported that this doesn't work. I don't have the time to test but I think it was overly complex and a bad idea to describe how to debug extensions in this way.
We are removing this anyway in Ulauncher v6 and I don't want to be bothered with issues about it, so removing the instructions

You never needed this ability.

fixes #1328
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

2 participants