Panopto's sample upload code seems to be broken.
Hi —
I'm trying to use Panopto's sample code to upload videos via the API.
Code repository: https://github.com/Panopto/upload-python-sample/tree/master/simplest
When I run the script, it appears to upload successfully, but then it gets stuck in a loop checking the status. The status is always "3" (processing). When I asked with Panopto support why my videos were stuck processing, they told me that no media had been uploaded.
The output of the script is below. Why is this not working?
—Colin
Calling POST PublicAPI/REST/sessionUpload endpoint
ID: a0e8247a-bae6-468d-ba39-b30e00dba227
target: https://harvard.hosted.panopto.com/Panopto/Upload/dd5cd4dc-2547-4cc4-bac4-b30e00dba227
Upload ../test.mp4 with multipart upload protocol
endpoint URL: https://harvard.hosted.panopto.com/Panopto
bucket name : Upload
object key : dd5cd4dc-2547-4cc4-bac4-b30e00dba227/test.mp4
-- 1030158 of 1030158 bytes uploaded
-- complete called.
Writing manifest file: upload_manifest_generated.xml
Upload upload_manifest_generated.xml with multipart upload protocol
endpoint URL: https://harvard.hosted.panopto.com/Panopto
bucket name : Upload
object key : dd5cd4dc-2547-4cc4-bac4-b30e00dba227/upload_manifest_generated.xml
-- 550 of 550 bytes uploaded
-- complete called.
Calling PUT PublicAPI/REST/sessionUpload/a0e8247a-bae6-468d-ba39-b30e00dba227 endpoint
done
Calling GET PublicAPI/REST/sessionUpload/a0e8247a-bae6-468d-ba39-b30e00dba227 endpoint
Response: {'ID': 'a0e8247a-bae6-468d-ba39-b30e00dba227', 'Message': 'Processing', 'State': 3, 'UploadTarget': 'https://harvard.hosted.panopto.com/Panopto/Upload/dd5cd4dc-2547-4cc4-bac4-b30e00dba227', 'FolderId': '437a0000-3c7c-441e-b869-b2ed00d8e6ae', 'SessionId': '417f6131-f822-4977-915d-b30e00dba6e5'}
Calling GET PublicAPI/REST/sessionUpload/a0e8247a-bae6-468d-ba39-b30e00dba227 endpoint
Response: {'ID': 'a0e8247a-bae6-468d-ba39-b30e00dba227', 'Message': 'Processing', 'State': 3, 'UploadTarget': 'https://harvard.hosted.panopto.com/Panopto/Upload/dd5cd4dc-2547-4cc4-bac4-b30e00dba227', 'FolderId': '437a0000-3c7c-441e-b869-b2ed00d8e6ae', 'SessionId': '417f6131-f822-4977-915d-b30e00dba6e5'}
Calling GET PublicAPI/REST/sessionUpload/a0e8247a-bae6-468d-ba39-b30e00dba227 endpoint
Response: {'ID': 'a0e8247a-bae6-468d-ba39-b30e00dba227', 'Message': 'Processing', 'State': 3, 'UploadTarget': 'https://harvard.hosted.panopto.com/Panopto/Upload/dd5cd4dc-2547-4cc4-bac4-b30e00dba227', 'FolderId': '437a0000-3c7c-441e-b869-b2ed00d8e6ae', 'SessionId': '417f6131-f822-4977-915d-b30e00dba6e5'}
Calling GET PublicAPI/REST/sessionUpload/a0e8247a-bae6-468d-ba39-b30e00dba227 endpoint
Response: {'ID': 'a0e8247a-bae6-468d-ba39-b30e00dba227', 'Message': 'Processing', 'State': 3, 'UploadTarget': 'https://harvard.hosted.panopto.com/Panopto/Upload/dd5cd4dc-2547-4cc4-bac4-b30e00dba227', 'FolderId': '437a0000-3c7c-441e-b869-b2ed00d8e6ae', 'SessionId': '417f6131-f822-4977-915d-b30e00dba6e5'}
Answers
Hello Colin,
I inspected the data you gave and found that the file you were uploading seems to be stuck in a "Processing" state infinitely. The script is giving you the correct information about the status of your file upload. It should exit from the loop checking status once you get a "200 OK" HTTP response.
As for the reason it got stuck in a "Processing" state, the file upload might have broken halfway through which is why it did not succeed. I recommend retrying with a different ID and checking the result.
Thank you.
- Aish
Hi Colin,
Current python sample upload application doesn't work with the latest version of python.
You can downgrade using virtual environment, and try again.
In the meantime there will be a new version of the app that supports latest python version.
I hope this helps.
Thanks,
Adis
I was not actually using the latest version of Python — I was using 3.12. But I tried downgrading to Python 3.10 and I got the exact same result. I don't think this has anything to do with the Python version.
The output of the script shows successful uploads of both the MP4 file and the manifest file.
Are there any Panopto engineers reading this forum who can help explain what's really going on?
Hi Colin,
I'm the engineer form Panopto, can you please try with 3.7 version? That is the version that works, and I'm not sure about the later versions.
If that doesn't work, create a support ticket and we will take a look at it together in a meeting session.
Thanks,
Adis
3.7?!?!?! The last release of 3.7 was in 2022! I don't want to download an unsupported version of Python onto my machine. When will Panopto have a version of the script that works with a currently-supported version of Python?
Also — the uploading portion of the script appears to complete successfully. Both the media and manifest files are successfully uploaded to Panopto. It seems that the problem is on the Panopto end; you're failing to process the uploaded media for some reason, and your system is failing to provide any useful error message or debugging information.
Hi Colin,
The sample has not been updated for some time, and it doesn't work with the latest version of python. I think the problem is with boto3 library adding checksum headers in the newer versions of python.
We hope to have a new version of the sample app soon.
Thanks,
Adis
Is there any plan for Panopto to modify your service to actually accept the checksum headers? They sound like a good idea to ensure the validity of the upload.
Hi Colin,
I think that will be taken into consideration, in the meantime we will fix the sample to not include the checksum so we don't fail processing on the server.
Thanks,
Adis