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

read_redcap() fails with status code 500 and no error message from redcap server #193

Closed
RoselyneV opened this issue May 15, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@RoselyneV
Copy link

My code

this is my code:
library(devtools)
devtools::install_github("CHOP-CGTInformatics/REDCapTidieR")

my_token <- "xxxxxxxxxx"
url <- "https://xxxxxxxx"

data_suppertbl <- REDCapTidieR::read_redcap(url, my_token)

#Log from R studio
Error in REDCapTidieR::read_redcap():
✖ The REDCapR export operation was not successful.
! An unexpected error occured.
ℹ This means that you probably discovered a bug!
ℹ Please consider submitting a bug report here: https://github.com/CHOP-CGTInformatics/REDCapTidieR/issues.
Caused by error in redcap_read_oneshot():
! The REDCapR read/export operation was not successful. The error message was:
Run rlang::last_trace() to see where the error occurred.

#My code
rlang::last_trace()

#Log from R studio
Error in REDCapTidieR::read_redcap():
✖ The REDCapR export operation was not successful.
! An unexpected error occured.
ℹ This means that you probably discovered a bug!
ℹ Please consider submitting a bug report here: https://github.com/CHOP-CGTInformatics/REDCapTidieR/issues.
Caused by error in redcap_read_oneshot():
! The REDCapR read/export operation was not successful. The error message was:

Backtrace:

  1. └─REDCapTidieR::read_redcap(url, my_token)
  2. └─REDCapTidieR:::try_redcapr(...)_

#Question
Could the problem be due to the size of the database?

@RoselyneV RoselyneV added the bug Something isn't working label May 15, 2024
@ezraporter
Copy link
Collaborator

Thanks for the bug report! It looks like the error message from redcap_read_oneshot() got cut off. Can you try calling redcap_read_oneshot() directly and let me know the result? Should be:

REDCapR::redcap_read_oneshot(url, my_token)

@RoselyneV
Copy link
Author

RoselyneV commented May 15, 2024

The result is:

The REDCapR read/export operation was not successful. The error message was:

$data
tableau de données (data frame) avec 0 colonnes et 0 ligne

$success
[1] FALSE

$status_code
[1] 500

$outcome_message
[1] "The REDCapR read/export operation was not successful. The error message was:\n"

$records_collapsed
[1] ""

$fields_collapsed
[1] ""

$forms_collapsed
[1] ""

$events_collapsed
[1] ""

$filter_logic
[1] ""

$datetime_range_begin
[1] ""

$datetime_range_end
[1] ""

$elapsed_seconds
[1] 4.461725

$raw_text
[1] ""

@ezraporter
Copy link
Collaborator

Thanks! Unfortunately not much information in there to go off of. It seems that you're having trouble getting data from your redcap server prior to REDCapTidieR doing any real processing. You'll need to solve that issue before we can really know if changes to REDCapTidieR will help you. Here are some debugging ideas:

  1. Try REDCapR::redcap_read(url, my_token) to see if batch downloading yields any results. If the issue is the size of the data this would tell you.
  2. Try playing with the options in redcap_read_oneshot() to see if any configuration gets you data. Sometimes this reveals issues with your redcap structure or user rights that you may need to resolve.

I'm going to close this issue for now but please feel free to reopen if, for example, you find that there are additional parameters to redcap_read_oneshot() that we can expose to solve your download issue. Additionally, if you find that redcap_read() helps, let us know on the open issue we have for supporting that (#103). We'd probably give it some extra priority if we had someone who needed it 😄

@ezraporter ezraporter changed the title REDCapTidieR::read_redcap() read_redcap() fails with status code 500 and no error message from redcap server May 15, 2024
@RoselyneV
Copy link
Author

Thanks for your help

@skadauke
Copy link
Collaborator

@RoselyneV can you double check your URI? You might get a 500 error if you provide the wrong URI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants