Various problems on mission creation and video
Closed this issue · 1 comments
MV88 commented
Testing the POST for missions I found something to fix
- At the moment the filename of the .zip must be equal to the filename of the .avi
here the related stack trace
api_1 | Traceback (most recent call last):
api_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 492, in dispatch
api_1 | response = handler(request, args, *kwargs)
api_1 | File "/code/service/views.py", line 87, in create
api_1 | video_file = storage_manager.get_video_file()
api_1 | File "/code/service/utils/storage_handler.py", line 58, in get_video_file
api_1 | return open(file_path, 'rb')
api_1 | FileNotFoundError: [Errno 2] No such file or directory: '/code/data/872a244d-ec78-4ec4-a7b2-30b709302f69/missionFiles/missionFiles.avi'
the response returned from a correct post request has some missing data
/assets/872a244d-ec78-4ec4-a7b2-30b709302f69/missions/
- in mission_video the fps is null
- name is not taken from formdata
- note and description are null
- video_file has a partial url (this happen also in the /missions endpoint)
this is the full response without all the points in the geometry for being short:
{
"created": {
"id": "4f22393d-fd7e-4d34-baa0-c05b7c3585e7",
"created": "2019-05-30T15:16:58.567263Z",
"name": "Mission_2019-05-30 15:16:58.465845",
"description": null,
"note": null,
"geometry": {
"type": "LineString",
"coordinates": [
[
10.4374221,
43.6524748
], // omitting other points
]
},
"asset": "872a244d-ec78-4ec4-a7b2-30b709302f69",
"mission_video": {
"width": 1024,
"height": 768,
"video_file": "data/6fb07cff-ce54-470b-afb4-22423f7a7125/Colibri_lun_nov_5_15_38_48_2018_GMT.avi",
"fps": null,
"mime_type": "video/mp4"
},
"modified": "2019-05-30T15:16:58.983711Z"
},
"task": {
"type": "CONVERSION",
"task_uuid": "b0a611e8-5e6e-4531-8b9f-b9d477783a2f"
}
}
- then when doing the GET request the fps and video_file (url) are returned correctly, i.e. fps is not null and video_url is not relative
/assets/872a244d-ec78-4ec4-a7b2-30b709302f69/missions/3739c40e-d6ba-4e3e-96f7-4c2dad6f5c95/
{
"id": "3739c40e-d6ba-4e3e-96f7-4c2dad6f5c95",
"created": "2019-05-30T14:29:31.025412Z",
"name": "Mission_2019-05-30 14:29:30.975814",
"description": null,
"note": null,
"geometry": {
"type": "LineString",
"coordinates": ......
},
"asset": "872a244d-ec78-4ec4-a7b2-30b709302f69",
"mission_video": {
"width": 1024,
"height": 768,
"video_file": "http://164.132.80.75:8081/assets/872a244d-ec78-4ec4-a7b2-30b709302f69/missions/3739c40e-d6ba-4e3e-96f7-4c2dad6f5c95/data/6f2822a2-f830-4666-a12a-c82ad1d250c7/Colibri_lun_nov_5_15_38_48_2018_GMT_Tg9z3AE.mp4",
"fps": 35.0,
"mime_type": "video/mp4"
},
"modified": "2019-05-30T14:29:31.426995Z"
}
- here trying to access the video_file from the browser says not found
it seems that /data endpoint does not exist...
/assets/872a244d-ec78-4ec4-a7b2-30b709302f69/missions/3739c40e-d6ba-4e3e-96f7-4c2dad6f5c95/data
- not sure is intended but the /video endpoint it is working :
/assets/872a244d-ec78-4ec4-a7b2-30b709302f69/missions/4f22393d-fd7e-4d34-baa0-c05b7c3585e7/video
other related error handling
- when the endpoint does not exist is better to return a 404 error, with a message "asset|video|video.... with this id: not found
petrus7 commented
- in mission_video the fps is null - is null after ingestion, we can obtain this values in post processing. it will be exposed again in mission detail endpoint. ill hide all values which are not instantly obtained they are only reachable trough detail endpoint
2)it seems that /data endpoint does not exist... yes this endpoint does not exist