stanfordnmbl / opencap-core

Main OpenCap processing pipeline
Apache License 2.0
144 stars 112 forks source link

Trying to understand why test is crashing sporadically #145

Closed antoinefalisse closed 5 months ago

antoinefalisse commented 5 months ago

@suhlrich and @AlbertoCasasOrtiz Now and then, the test is crashing with this error message:

mobilecap_1 | File "/workspace/utilsServer.py", line 460, in runTestSession mobilecap_1 | processTrial(trial["session"], trial_id, trial_type='static', isDocker=isDocker) mobilecap_1 | File "/workspace/utilsServer.py", line 155, in processTrial mobilecap_1 | writeMediaToAPI(API_URL,video_path,trial_id, tag='video-sync',deleteOldMedia=True) mobilecap_1 | File "/workspace/utils.py", line 156, in writeMediaToAPI mobilecap_1 | postFileToTrial(fullpath,trial_id,tag,device_id) mobilecap_1 | File "/workspace/utils.py", line 869, in postFileToTrial mobilecap_1 | print('server response was + ' + str(r.status_code)) mobilecap_1 | AttributeError: 'dict' object has no attribute 'status_code' mobilecap_1 | mobilecap_1 | During handling of the above exception, another exception occurred: mobilecap_1 | mobilecap_1 | Traceback (most recent call last): mobilecap_1 | File "app.py", line 35, in mobilecap_1 | runTestSession(isDocker=isDocker) mobilecap_1 | File "/workspace/utilsServer.py", line 466, in runTestSession mobilecap_1 | raise Exception('Failed status check. Stopped.') mobilecap_1 | Exception: Failed status check. Stopped.

There are two things here. First, it actually crashes because r has no status code after being converted into a json. That's an easy fix. Second, the important question is why rResult.status_code != 201 is not True. With this PR, we add a few print statements to try to understand what is going on.

suhlrich commented 5 months ago

I wonder if it is a bad idea to have multiple machines operating on the same trial. If they run status check at same time, I could potentially see something strange happening

On Mar 21, 2024, at 4:45 PM, Antoine Falisse @.***> wrote:



Merged #145https://github.com/stanfordnmbl/opencap-core/pull/145 into local-docker.

— Reply to this email directly, view it on GitHubhttps://github.com/stanfordnmbl/opencap-core/pull/145#event-12208979335, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOYGJ4GZYV35TXHFJQUQP3YZNWKRAVCNFSM6AAAAABFCMD7WOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSGIYDQOJXHEZTGNI. You are receiving this because you were mentioned.Message ID: @.***>

antoinefalisse commented 5 months ago

yeps, also what I suggested to @AlbertoCasasOrtiz. Model never crashed