view · edit · sidebar · attach · print · history

20131104-swissindex-update

<< | Index | >>


Summary

  • errors in daily jobs

Commits

Index

--

Unit tests of odba fail

I made several commits to https://github.com/ngiger/odba to get the travis builds working. What must be investigated tomorrow is the fact that under Ruby 1.8.7 the to_yaml of stubs works but not under 2.0 nor 1.9.3.

errors in daily jobs

After the changes in the last week we have now various problems running the daily jobs

  1. update_swissmedic does not work correcty
  2. SL-Update does not work correctly
  3. swissindex-Pharma

But first I want to check whether I can move a sequence from using only on odba_store for the registration by running $reg = registration('62785'); $ikscd = '003'; $pack = $reg.sequence('01').package($ikscd); $pack.sequence=nil; $oldSeq = $reg.sequence('01'); $oldPacks=$oldSeq.packages; $oldPacks.delete($ikscd); $newSeq = $reg.sequence('02'); $newSeq.packages[$ikscd] = $pack; $newSeq.packages[$ikscd].sequence = $newSeq; $reg.odba_store;. This does not work as after restarting bin/oddbd the changes are lost, too.

Now calling odba_store on the concerned packages, too $reg = registration('62785'); $ikscd = '003'; $pack = $reg.sequence('01').package($ikscd); $pack.sequence=nil; $oldSeq = $reg.sequence('01'); $oldPacks=$oldSeq.packages; $oldPacks.delete($ikscd); $newSeq = $reg.sequence('02'); $newSeq.packages[$ikscd] = $pack; $newSeq.packages[$ikscd].sequence = $newSeq; $oldSeq.odba_store; $newSeq.odba_store; $newSeq.packages[$ikscd].odba_store; $reg.odba_store;. Changes were visible too. But after a restart of bin/oddb the changes are lost, too.

Does odba have a problem with this kind of ruby useage, where registration.packages are found by iterating over all sequences?

Running import_daily gave me the following error

Plugin: ODDB::SwissmedicPlugin
Error: NoMethodError
Message: undefined method `data_origin' for []:Array
Backtrace:
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/plugin/swissmedic.rb:471:in `block in rows_diff'
/var/www/oddb.org/src/plugin/swissmedic.rb:469:in `select'
/var/www/oddb.org/src/plugin/swissmedic.rb:469:in `rows_diff'
/usr/local/lib64/ruby/gems/1.9.1/gems/swissmedic-diff-0.1.4/lib/swissmedic-diff.rb:133:in `block in diff'
/usr/local/lib64/ruby/gems/1.9.1/gems/swissmedic-diff-0.1.4/lib/swissmedic-diff.rb:303:in `block in each_valid_row'
/usr/local/lib64/ruby/gems/1.9.1/gems/spreadsheet-0.9.0/lib/spreadsheet/worksheet.rb:144:in `block in each'
/usr/local/lib64/ruby/gems/1.9.1/gems/spreadsheet-0.9.0/lib/spreadsheet/worksheet.rb:143:in `upto'
/usr/local/lib64/ruby/gems/1.9.1/gems/spreadsheet-0.9.0/lib/spreadsheet/worksheet.rb:143:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/spreadsheet-0.9.0/lib/spreadsheet/excel/worksheet.rb:43:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/swissmedic-diff-0.1.4/lib/swissmedic-diff.rb:294:in `each_valid_row'
/usr/local/lib64/ruby/gems/1.9.1/gems/swissmedic-diff-0.1.4/lib/swissmedic-diff.rb:107:in `diff'
/var/www/oddb.org/src/plugin/swissmedic.rb:50:in `update'
/var/www/oddb.org/src/util/updater.rb:389:in `block in update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:491:in `call'
/var/www/oddb.org/src/util/updater.rb:491:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:387:in `update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:195: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>'

Adding some debug output and adding a logfile like log/swissmedic.rb/2013/11.log. Running the unit tests showed that I had to change a return parameter. Now all unit-tests in test/test_plugin/swissmedic.rb pass again.

Loaded database from thinpower und running now jobs/import_swissmedic to catch the error. After almost 15 hours the import completed. Two error mails "Errno::ETIMEDOUT: Connection timed out" were generated for "Error: Swissindex Pharma - 11/2013" and "Error: Medwin-Companies - 11/2013".

Analysing the registry 00373 I find that I get the following entries in the log

2013-11-04 12:17:50 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 811 2013-11-04 12:17:50 +0100: update_registrations iksnr '00373' seqnr 22 pack 007
2013-11-04 12:18:34 +0100: update_compositions: iksnr 00373 22 seq Mutagrip, Suspension zur Injektion opts {:create_only=>false, :date=>#<Date: 2013-11-04 ((2456601j,0s,0n),+0s,2299161j)>} cell_content haemagglutininum influenzae A (H1N1) (Virus-Stamm A/California/7/2009 (H1N1)-like: reassortant virus NYMC X-179A) 15 µg, haemagglutininum influenzae A (H3N2) (Virus-Stamm A/Victoria/361/2011(H3N2)-like: reassortant virus NYMC X-223A derived from A/Texas/50/2012) 15 µg, haemagglutininum influenzae B (Virus-Stamm B/Massachusetts/2/2012-like: B/Massachusetts/2/2012) 15 µg, natrii chloridum, kalii chloridum, dinatrii phosphas dihydricus, kalii dihydrogenophosphas, residui: formaldehydum max. 100 µg, octoxinolum-9 max. 500 µg, ovalbuminum max. 0.05 µg, saccharum nihil, neomycinum nihil, aqua ad iniectabilia q.s. ad suspensionem pro 0.5 ml.
141:2013-11-04 12:18:35 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 811 2013-11-04 12:18:35 +0100: update_registrations iksnr '00373' seqnr 22 pack 008
143:2013-11-04 12:18:36 +0100: update_compositions: iksnr 00373 22 seq Mutagrip, Suspension zur Injektion opts {:create_only=>false, :date=>#<Date: 2013-11-04 ((2456601j,0s,0n),+0s,2299161j)>, :composition=>0, :label=>nil} cell_content haemagglutininum influenzae A (H1N1) (Virus-Stamm A/California/7/2009 (H1N1)-like: reassortant virus NYMC X-179A) 15 µg, haemagglutininum influenzae A (H3N2) (Virus-Stamm A/Victoria/361/2011(H3N2)-like: reassortant virus NYMC X-223A derived from A/Texas/50/2012) 15 µg, haemagglutininum influenzae B (Virus-Stamm B/Massachusetts/2/2012-like: B/Massachusetts/2/2012) 15 µg, natrii chloridum, kalii chloridum, dinatrii phosphas dihydricus, kalii dihydrogenophosphas, residui: formaldehydum max. 100 µg, octoxinolum-9 max. 500 µg, ovalbuminum max. 0.05 µg, saccharum nihil, neomycinum nihil, aqua ad iniectabilia q.s. ad suspensionem pro 0.5 ml.

2013-11-04 20:54:44 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 152 2013-11-04 20:54:44 +0100: delete iksnr '00373' seqnr 21 pack 
2013-11-04 20:54:44 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 152 2013-11-04 20:54:44 +0100: delete iksnr '00373' seqnr 21 pack 
2013-11-04 20:56:55 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 141 2013-11-04 20:56:55 +0100: deactivate iksnr '00373' seqnr 21 pack 

Looking at http://oddb-ci.dyndns.org/de/gcc/drug/reg/00373/seq/21 there is no package in it. Sequence 21 is still shown under http://oddb-ci.dyndns.org/de/gcc/search/zone/drugs/search_query/00373/search_type/st_registration#best_result. Restarting oddb and rechecking the results. Same result. Ch

Pushed commit Updated swissmedic-diff to 0.1.4 and Fix swissmedic import

SL-Update does not work correctly

Here we have the following stack trace

Plugin: ODDB::BsvXmlPlugin
Error: NoMethodError
Message: undefined method `pharmacode' for "array_of_type":String
Backtrace:
/var/www/oddb.org/src/plugin/bsv_xml.rb:813:in `block in log_info'
/var/www/oddb.org/src/plugin/bsv_xml.rb:813:in `select'
/var/www/oddb.org/src/plugin/bsv_xml.rb:813:in `log_info'
/var/www/oddb.org/src/util/updater.rb:144:in `log_info'
/var/www/oddb.org/src/util/updater.rb:443:in `log_notify_bsv'
/var/www/oddb.org/src/util/updater.rb:251:in `block in update_bsv'
/var/www/oddb.org/src/util/updater.rb:491:in `call'
/var/www/oddb.org/src/util/updater.rb:491:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:244:in `update_bsv'
/var/www/oddb.org/src/util/updater.rb:198: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>'

It looks as if evaluating the method pharmacode on some packages does not work, as a package seems to be of type String and not Package. Checking this on my VM in bin/admin using packages.each{ |pack| $stdout.puts pack.inspect; $stdout.flush}. This takes a long time to run.

Looking for a better way inspired by the implementation of packages in oddbapp.rb. Use $errors=[];registrations.sort.each do |iksnr,reg| $stdout.puts iksnr; $stdout.flush; reg.packages.each{ |pack| next if pack.is_a?(ODDB::Package); $errors=[] << reg; $stdout.puts "ERROR: "+pack.inspect.to_s; $stdout.flush} end; $errors.size. This begins to create output fast. Found registrations with names like 9941.0,Zulassungs-Nummer. But it did not find any error on my VM. Ran the same command on thinpower. Does not find any error there, too.

Running the line which created the problem under bin/admin

ch.oddb> $pcdless = packages.select do |pac| pac.pharmacode.to_s.empty? end; $pcdless.size
-> 9681

Works okay here on my VM. Running on thinpower I get

ch.oddb> $pcdless = packages.select do |pac| pac.pharmacode.to_s.empty? end; $pcdless.size
-> 9415

Now running import_daily on my VM to see whether I can reproduce the error here.

view · edit · sidebar · attach · print · history
Page last modified on November 05, 2013, at 08:14 AM