view · edit · sidebar · attach · print · history

Index>

20140113-hpc-error

Summary

  • Fix errors reading hpc/rss
  • Allow use of xslx files in swissmedic-diff

Commits

Index

---

Must display daily cost image

Currently the daily costs of a medicament show in http://oddb-ci2.dyndns.org/de/gcc/ddd_price/reg/31706/seq/01/pack/017/search_query/Inderal/search_type/st_sequence without an images. Clicking on such a detail leads to be unable to access anything on http://oddb-ci2.dyndns.org. Updating to the newest version of imagemagick calling sudo USE="png jpeg" imagemagick.

Looked around and found http://dev.ywesee.com/Yasu/20120301-pulver-daily-cost. Called emerge ghostscript-gpl. Augmented USE flag with jpeg png in /etc/portage/make.conf. After restarting I now have the daily costs, but the fonts are ugly! Also the Umlaut ü is not displayed correctly. See Pushed commit We need ghostscript for tageskosten

Yasuhiros Blog mentions necessity to make a logical link in /usr/share/fonts/default via sudo ln -s /usr/share/fonts/urw-fonts/ ghostscript. Problem is that in my installation the directory /usr/share/fonts/default does not exists. Creating it and restarting. This did not fix the problem.

Tried sudo emerge corefonts mkfontscale fontsproto

After running USE="png jpeg truetype" emerge imagemagick, reinstalling the rmagic gem and restarting the services the fonts looked nice. See

Fix errors reading hpc/rss

On thinpower I get the following error when running import_daily

Plugin: ODDB::RssPlugin
Error: OpenSSL::SSL::SSLError
Message: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.7/lib/net/http/persistent/ssl_reuse.rb:70:in `connect'
/usr/local/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.7/lib/net/http/persistent/ssl_reuse.rb:70:in `block in connect'
/usr/local/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/usr/local/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.7/lib/net/http/persistent/ssl_reuse.rb:70:in `connect'
/usr/local/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/usr/local/lib/ruby/1.9.1/net/http.rb:750:in `start'
/usr/local/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.7/lib/net/http/persistent.rb:768:in `reset'
/usr/local/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.7/lib/net/http/persistent.rb:503:in `connection_for'
/usr/local/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.7/lib/net/http/persistent.rb:806:in `request'
/usr/local/lib/ruby/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:258:in `fetch'
/usr/local/lib/ruby/gems/1.9.1/gems/mechanize-2.5.1/lib/mechanize.rb:407:in `get'
/var/www/oddb.org/src/plugin/rss.rb:41:in `download'
/var/www/oddb.org/src/plugin/rss.rb:111:in `block in swissmedic_entries_of'
/var/www/oddb.org/src/plugin/rss.rb:107:in `each_key'
/var/www/oddb.org/src/plugin/rss.rb:107:in `swissmedic_entries_of'
/var/www/oddb.org/src/plugin/rss.rb:149:in `update_swissmedic_feed'
/var/www/oddb.org/src/plugin/rss.rb:173:in `update_hpc_feed'
/var/www/oddb.org/src/util/updater.rb:371:in `block in update_hpc_feed'
/var/www/oddb.org/src/util/updater.rb:495:in `call'
/var/www/oddb.org/src/util/updater.rb:495:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:369:in `update_hpc_feed'
/var/www/oddb.org/src/util/updater.rb:353:in `update_swissmedic_feeds'
/var/www/oddb.org/src/util/updater.rb:189:in `run'
/var/www/oddb.org/jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
/var/www/oddb.org/jobs/import_daily:12:in `<module:Util>'
/var/www/oddb.org/jobs/import_daily:11:in `<module:ODDB>'
/var/www/oddb.org/jobs/import_daily:10:in `<main>'

When running it on my local oddb-ci2 I get a different error

Plugin: ODDB::RssPlugin
Error: NoMethodError
Message: undefined method `[]' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/plugin/rss.rb:78:in `block in extract_swissmedic_entry_from'
/var/www/oddb.org/src/plugin/rss.rb:70:in `map'
/var/www/oddb.org/src/plugin/rss.rb:70:in `extract_swissmedic_entry_from'
/var/www/oddb.org/src/plugin/rss.rb:115:in `block in swissmedic_entries_of'
/var/www/oddb.org/src/plugin/rss.rb:107:in `each_key'
/var/www/oddb.org/src/plugin/rss.rb:107:in `swissmedic_entries_of'
/var/www/oddb.org/src/plugin/rss.rb:149:in `update_swissmedic_feed'
/var/www/oddb.org/src/plugin/rss.rb:173:in `update_hpc_feed'
/var/www/oddb.org/src/util/updater.rb:371:in `block in update_hpc_feed'
/var/www/oddb.org/src/util/updater.rb:495:in `call'
/var/www/oddb.org/src/util/updater.rb:495:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:369:in `update_hpc_feed'
/var/www/oddb.org/src/util/updater.rb:353:in `update_swissmedic_feeds'
/var/www/oddb.org/src/util/updater.rb:189:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

Why the hell do I get different error messages?

  • I usually test stuff locally using sudo -u apache bundle exec jobs/job_name
    • On thinpower bundle is not installed
  • Therefore a lot of the gems have different versions (e.g. builder 2.1.2 != 3.2.2, mechanize 1.0.0 != 2.7.3)

I am in favor of using always bundle exec for all jobs to enforce using a strict defined set of rubygems.

Fixed my local problem with commit Avoid nil access when getting empty link

It seems that thinpower is still using ca-certificates from 2008. Verified by running

emerge -s ca-certificates
Searching...    
[ Results for search key : ca-certificates ]
[ Applications found : 1 ]

*  app-misc/ca-certificates
      Latest version available: 20130119
      Latest version installed: 20080809
      Size of files: 181 kB
      Homepage:      http://packages.debian.org/sid/ca-certificates
      Description:   Common CA Certificates PEM files
      License:       MPL-1.1

Zeno will run emerge --sync and update the ca-certificates. Updated also openssl to 1.0.1e. Still got the same error.

Added in src/plugin/rss.rb the following two lines

require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

Now I get on the standard output of the import_daily the following warning

                             !!!SECURITY WARNING!!!

The SSL HTTP connection to:

  www.swissmedic.ch:443

                           !!!MAY NOT BE VERIFIED!!!

On your platform your OpenSSL implementation is broken.

There is no difference between the values of VERIFY_NONE and VERIFY_PEER.

This means that attempting to verify the security of SSL connections may not
work.  This exposes you to man-in-the-middle exploits, snooping on the
contents of your connection and other dangers to the security of your data.

To disable this warning define the following constant at top-level in your
application:

  I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil

But the import continues. Import_daily did not complete, as /var/www/oddb.org/data/ did belong to user ywesee instead of apache. Corrected. Did run the sudo -u apache /usr/local/bin/bundle exec jobs/import_daily 2>&1 | tee ~/import_daily.log

I have now problems on my Gentoo oddb-ci2 to install tmail via bundle install. I get the following error

Installing tmail (1.2.7.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    /usr/bin/ruby19 extconf.rb 
creating Makefile
make
compiling tmailscanner.c
tmailscanner.c: In Funktion »mails_s_new«:
tmailscanner.c:105:9: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung [standardmäßig aktiviert]
tmailscanner.c: In Funktion »skip_japanese_string«:
tmailscanner.c:208:2: Warnung: Übergabe des Arguments 1 von »rb_enc_get«  erzeugt Ganzzahl von Zeiger ohne Typkonvertierung [standardmäßig aktiviert]
/usr/include/ruby-1.9.1/ruby/encoding.h:92:14: Anmerkung: »VALUE« erwartet, aber Argument hat Typ »struct scanner *«
linking shared-object tmailscanner.so
tmailscanner.o: In function `mails_s_new':
tmailscanner.c:(.text+0x308): undefined reference to `rb_get_kcode'
collect2: ld gab 1 als Ende-Status zurück
make: *** [tmailscanner.so] Fehler 1

Uncommented tmail in the Gemfile.

@xlsx-in-swissmedic-diffAllow? use of xslx files in swissmedic-diff

Needed only to change a few lines to adapt to different syntax of spreadsheet and RubyXL in swissmedic-diff. Pushed commit Use rubyXL for xslx files. Now running import_daily to see, whether we need to change something in oddb.org, too.

To fix problems with specifying version in two places pushed Moved VERSION to separate file

RubyXL seems not to mention all needed dependencies. Therefor pushed Added missing dependencies for rubyXL

Pushed Added test/data/Packungen-2014.xlsx to make Travis-ci pass.

Pushed call always bundle install before bundle exec

view · edit · sidebar · attach · print · history
Page last modified on January 14, 2014, at 09:47 AM