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

Tracker URL remover: "IndexError: pop index out of range" #1734

Open
x-0n opened this issue Oct 31, 2019 · 4 comments
Labels
bug

Comments

@x-0n
Copy link

@x-0n x-0n commented Oct 31, 2019

Issue:
Certain searches (I believe it's searches that return a number of results larger than some magic number) fail with a "search error" in the web UI and the following in /var/log/uwsgi/uwsgi.log:

ERROR:searx.webapp:search error
Traceback (most recent call last):
  File "/usr/local/searx/searx/webapp.py", line 514, in index
    result_container = search.search()
  File "/usr/local/searx/searx/search.py", line 545, in search
    plugins.call(self.ordered_plugin_list, 'on_result', self.request, self, result)
  File "/usr/local/searx/searx/plugins/__init__.py", line 73, in call
    ret = getattr(plugin, plugin_type)(request, *args, **kwargs)
  File "/usr/local/searx/searx/plugins/tracker_url_remover.py", line 46, in on_result
    parsed_query.pop(i)
IndexError: pop index out of range

The issue disappears when I disable Tracker URL remover in search preferences.

Steps to repeat:

  • enable Tracker URL remover
  • enter a query that will return a large number of results. Try "assange", time:any
@MarcAbonce

This comment has been minimized.

Copy link
Contributor

@MarcAbonce MarcAbonce commented Nov 1, 2019

Are you using the latest commit from master?
Because I supposedly fixed that error a couple of days ago in #1729, but maybe I missed some other edge case.

Based on the uwsgi log you posted though, I'm pretty sure your instance is based on an older commit because the line 46 in your tracker_url_remover.py was already changed in that PR.

If your instance is based on a Docker image, then I don't know how often they are updated with master.

@kvch kvch added the bug label Nov 1, 2019
@x-0n

This comment has been minimized.

Copy link
Author

@x-0n x-0n commented Nov 4, 2019

@MarcAbonce I'm sorry, should have mentioned. I'm using the docker image at searx/searx:latest.

The good news is that after updating my docker image the error has gone away. So your fix is apparently working :)

The bad news is that I don't find that PR in the build history here, so no idea if it was actually your fix that fixed this or something else: https://travis-ci.org/searx/searx/builds

Before updating my docker image today, I should have been at https://travis-ci.org/searx/searx/builds/603251099

@dalf

This comment has been minimized.

Copy link
Collaborator

@dalf dalf commented Nov 4, 2019

@x-0n : The last docker image version is 0.15.0-186-42d5e2c0, it matches the commit 42d5e2c

The travis build 603251099 is about the commit 12f42d1.
Line 479, you can see the docker version : searx/searx:0.15.0-177-12f42d15.

Looking at https://github.com/searx/searx/commits/master, the PR merged the commit 147ad50 which is after the commit 12f42d1.

Note, that when you use the docker image, you can see the version and commit at the bottom of the web pages, example here: https://a.searx.space

@x-0n

This comment has been minimized.

Copy link
Author

@x-0n x-0n commented Nov 5, 2019

@dalf : thanks for clarifying :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.