-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Key not found in metadata when exporting with PyCAP #62
Comments
Hi rrkell01, sorry about this issue. Since it only occurs for one server, this is most likely related to the version of REDCap on that server. You may be able to skirt the issue by using |
Thanks for the quick reply. Lazy didn’t work either, got unexpected keyword argument. Also, my servers are all of the same version. We upgrade them at the same time. I will keep working on it. It must be something weird about the configuration of that one server. I appreciate your help. Thanks, From: Scott Burns [mailto:notifications@github.com] Hi rrkell01, sorry about this issue. Since it only occurs for one server, this is most likely related to the version of REDCap on that server. You may be able to skirt the issue by using p = Project(URL, API_KEY, lazy=True) which defers loading the metadata about the project. — |
@rrkell01 If you're getting a message about an unexpected keyword argument its possible that you're using an older version of pycap. Try installing pycap from github (as opposed to PyPi) and it might solve your issue. I also realize this issue is a bit old so you may have moved on. |
/me really needs to push a new version to pypi :( |
I am exporting data from one of my REDCap projects. On the statement: project = Project(URL, TOKEN), I get a message "Exporting metadata failed. Check your URL and token.". This is only happening within my server-side script running as a cgi file. When I run the script as filename.py in the interpreter, I receive no error. I am using cgi in the server-side script, and I've verified that it is not the issue. I've also tried using project = Project(URL, TOKEN, lazy=True). However, it does not mitigate the problem. Could this be a similar problem to @rrkell01? |
Did you hard-code the URL and TOKEN in your cgi script? Are you sure there isn't some firewall setting preventing the request from your server? It's just odd that it works in the interpreter (on your laptop or desktop I presume?) but not in the cgi script. |
I just started getting this error on the same statement in a python script that had been working previously. The lazy parameter does bypass this particular error, but instead I find that the project object that gets created seems empty despite clearly having data when viewed through the REDCap web app. All projects have the same problem. Any advice? |
Can you verify you're using the correct token? The lazy argument stops API calls when instantiating a Assuming you haven't changed the installation of PyCap, it appears to not be a code change on pycap's part but perhaps how you're calling PyCap, ie w/ the wrong token? |
The script was working previously with the same tokens, and nothing changed on that front. I did just try copy/pasting again to be sure, and regenerating/replacing a new token, but no change in errors. Thanks for the quick response! |
Are you aware of if your REDCap server has made any upgrades recently? |
Yes, I actually just heard back from the server admin who said they made security upgrades recently and that unless PyCap has an update, I probably have to find an alternative :( |
Assuming the API still works at this site, can you help me understand how the API has changed? I don't work with REDCap at all anymore so I'll need a little help digging into what's going on at this particular site. |
@cstasko Please try to find out what the REDCap version number is, whether it's a Standard or LTS release, and if the server admin can indicate if they've recently upgraded. There was a major LTS release that just came out which may have influenced your API calls. |
I believe it's version 8.5.24. Not sure about Standard/LTS; will find out. Thanks for the help -- I've got a fair amount riding on the ETL scripts I already wrote with PyCap. |
@cstasko what institution are you at? |
@remifrazierucsf Massachusetts General Hospital / Partners Health System |
@cstasko yeah you're on 8.5.24. I was somewhat hopeful that you happened to be on 8.5.23, which had a show-stopping API error. But the 8.5.24 release was the bugfix for that. This seems most likely to be an issue the local admins should help you with. There hasn't been a foundational shift in how the API delivers data - there are some new things you can pull out -- but we haven't received any reports of backward compatibility issues from our rather large base of automators at UCSF. If your local admins made a change to break the API though that's a different thing. Have you tried verifying a similar query is well-behaved in the API playground? |
@remifrazierucsf Nevermind, it seems like the issue was just that I didn't update the url for the new release. I'll test everything thoroughly tomorrow to confirm. Thanks for you help! |
Double-check that – depending on how your institution is operating, legacy version URLs should be universally back-compatible. So unless the central team there explicitly broke that, I would suggest you do some really robust testing.
From: cstasko [mailto:notifications@github.com]
Sent: Wednesday, January 16, 2019 3:05 PM
To: redcap-tools/PyCap <PyCap@noreply.github.com>
Cc: Frazier, Remi <Remi.Frazier@ucsf.edu>; Mention <mention@noreply.github.com>
Subject: Re: [redcap-tools/PyCap] Key not found in metadata when exporting with PyCAP (#62)
@remifrazierucsf<https://github.com/remifrazierucsf> Nevermind, it seems like the issue was just that I didn't update the url for the new release. I'll test everything thoroughly tomorrow to confirm. Thanks for you help!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#62 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AbyWnPPvvSGNdAxO2ulO6qdkid-pt2iOks5vD6_-gaJpZM4GTD5_>.
|
Seems like we're all good then? For now at least :)
@remifrazierucsf this makes my heart happy, glad you've found it helpful. |
Yeah, I learned that we have a a static URL I hadn't been using. After updating that parameter, all my testing looks good. Thanks again! |
I am exporting data from one of our REDCap servers. On the statement: p = Project(URL, API_KEY), I get a message "key not found in metadata". This is only happening on one server - it works on my other REDCap instances. I also used the PHP version of the API published by Vandy and it worked.
The text was updated successfully, but these errors were encountered: