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 Code 429: Too Many Requests #16

Open
2 tasks
SyedShahSultan opened this issue Nov 22, 2019 · 5 comments
Open
2 tasks

Error Code 429: Too Many Requests #16

SyedShahSultan opened this issue Nov 22, 2019 · 5 comments
Assignees
Labels
bug Something isn't working documentation Documentation needs to be updated in response to this issue

Comments

@SyedShahSultan
Copy link

SyedShahSultan commented Nov 22, 2019

Please use the template below to submit your bug report.

Describe the bug
In my case study, there is a depot that has 4 vehicles on 4 different routes. The total no. of customers needs to be visited are around 22 and a depot. When I am assigning fewer customers to 1st 3 vehicles (around 1 or two), the 4th vehicle who has to cover all the remaining customers is giving me an error like Error Code 429: Too Many Requests (sometimes. not always). Secondly when I am combining the codes of all the 4 vehicles is a single "Spyder-Python" file, it fails to execute anything. Furthermore, I am unable to change the pin color of my depot through a loop, to distinguish it from the customers.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
    4. See error

Expected behavior
I want to show all the routes of my vehicles on a single map with the different pin of my depot through "Spyder Environment". I am planning to run the code with Python's GUI platform.

Screenshots
image

image

Python Version (please complete the following information):

  • Python 3

VeRoViz Version:

# Paste the result of the following Python command:
import veroviz as vrv
vrv.checkVersion()

'Your current installed version of veroviz is 0.3.1. You are up-to-date with the latest available version.'

Operating System (please complete the following information):

VeRoViz Code.zip

Windows 10]

Additional context
Add any other context about the problem here.

@SyedShahSultan SyedShahSultan added the bug Something isn't working label Nov 22, 2019
@cmurray3
Copy link
Contributor

Hi, Syed,
Sorry you're experiencing issues, and thanks for submitting an issue ticket so we can try to improve VeRoViz.

Could you please attach your .xlsx files so we can run your Python code and work on fixes?

When I am assigning fewer customers to 1st 3 vehicles (around 1 or two), the 4th vehicle who has to cover all the remaining customers is giving me an error like Error Code 429: Too Many Requests (sometimes. not always).

Based on my initial look at your code/issue, the "429" error is coming from OpenRouteService. They have a limit on the number of requests that can be made per minute. We will be updating veroviz to automatically insert a waiting time to prevent this issue. In the meantime, you can manually insert a "sleep" time to adhere to the rate limits. Rate limit info is available here: https://openrouteservice.org/plans/

Secondly when I am combining the codes of all the 4 vehicles is a single "Spyder-Python" file, it fails to execute anything.

This often happens in single Python scripts...if there's an error anywhere the entire script will fail. You can use try and except to capture these issues. Hopefully the fixes we implement in the next veroviz version will address the particular issues you're experiencing.

Furthermore, I am unable to change the pin color of my depot through a loop, to distinguish it from the customers.

I'll have to look more closely at your code to see what's happening. It looks like you're trying to implement a custom marker, which we currently don't support in veroviz. If you're looking for different pin colors, though, you can do that with the currently-supported pins in veroviz. See https://veroviz.org/docs/leaflet_style.html#leaflet-prefix-and-leaflet-type for more info.

@SyedShahSultan
Copy link
Author

SyedShahSultan commented Nov 22, 2019

Thanks a lot, Sir for your prompt reply and for your suggestions. I will definitely go over those suggestions. .xlsx files used in the code is attached for your consideration.

Data_Coordinates.xlsx
Vehicle1_Patients.xlsx
Vehicle2_Patients.xlsx
Vehicle3_Patients.xlsx
Vehicle4_Patients.xlsx

@cmurray3 cmurray3 added the documentation Documentation needs to be updated in response to this issue label Nov 22, 2019
@cmurray3 cmurray3 self-assigned this Nov 22, 2019
@cmurray3
Copy link
Contributor

I believe I have identified the cause of the 429 error:

  • OpenRouteService limits the number of "directions" (shapepoints) requests to 40 requests/minute.
  • In your particular example, there's not a single vehicle that reaches this limit. However, if the code is called frequently (or is re-run), it's fairly easy to reach this limit.
  • Unfortunately, this isn't something that we can monitor/track within veroviz, as it depends on how frequently a user re-runs certain cells in a Jupyter notebook.

For the depot node coloring, I've made some changes to your Jupyter notebook (attached), which should make it easier for you to accomplish this.

Archive.zip


As an issue, I don't see an immediate/obvious "fix" from VeRoViz's side. However, we should update our documentation to indicate the following:

  1. It is the user's responsibility to monitor the rate of requests being made to external data providers.
  2. Some of these rate limits can be avoided by using "locally" installed versions of the data providers.
    • We'll be integrating these options in version 0.4.0 of VeRoViz.

@SyedShahSultan
Copy link
Author

Thanks for taking out some time from your busy schedule. There is one more suggestion. I don't know whether it's on your list or not. Or maybe I am missing that part. There should be some way by which a driver able to check it's position. This will help the driver to follow the given routes. And I don't feel any hesitation in saying that you guys are really doing a great job. Thanks a lot once again.

@SyedShahSultan
Copy link
Author

I do not understand how to use "os.environ". Previously I was initializing my ORS key without this function. Because whenever I was using that function, I was having some error. The same thing is happening now again. Below is what you suggest.

image

Here this is what I am getting. I am unable to understand my mistake.

image

I am getting no error if I am initializing my ORS key directly without "os.environ".

@cmurray3 cmurray3 mentioned this issue May 10, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Documentation needs to be updated in response to this issue
Projects
None yet
Development

No branches or pull requests

2 participants