Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 395027 - [SOLVED] app-text/calibre-0.8.30 fails to retrieve news feeds
Summary: [SOLVED] app-text/calibre-0.8.30 fails to retrieve news feeds
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Zac Medico
URL: http://www.mobileread.com/forums/show...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-12-17 04:01 UTC by Thomas Nichols
Modified: 2011-12-29 01:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
log downloaded from pastebin (calibre_log_-_0.8.30.txt.xz,24.34 KB, application/octet-stream)
2011-12-17 06:06 UTC, Zac Medico
Details
show debug info for "Bad image file" log message (debug.patch,1.56 KB, patch)
2011-12-17 18:56 UTC, Zac Medico
Details | Diff
calibre debug log for patched 0.8.32 on fetching BBC news (calibre-debug-log-patched-0.8.32.txt,246.00 KB, text/plain)
2011-12-28 22:08 UTC, Thomas Nichols
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Nichols 2011-12-17 04:01:59 UTC
Calibre 0.8.30 fails to download a BBC news feed, while 0.8.12 works ok. The calibre developers were informed of the issue:
http://www.mobileread.com/forums/showthread.php?p=1882155&posted=1#post1882155
and suggested using their binary install instead of ebuilds.

The Calibre log for the failed attempt (using the ""BBC News - Fast" recipe) is at
http://pastebin.com/ABDiKAxH

-- Thomas

# emerge --info
Portage 2.1.10.40 (default/linux/amd64/10.0, gcc-4.4.5, glibc-2.13-r4, 2.6.38-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.38-gentoo-r6-x86_64-Intel-R-_Xeon-R-_CPU_W3503_@_2.40GHz-with-gentoo-2.0.3
Timestamp of tree: Fri, 16 Dec 2011 23:15:01 +0000
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.4.5, 4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.virginmedia.com/ http://mirror.bytemark.co.uk/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 bash-completion berkdb bzip2 cdr cli cracklib crypt cups cxx dri dvd dvdr emacs fortran gdbm gpm iconv ipv6 kde mime mmx modules mudflap multilib ncurses nls nptl nptlonly opengl openmp pam pcre pppd qt4 readline ruby samba session sockets sse sse2 ssl svg sysfs tcpd truetype udev unicode usb vhosts xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse virtualbox wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zac Medico gentoo-dev 2011-12-17 06:06:42 UTC
Created attachment 296101 [details]
log downloaded from pastebin

The tail of the attached log:

Cleaning up manifest...
Trimming unused files from manifest...
Creating MOBI Output...
Generating in-line TOC...
Applying case-transforming CSS...
Parsing manglecase.css ...
Parsing tocstyle.css ...
Rasterizing SVG images...
Converting XHTML to Mobipocket markup...
Invalid image: mastheadImage.jpg
Converting TOC for MOBI periodical indexing...
Using mastheadImage supplied in manifest...
Serializing images...
Bad image file 'mastheadImage.jpg'
Traceback (most recent call last):
File "/usr/bin/calibre-parallel", line 19, in <module>
sys.exit(main())
File "/usr/lib64/calibre/calibre/utils/ipc/worker.py", line 187, in main
result = func(*args, **kwargs)
File "/usr/lib64/calibre/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert
plumber.run()
File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 1087, in run
self.opts, self.log)
File "/usr/lib64/calibre/calibre/ebooks/mobi/output.py", line 178, in convert
writer(oeb, output_path)
File "/usr/lib64/calibre/calibre/ebooks/mobi/writer2/main.py", line 74, in __call__
return self.dump_stream(oeb, stream)
File "/usr/lib64/calibre/calibre/ebooks/mobi/writer2/main.py", line 87, in dump_stream
self.generate_content()
File "/usr/lib64/calibre/calibre/ebooks/mobi/writer2/main.py", line 96, in generate_content
self.generate_images()
File "/usr/lib64/calibre/calibre/ebooks/mobi/writer2/main.py", line 212, in generate_images
raise ValueError('Failed to find masthead image in manifest')
ValueError: Failed to find masthead image in manifest
Comment 2 Zac Medico gentoo-dev 2011-12-17 18:56:59 UTC
Created attachment 296155 [details, diff]
show debug info for "Bad image file" log message

If you can reproduce the problem with this patch applied, then hopefully it will produce some more useful debugging info for that "Bad image file" log message. Save as /tmp/debug.patch and apply as follows:

  patch /usr/lib64/calibre/calibre/ebooks/mobi/writer2/main.py /tmp/debug.patch
Comment 3 Thomas Nichols 2011-12-28 22:08:08 UTC
Created attachment 297251 [details]
calibre debug log for patched 0.8.32 on fetching BBC news
Comment 4 Zac Medico gentoo-dev 2011-12-28 22:32:09 UTC
The output is a little bit out of order due to output buffering quirks. If we put it in order, it will look like this:

Rasterizing SVG images...
Converting XHTML to Mobipocket markup...
Invalid image: mastheadImage.jpg
Converting TOC for MOBI periodical indexing...
Using mastheadImage supplied in manifest...
Serializing images...
Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/ebooks/mobi/writer2/main.py", line 184, in generate_images
    data = rescale_image(item.data)
  File "/usr/lib64/calibre/calibre/ebooks/mobi/utils.py", line 136, in rescale_image
    data = save_cover_data_to(data, 'img.jpg', return_data=True)
  File "/usr/lib64/calibre/calibre/utils/magick/draw.py", line 71, in save_cover_data_to
    img = _data_to_image(data)
  File "/usr/lib64/calibre/calibre/utils/magick/draw.py", line 20, in _data_to_image
    img.load(data)
  File "/usr/lib64/calibre/calibre/utils/magick/__init__.py", line 132, in load
    return _magick.Image.load(self, data)
Exception: no decode delegate for this image format `' @ error/blob.c/BlobToImage/347
Bad image file 'mastheadImage.jpg'

If you post the above info to that mobileread forum thread, then Kovid might have an idea about what's going wrong and how to fix it.
Comment 5 Thomas Nichols 2011-12-28 23:03:18 UTC
Ok, applied the patch 296155 (to 0.8.32 install, it applies cleanly) and in the calibre gui log I get the output in 297251:
https://bugs.gentoo.org/attachment.cgi?id=297251

FWIW I see that /usr/lib64/calibre/calibre/web/feeds/news.py refers to mastheadImage.jpg, which is not in /usr/share/calibre/ -- other code refers to mastheadImage.gif, which *is* present.

$ find /usr/share/calibre/ -name 'masthead*'
/usr/share/calibre/catalog/mastheadImage.gif

In case it's relevant, I have imagemagick installed, but not pythonmagick -- is that as expected?

Thanks,
Thomas

$ eix -I magick
[I] media-gfx/imagemagick
     Available versions:  6.7.1.0!u ~6.7.4.0!u {X autotrace bzip2 (+)corefonts cxx djvu fftw fontconfig fpx graphviz gs hdri jbig jpeg jpeg2k lcms lqr lzma opencl openexr openmp pango perl png q32 q64 q8 raw static-libs svg tiff truetype video_cards_nvidia webp wmf xml zlib}
     Installed versions:  6.7.1.0(04:14:48 12/27/11)(X bzip2 corefonts cxx openmp svg truetype xml zlib -autotrace -djvu -fftw -fontconfig -fpx -graphviz -gs -hdri -jbig -jpeg -jpeg2k -lcms -lqr -lzma -opencl -openexr -perl -png -q32 -q64 -q8 -raw -static-libs -tiff -webp -wmf)
     Homepage:            http://www.imagemagick.org/
     Description:         A collection of tools and libraries for many image formats
Comment 6 Zac Medico gentoo-dev 2011-12-28 23:09:39 UTC
(In reply to comment #5)
> In case it's relevant, I have imagemagick installed, but not pythonmagick -- is
> that as expected?

You don't need pythonmagick because calibre has a built-in imagemagick binding, which it installs as /usr/lib/calibre/calibre/plugins/magick.so.
Comment 7 Thomas Nichols 2011-12-28 23:45:39 UTC
(In reply to comment #6)

> You don't need pythonmagick because calibre has a built-in imagemagick binding,
> which it installs as /usr/lib/calibre/calibre/plugins/magick.so.

Since this magick.so depends on libMagickWand.so, owned by media-gfx/imagemagick, I'm rebuilding with jpeg support enabled, will update with status.
Comment 8 Thomas Nichols 2011-12-29 00:12:54 UTC
(In reply to comment #7)
> (In reply to comment #6)
> 
> > You don't need pythonmagick because calibre has a built-in imagemagick binding,
> > which it installs as /usr/lib/calibre/calibre/plugins/magick.so.
> 
> Since this magick.so depends on libMagickWand.so, owned by
> media-gfx/imagemagick, I'm rebuilding with jpeg support enabled, will update
> with status.


Success! 

Conclusion: need USE=jpeg for media-gfx/imagemagick

Thanks,
Thomas
Comment 9 Zac Medico gentoo-dev 2011-12-29 00:19:38 UTC
Okay, I've update the ebuild to require imagemagick[jpeg].
Comment 10 Thomas Nichols 2011-12-29 01:12:04 UTC
(In reply to comment #9)
> Okay, I've update the ebuild to require imagemagick[jpeg].

Thanks!