Closed antoinefalisse closed 1 year ago
Copying the older issue:
Downloading sessions is not working on the dev server.
Initially, I thought the problem is that the host is hardcoded as in this example:
However, once this is solved, another error appeared. This is the new error message:
./mcserver/zipsession.py, line 188, in getSessionJson
188. session['trials'].sort(key=getCreatedAt)
And these are the variable values at that point:
getCreatedAt |The session returns invalid token
. The session value is assigned a few lines above.
182. resp = requests.get(host + "/sessions/{}/".format(session_id),
headers = {"Authorization": "Token {}".format(API_TOKEN)})
session = resp.json()
The API_TOKEN is retrieved from environment variables in the line 12 of the file:
In the server, this is retrieved from secrets, and there is only one secret called API_KEY, shared between the main server and the dev server. My guess is that this API_TOKEN is not correct for the dev server, and it is causing this to fail.
This is not a critical problem, since it is working properly in the main server, but makes impossible to test the "Download" functionality in the dev branch before merging to the main branch. This could potentially cause bugs to be propagated to the main branch.
Solved now with celery workers as long as we have celery workers running for dev
See details here: https://github.com/stanfordnmbl/opencap-api-private/issues/89