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

Error "Failed writing body" #12

Open
mschaeuble opened this issue Feb 16, 2017 · 9 comments
Open

Error "Failed writing body" #12

mschaeuble opened this issue Feb 16, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@mschaeuble
Copy link

With some feeds (e.g. http://www.srf.ch/feed/podcast/hd/3b016ffc-afa2-466d-a694-c48b7ffe1783.xml), I get an error of the form "Failed writing body" when downloading the enclosures:

Error retrieving http://podcastsource.sf.tv/nps/-1706219814/5740.16/Inside+Bundeshaus+%E2%80%93+Ein+Volksentscheid+und+seine+Folgen/podcast/dok/2017/02/dok_20170209_200811_v_podcast_h264_q30.mp4: Failed writing body (116 != 1448)
Error downloading enclosure from http://podcastsource.sf.tv/nps/-1706219814/5740.16/Inside+Bundeshaus+%E2%80%93+Ein+Volksentscheid+und+seine+Folgen/podcast/dok/2017/02/dok_20170209_200811_v_podcast_h264_q30.mp4.
@mlj
Copy link
Owner

mlj commented Mar 1, 2017

Thanks for reporting this. The RSS feed has a bizarre length attribute for the enclosure (probably an overflow when it was generated), and this confuses castget.

<enclosure type="video/mp4" length="-1706219814" url="http://podcastsource.sf.tv/nps/-1706219814/5740.16/Inside+Bundeshaus+%E2%80%93+Ein+Volksentscheid+und+seine+Folgen/podcast/dok/2017/02/dok_20170209_200811_v_podcast_h264_q30.mp4"/>

This will be fixed in the next minor version.

@mlj mlj added this to the Release 1.2.3 milestone Mar 1, 2017
@mlj mlj added the bug label Mar 1, 2017
@mlj mlj self-assigned this Mar 1, 2017
@mschaeuble
Copy link
Author

Cool, looking forward for the next minor version :-)

@mschaeuble
Copy link
Author

Any plans when this is going to be fixed? This bug is really annoying.

@mlj
Copy link
Owner

mlj commented May 4, 2017

Looking at this again I don't think the overflow in the length attribute is the issue. These all download without problem for me with or without the fix.

Are you sure you're not simply running out of disk space? These are large files... You may also be hitting a filesystem limit. The files we're talking about here will all be larger than 2GB.

@mschaeuble
Copy link
Author

Disc space is not an issue. Filesystem used is ext4 and I'm able to download the files manually using wget, but it doesn't work castget.

@mlj
Copy link
Owner

mlj commented May 4, 2017

Can you test castget with the two previous patches applied? The last one extends the error message so that it includes the error message from the failed libc call.

@mschaeuble
Copy link
Author

mschaeuble commented May 7, 2017

Output from castget with the two patches applied:

Updating channel Einstein...

Error downloading enclosure from http://podcastsource.sf.tv/nps/-1762137687/5599.0/%C2%ABEinstein%C2%BB+auf+Kreuzfahrt/podcast/einstein/2017/05/einstein_20170504_200818_5361587_v_podcast_h264_q30.mp4.

Additionally, I figured out that this issue only happens on a machine with ARM architecture (Raspberry PI), the same version on a X86 machine works perfectly well! Any ideas?

@mschaeuble
Copy link
Author

mschaeuble commented May 7, 2017

This issue seems to be related to a 2 gb limit: The (incomplete) file written has a size of exactly 2048 mb.

A probably related question on stackoverflow: http://stackoverflow.com/questions/730709/2gb-limit-on-file-size-when-using-fwrite-in-c

@mlj
Copy link
Owner

mlj commented May 7, 2017

Great, thanks for testing this!

I'll have to experiment a bit with -D_FILE_OFFSET_BITS=64 etc. before committing this, but at least now we know what the issue is.

If you want a quick fix, it may work to recompile castget (with or without the above patches) like this:

CFLAGS=-D_FILE_OFFSET_BITS=64 ./configure && make

(remember a make clean first if you're compiling from an existing copy).

@mlj mlj modified the milestones: Release 2.0.0, Release 1.2.3 May 17, 2017
@mlj mlj modified the milestones: Release 2.0.0, Release 2.1.0 Feb 28, 2021
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

2 participants