-
Notifications
You must be signed in to change notification settings - Fork 70
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
Implement standard error handling for Qualtrics API errors #217
Comments
closing per my comment on #206 |
Spoke too soon... this is still a problem. Have a ticket open with Qualtrics support. Hence, having a try/except wrapper on the call, and/or, some spacing out of the calls, might still help. |
Ok, I have a lot more information and I hope better suggestions now. As I stated above, 504 errors are timeouts per Qualtrics support. Their best suggestion for mitigating this is... drumroll... to submit smaller requests. In the case of For It's not a rate-limit issue, those limits are really high What I think we should do:
|
I have been looking at revamping the whole package to httr2 because it has much nicer handling of rate limiting, retries, etc. Maybe this is the motivation we need to finally do it. |
I'm not familiar with So, using |
@juliasilge what are you thinking, for the short-term? |
I have a question @chrisumphlett on the first point about the
And then folks can click through to this article to find their base URL. (We can't unfortunately link directly to that URL because of CRAN rules about redirects.) I believe almost everyone should be using a base URL that is like On your second point, are you saying you want to automatically retry behind the scenes for a 504 error a couple of times? Let's implement that for the most important function, see how it goes, and then extend it later to more functions. We definitely should include 504 errors in |
Regarding the URL: for my organization, the "xxx" in 2nd point-- yes, retry on errors. Perhaps not limited to 504. Maybe limited to 50X. |
@juliasilge I made a simple change to The 2nd call was 267 pages. There were 11 total failures, on one occasion it was 2 in a row. So the default |
Oh, that seems pretty great @chrisumphlett! I think let's give that a go. |
* use httr::RETRY instead of httr::VERB (#217) This will implement consistent error-handling across all of the api call functions in the package. They will be retried up to 3 times if there is any error. * added httr::RETRY change * adding skip_on_cran to two tests taking too long (#217) * Update R/utils.R * Update R/utils.R Co-authored-by: Julia Silge <julia.silge@gmail.com>
This is now addressed and we can close it, correct @chrisumphlett? |
yes! |
In my experience getting a 500 error from Qualtrics is a normal, intermittent issue. When using a function that will need to iterate many times to get its results (a lot of survey responses from
fetch_survey
or many contacts fromfetch_distribution_history
), if it gets that error one time, you have to start over. In some cases I have not been able to ever see the function finish.I opened a ticket with Qualtrics, who gave this explanation:
The easiest and best thing would probably be to have a single error-handling function and then wrap it around each call to the qualtrics API. Below is an example of how I've done this. I don't think this is exactly the right solution though. For one, this is wrapped around the
fetch_survey
function, not the call inside the function. This works for me because I'm looping through many surveys, and if one survey fails, I can just re do the fetching on the entire thing and it's not a big deal because I'm never pulling a lot of results from any one survey.I'm also not 100% sure that this is working when used to wrap the call. I used it on @dsen6644's developmental
list_distribution_links
function. It works to get me through, but, I don't get exactly the same # of results. I think it's ultimately skipping a page rather than retrying it, and/or getting the same page twice, with the way I implemented it (see below). When it would fail, I wouldn't get a 2nd message for that iteration with "attempt 2 of 4" and I'm not sure why. In the end one df had 21,441 rows, the other had 21,444.I was expecting 21,086. After removing duplicates from each, both df's had 20,946 rows.
I'm far from an expert on error-handling so I offer this is a potential starting place but there may be some other method that is much better for utilizing within the package.
The text was updated successfully, but these errors were encountered: