Skip to content
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

'exceptions.UnicodeDecodeError' object has no attribute 'status_code' #134

Closed
amrutadotorg opened this issue Aug 27, 2018 · 18 comments
Closed
Assignees
Labels

Comments

@amrutadotorg
Copy link

With tuspy 0.2.3 and PyVimeo 1.0.7 I'm getting

'exceptions.UnicodeDecodeError' object has no attribute 'status_code'

@jotterbot
Copy link

We are as well (same versions).

Full trace:

Traceback (most recent call last):
  File "/usr/local/bin/vimeo_uploader.py", line 90, in <module>
    'password': VIMEO_VIDEO_PASSWORD
  File "/home/vimeouser/.local/lib/python2.7/site-packages/vimeo/upload.py", line 78, in upload
    return self.__perform_tus_upload(filename, attempt, chunk_size=chunk_size)
  File "/home/vimeouser/.local/lib/python2.7/site-packages/vimeo/upload.py", line 161, in __perform_tus_upload
    'Unexpected error when uploading through tus.'
  File "/home/vimeouser/.local/lib/python2.7/site-packages/vimeo/exceptions.py", line 91, in __init__
    super(VideoUploadFailure, self).__init__(response, message)
  File "/home/vimeouser/.local/lib/python2.7/site-packages/vimeo/exceptions.py", line 36, in __init__
    self.status_code = response.status_code
AttributeError: 'exceptions.UnicodeDecodeError' object has no attribute 'status_code'

(The 'password': VIMEO_VIDEO_PASSWORD line in our uploader is just adding a password to the uploaded video, but otherwise our code is derived from the Vimeo upload example.)

@erunion erunion added the bug label Aug 28, 2018
@erunion erunion self-assigned this Aug 28, 2018
@erunion
Copy link
Contributor

erunion commented Aug 28, 2018

I've pushed up another fix to 1.0.8, let me know if it solves that problem. You'll probably still get back Unicode exceptions, but there should be (hopefully helpful) messaging on why.

@erunion erunion closed this as completed Aug 28, 2018
@jotterbot
Copy link

Still having issues, however now I'm getting no error message at all, see Server reported: below:

$ /usr/local/bin/vimeo_uploader.py
Uploading: /home/vimeousername/Documents/Zoom/video-id-00/zoom_0.mp4
Error uploading /home/vimeousername/Documents/Zoom/video-id-00/zoom_0.mp4
Server reported:
Traceback (most recent call last):
  File "/usr/local/bin/vimeo_uploader.py", line 119, in <module>
    text="*New Video*\n"+VIMEO_URL+"\nPassword: `redacted_secret`"
NameError: name 'VIMEO_URL' is not defined

This was working in PyVimeo 1.0.5 + 1.0.6. It's like the upload operation has become async and I never get a value for VIMEO_URL before trying to use it. Or it is silently bombing out and so not setting the variable value? Or other? Not sure.

Eg.

# Get the metadata response from the upload and log out the Vimeo.com url
video_data = client.get(uri + '?fields=link').json()
VIMEO_URL = video_data['link']

Is the upload example the most current/still relevant with the latest PyVimeo version?

@erunion erunion reopened this Aug 29, 2018
@erunion
Copy link
Contributor

erunion commented Aug 29, 2018

Strange, I can't replicate.

$ python upload.py 
Uploading: /Users/ursenbachj/Desktop/VID_264410812_104045_324.mp4
672111 bytes uploaded ...
maximum upload specified(672111 bytes) has been reached
"/Users/ursenbachj/Desktop/VID_264410812_104045_324.mp4" has been uploaded to https://vimeo.com/287238264
The title and description for /videos/287238264 has been edited.
The transcode status for /videos/287238264 is: in_progress

$ pip list | grep -i pyvimeo
PyVimeo                                1.0.8      

@amrutadotorg
Copy link
Author

I'm not getting any errors but uploading fails
see:
https://vimeo.com/287241839

the file is 1.3G

@erunion
Copy link
Contributor

erunion commented Aug 29, 2018

@amrutadotorg I talked with our upload storage team, and they said that it looks as if some weird stuff went on while that video was uploading. Can you try it again?

@erunion
Copy link
Contributor

erunion commented Aug 29, 2018

Since I've mostly been testing uploads here with short videos of my dog, I gave it another go with some beefier videos and still can't replicate the async issue.

Big Buck Bunny (1080p@60fps)

Total file size of 355.9MB

$ python upload.py
Uploading: /Users/ursenbachj/Desktop/bbb_sunflower_1080p_60fps_normal.mp4
209715200 bytes uploaded ...
355856562 bytes uploaded ...
maximum upload specified(355856562 bytes) has been reached
"/Users/ursenbachj/Desktop/bbb_sunflower_1080p_60fps_normal.mp4" has been uploaded to https://vimeo.com/287261492/f2c7c1fcef
The transcode status for /videos/287261492 is: in_progress

https://vimeo.com/287261492/f2c7c1fcef

Big Buck Bunny (4k@60fps)

Total file size of 673.2MB

$ python upload.py
Uploading: /Users/ursenbachj/Desktop/bbb_sunflower_2160p_60fps_normal.mp4
209715200 bytes uploaded ...
419430400 bytes uploaded ...
629145600 bytes uploaded ...
673223862 bytes uploaded ...
maximum upload specified(673223862 bytes) has been reached
"/Users/ursenbachj/Desktop/bbb_sunflower_2160p_60fps_normal.mp4" has been uploaded to https://vimeo.com/287263494/a52bbcb89f
The transcode status for /videos/287263494 is: in_progress

https://vimeo.com/287263494/a52bbcb89f

Big Buck Bunny (native@60fps)

Total file size of 831.9MB

$ python upload.py
Uploading: /Users/ursenbachj/Desktop/bbb_sunflower_native_60fps_normal.mp4
209715200 bytes uploaded ...
419430400 bytes uploaded ...
629145600 bytes uploaded ...
831871244 bytes uploaded ...
maximum upload specified(831871244 bytes) has been reached
"/Users/ursenbachj/Desktop/bbb_sunflower_native_60fps_normal.mp4" has been uploaded to https://vimeo.com/287265665/a18e0f8016
The transcode status for /videos/287265665 is: in_progress

https://vimeo.com/287265665/a18e0f8016

Night of the Living Dead (Internet Archive)

Total file size: 4.13GB

$ python upload.py
Uploading: /Users/ursenbachj/Desktop/night_of_the_living_dead/night_of_the_living_dead.mpeg
209715200 bytes uploaded ...
419430400 bytes uploaded ...
629145600 bytes uploaded ...
838860800 bytes uploaded ...
1048576000 bytes uploaded ...
1258291200 bytes uploaded ...
1468006400 bytes uploaded ...
1677721600 bytes uploaded ...
1887436800 bytes uploaded ...
2097152000 bytes uploaded ...
2306867200 bytes uploaded ...
2516582400 bytes uploaded ...
2726297600 bytes uploaded ...
2936012800 bytes uploaded ...
3145728000 bytes uploaded ...
3355443200 bytes uploaded ...
3565158400 bytes uploaded ...
3774873600 bytes uploaded ...
3984588800 bytes uploaded ...
4127671704 bytes uploaded ...
maximum upload specified(4127671704 bytes) has been reached
"/Users/ursenbachj/Desktop/night_of_the_living_dead/night_of_the_living_dead.mpeg" has been uploaded to https://vimeo.com/287271078/27270b3d10
The transcode status for /videos/287271078 is: in_progress

It's still converting (~1hr left), but appears to have been uploaded succesfully. https://vimeo.com/287271078/27270b3d10

@amrutadotorg
Copy link
Author

amrutadotorg commented Aug 29, 2018

I tried again, the same
https://vimeo.com/287292882

my code
video_uri = v.upload(mp4_file_with_path, data = {'name': title })

@erunion
Copy link
Contributor

erunion commented Aug 29, 2018

@amrutadotorg That's really weird. I talked to our upload team about the first video you tried uploading, and they said that no data was actually transferred.

Can you send an email to our support team through https://vimeo.com/help/contact with as much information as you can about your environment, the video file, and the version of PyVimeo you're using? They should be able to better help you.

@jotterbot
Copy link

Hi Team,

Has there been any development on this? I still get the same silent failure with no error output.

eg.
Server reported:

@amrutadotorg
Copy link
Author

Good to know that I'm not the only one who has this issue.
I'm in contact with the support team. I sent them some of the info like:

"Successfully installed certifi-2018.8.24 chardet-3.0.4 future-0.16.0 idna-2.7 pyVimeo-1.0.8 requests-2.19.1 six-1.11.0 tinydb-3.11.0 tuspy-0.2.3 urllib3-1.23"

in reposnse I got

"To also verify, what version of PyVimeo and what version of tuspy are installed?"
:))))

@erunion
Copy link
Contributor

erunion commented Sep 5, 2018

@jotterbot @amrutadotorg I still haven't been able to replicate it. Can you get any more information out of the requests and responses you're receiving?

@erunion
Copy link
Contributor

erunion commented Sep 5, 2018

How are you all uploading videos through the SDK? Are these videos files on your server, or something else?

@erunion
Copy link
Contributor

erunion commented Sep 7, 2018

@jotterbot @amrutadotorg We've downgraded our tuspy requirement back to 0.2.1, and it seems to have resolved the issue.

I've tagged a new release for this, 1.0.9. Please let us know if it resolves your issues.

And the reason why I was unable to replicate it, but you all could is because I still have tuspy 0.2.1 installed, but you had 0.2.2.

@jotterbot
Copy link

jotterbot commented Sep 10, 2018

I have tried again, having updated PyVimeo to 1.0.9.

The bad news is I am still getting an error, the good news is that I at least have some error output to go on now:

Server reported: (55, 'SSL_write() returned SYSCALL, errno = 32')
(55, 'SSL_write() returned SYSCALL, errno = 32')

Possibly related to #132 (though my file is only ~200MB).

I was doing an strace on the process and noticed lots of OPEN hits too, around the time of failure. eg.

open("/home/username/.local/lib/python2.7/site-packages/certifi/cacert.pem", O_RDONLY) = 4

Not sure if this is related to the certifi package? I also noticed though that PyVimeo 1.0.9 still lists as 1.0.8 when doing pip2 install --upgrade PyVimeo:

Successfully installed PyVimeo-1.0.8 certifi-2018.8.24 chardet-3.0.4 idna-2.7 pycurl-7.43.0 requests-2.19.1 six-1.11.0 tinydb-3.11.0 tuspy-0.2.1 urllib3-1.23

Ubuntu 16.04 / Python 2.7.12

@amrutadotorg
Copy link
Author

Dear @erunion everything looks good now. Thank you.

@jotterbot
Copy link

Just as a follow up:
I upgraded from Ubuntu 16.04 to 18.04.01 and it is now working again.

Upgraded python version to : Python 2.7.15rc1.

So, happily resolved! (Though I don't think it works on 16.04).

Never figured root cause...

@erunion
Copy link
Contributor

erunion commented Sep 13, 2018

Super weird. Wonder if you were missing an SSL package of some sorts.

Glad it's resolved though.

@erunion erunion closed this as completed Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants