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

socket.error: [Errno 104] Connection reset by peer #111

Closed
MarvinBeym opened this issue May 14, 2016 · 30 comments
Closed

socket.error: [Errno 104] Connection reset by peer #111

MarvinBeym opened this issue May 14, 2016 · 30 comments

Comments

@MarvinBeym
Copy link

MarvinBeym commented May 14, 2016

100% |###############################################| Time: 0:15:49 987.0 KiB/s
Traceback (most recent call last):
File "/usr/local/bin/youtube-upload", line 10, in
main.run()
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/main.py", line 251, in run
sys.exit(lib.catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/lib.py", line 39, in catch_exceptions
fun(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/main.py", line 246, in main
run_main(parser, options, args)
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/main.py", line 178, in run_main
video_id = upload_youtube_video(youtube, options, video_path, len(args), index)
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/main.py", line 140, in upload_youtube_video
request_body, progress_callback=progress.callback)
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/upload_video.py", line 40, in upload
RETRIABLE_EXCEPTIONS, max_retries=max_retries)
File "/usr/local/lib/python2.7/dist-packages/youtube_upload/lib.py", line 75, in retriable_exceptions
raise exc
socket.error: [Errno 104] Connection reset by peer

Uploading from Raspberry pi over the night after looking if its finished this error appierd

@MarvinBeym MarvinBeym changed the title Error after/while Upload socket.error: [Errno 104] Connection reset by peer May 14, 2016
@emmtte
Copy link

emmtte commented May 14, 2016

Same for me, sometimes it's appens.
I've write a bash script to restart upload when error came.

https://github.com/ManuCart/RaspberryPi/blob/master/scripts/youtube-upload

@MarvinBeym
Copy link
Author

doesnt really help when you only have 16k internet speed (100kbit/s Upload)
I need the hole night to upload and if it fails ....

@tokland
Copy link
Owner

tokland commented May 14, 2016

Please try with chunksize=-1 (upload_video.py, function updoad)

@MarvinBeym
Copy link
Author

ok i will try this when im back home,
but im also getting Problems with Google. Im getting E-mails from Google that a login was blocked everytime i start the upload

@pinoepel
Copy link

pinoepel commented May 17, 2016

I use my Diskstation with this script, DonnerPlays and ManuCart too?

Same with chunksize=-1:

My upload.sh:

#!/usr/bin/python
#!/bin/bash

cd /volume1/photo/youtube-upload-master

youtube-upload --title="01" --description="PLAYLIST" --category=Gaming --tags="Lets Play,letsplay,Review,Walkthrough,German,Deutsch,Gameplay,Kommentiertes Spiel" --default-language="de" --default-audio-language="de" /volume1/photo/youtube/mp4/01.mp4
mv /volume1/photo/youtube/mp4/01.mp4 /volume1/photo/youtube/hochgeladen

My log:

Using client secrets: /usr/share/youtube_upload/client_secrets.json
Using credentials file: /root/.youtube-upload-credentials.json
Using category: Gaming (id=20)
Start upload: /volume1/photo/youtube/mp4/01.mp4
Traceback (most recent call last):
File "/bin/youtube-upload", line 10, in
main.run()
File "/usr/lib/python2.7/site-packages/youtube_upload/main.py", line 251, in run
sys.exit(lib.catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
File "/usr/lib/python2.7/site-packages/youtube_upload/lib.py", line 39, in catch_exceptions
fun(_args, *_kwargs)
File "/usr/lib/python2.7/site-packages/youtube_upload/main.py", line 246, in main
run_main(parser, options, args)
File "/usr/lib/python2.7/site-packages/youtube_upload/main.py", line 178, in run_main
video_id = upload_youtube_video(youtube, options, video_path, len(args), index)
File "/usr/lib/python2.7/site-packages/youtube_upload/main.py", line 140, in upload_youtube_video
request_body, progress_callback=progress.callback)
File "/usr/lib/python2.7/site-packages/youtube_upload/upload_video.py", line 40, in upload
RETRIABLE_EXCEPTIONS, max_retries=max_retries)
File "/usr/lib/python2.7/site-packages/youtube_upload/lib.py", line 75, in retriable_exceptions
raise exc
socket.error: [Errno 104] Connection reset by peer

@MarvinBeym
Copy link
Author

Ok i have uploaded 4 Videos since the problem, now im getting the error again, i had changed the chunksize=-1
still error...

@tokland
Copy link
Owner

tokland commented May 21, 2016

Try https://github.com/tokland/youtube-upload/tree/more-retry-exceptions , let's see if retrying solves the problem

@MarvinBeym
Copy link
Author

wait... what should i do with the link?

@tokland
Copy link
Owner

tokland commented May 21, 2016

checkout the code from that branch and try it.

@MarvinBeym
Copy link
Author

ok im dumb... will try it :)

@MarvinBeym
Copy link
Author

ok what i did was: i redownloaded the script and done [sudo python setup.py install] again, is that correct?

@tokland
Copy link
Owner

tokland commented May 21, 2016

yes

@MarvinBeym
Copy link
Author

Ok :D will try over the time and will tell you if it worked

@tokland
Copy link
Owner

tokland commented Jun 21, 2016

No feedback

@tokland tokland closed this as completed Jun 21, 2016
@roughnecks
Copy link

Hi there.
Sorry for opening this up again but I got the same issue as Donner while uploading a 2.55GB file.
I'm running a PIII with 512MB RAM and Debian 8, upload running overnight over a FTTC VDSL 30/3 Mbit/s. Internet connection is very stable but there's more: that machine is configured with a dual stack IPv4 and IPv6 via SIXXS broker, so it could be possible that the upload went trough IPv6..

Do you have any idea if that might be the problem or I should try the alternate branch you suggested earlier, before messing up with my network config?

Thanks

@tokland
Copy link
Owner

tokland commented Jul 9, 2016

@roughnecks
Copy link

As I said in the previous post, haven't tried it yet, was asking for your advice on how to continue.

I can do some tests but I'm not a youtube enthusiast, so it will probably take me some time. Feel free to close this thread again, if you feel like it.

@tokland
Copy link
Owner

tokland commented Jul 9, 2016

Sorry, didn't see it. Yes, I'd first test the commit from that branch and if this does not work, I'd play with different values of chunksize. I don't have problems uploading from my linode, I cannot reproduce.

@roughnecks
Copy link

Alright, thanks 👍

@roughnecks
Copy link

It's me again, last night I left a video uploading (using the git branch you adviced) and today I found out it had crashed again:

lab@nadir:~/clones/youtube-upload-more-retry$ python bin/youtube-upload --title="Krai Mira: Mushrooms Dreams" --privacy private /mnt/Data/lab/Temp-Scrivibile/Krai.mkv                                                                 
Using client secrets: /home/lab/.client_secrets.json
Using credentials file: /home/lab/.youtube-upload-credentials.json
Start upload: /mnt/Data/lab/Temp-Scrivibile/Krai.mkv
100% |####################################################################################################################################################################################################################| 566.08 kB/s
Traceback (most recent call last):
  File "bin/youtube-upload", line 10, in <module>
    main.run()
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/main.py", line 250, in run
    sys.exit(lib.catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/lib.py", line 39, in catch_exceptions
    fun(*args, **kwargs)
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/main.py", line 245, in main
    run_main(parser, options, args)
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/main.py", line 177, in run_main
    video_id = upload_youtube_video(youtube, options, video_path, len(args), index)
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/main.py", line 139, in upload_youtube_video
    request_body, progress_callback=progress.callback)
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/upload_video.py", line 40, in upload
    RETRIABLE_EXCEPTIONS, max_retries=max_retries)
  File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/lib.py", line 75, in retriable_exceptions
    raise exc
socket.error: [Errno 104] Connection reset by peer

@tokland
Copy link
Owner

tokland commented Jul 11, 2016

File "/home/lab/clones/youtube-upload-more-retry/bin/../youtube_upload/lib.py", line 75

Are you sure that you are using the branch version? an exception raised here it's a signal that it was an unretriable exception, but, in that branch, youtube_upload/upload_video.py has socket.error included in RETRIABLE_EXCEPTIONS.

@roughnecks
Copy link

My bad. You're right: when I cloned the repo, I went to the desired branch in github and copied the link but it cloned the master one, not sure if I did it wrong or it's just supposed to work this way.

Now I manually switched branch in terminal, will upload the same video shortly. Sorry

@roughnecks
Copy link

Alright, this time it went through just fine :-)

Excuse me, but is there an option to not publish videos when the upload is done? I saw a "delayed publication" option but I'd rather do it myself, because sometimes I need to edit my videos.

Thanks

@tokland
Copy link
Owner

tokland commented Jul 11, 2016

Ok, thanks for testing, I'll merge it to master then.

but is there an option to not publish videos when the upload is done?

See the option:

  --publish-at=datetime
                        Publish date (ISO 8601): YYYY-MM-DDThh:mm:ss.sZ

@roughnecks
Copy link

So, i just set it to some days in the future and publish it myself manually when I'm done?

@tokland
Copy link
Owner

tokland commented Jul 11, 2016

tbh it was a contribution and i've never used that option, but my understanding is that youtube will take care of publishing the video when the time arrives.

@roughnecks
Copy link

I read about that, yes, but my wish is to NOT publish at all. I need to edit vids before they are published and notifications sent to subscribers.

@tokland
Copy link
Owner

tokland commented Jul 11, 2016

Oh, I see. What about uploading the video as private and, once reviewed, set it to public?

--privacy=STRING Privacy status (public | unlisted | private)

@roughnecks
Copy link

Yes, that would do (not sure if notifications will be sent when I set it to public or upon publishing as private, but it's OK).

You can close this issue whenever you want. Thanks again for helping me out and for your nice project.

@tokland
Copy link
Owner

tokland commented Jul 11, 2016

Never tried it myself, but it should

The issue was already closed some weeks ago, I forgot to re-open it :)

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants