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

IndexError: list index out of range #166

Closed
camilonova opened this issue Jun 19, 2014 · 9 comments
Closed

IndexError: list index out of range #166

camilonova opened this issue Jun 19, 2014 · 9 comments

Comments

@camilonova
Copy link

I'm trying to run the demo browsing the locust docs and I'm getting this error:

[2014-06-19 16:43:47,263] axc.local/ERROR/stderr: Traceback (most recent call last):
  File ".../lib/python2.7/site-packages/locust/core.py", line 267, in run
    self.execute_next_task()
  File ".../lib/python2.7/site-packages/locust/core.py", line 293, in execute_next_task
    self.execute_task(task["callable"], *task["args"], **task["kwargs"])
  File ".../lib/python2.7/site-packages/locust/core.py", line 305, in execute_task
    task(self, *args, **kwargs)
  File ".../locustfile.py", line 33, in load_sub_page
    url = random.choice(self.urls_on_current_page)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 274, in choice
    return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
IndexError: list index out of range

and at the end I get this error report:

GET /en/latest//: 'ConnectionError(MaxRetryError("HTTPConnectionPool(host=\'docs.locust.io\', port=80): Max retries exceeded with url: /en/latest// (Caused by <class \'socket.gaierror\'>: [Errno 8] nodename nor servname provided, or not known)",),)'
GET /en/latest/writing-a-locustfile.html: 'ConnectionError(MaxRetryError("HTTPConnectionPool(host=\'docs.locust.io\', port=80): Max retries exceeded with url: /en/latest/writing-a-locustfile.html (Caused by <class \'socket.gaierror\'>: [Errno 8] nodename nor servname provided, or not known)",),)'

It keeps stuck after the first error doing nothing, if I redirect the url to a custom site and check the logs, as soon as the error gets in locusts stops making requests.

I'm using a usual virtualenv with python 2.7 and packages installed by pip.

Thanks.

@heyman
Copy link
Member

heyman commented Jun 24, 2014

Hmm, that's strange. Can you reach http://docs.locust.io from your browser?

@camilonova
Copy link
Author

Yes I can, it works for the first pages and then starts to fail.

@Jahaja
Copy link
Member

Jahaja commented Jul 12, 2014

You seem to have DNS related problems, could you try this on another host or after changing your nameserver to, for example, googles 8.8.8.8?

@camilonova
Copy link
Author

Still the same, can we test something else than DNS ?

@Jahaja Jahaja closed this as completed Dec 6, 2014
@whgibbo
Copy link

whgibbo commented Jun 15, 2015

I'm having the same issue, what was the solution ?
Forget I solved it, I was using on_start rather than defining tasks :( Sorry

@msert29
Copy link

msert29 commented Sep 27, 2017

I think you guys need to specify the on_start method and check that you have configured the task decorator before task methods.

@rohitkhatana
Copy link

rohitkhatana commented Mar 30, 2018

Yup, I had the same issue. I was not decorating my task/method with @task. After decorating the method, I did not get the error :)

@renanbastos93
Copy link

I have the same problem, I using a macOS Mojave in a MacMini 2012

@vincent-haoy
Copy link

I got the same issue. I used 2 diff machines to send requests to the same server. One of the machines goes well but the other one keeps reporting this error. It is quite strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants