---
I first have to look whether testing using mechanize or watir is more sensible. I took first a look at watir but as I need to handle the answer from the paypal sandbox, maybe I have to interact with yus, etc and setup the whole test with mechanize. Or I find out how oddb-ci2 can hook directly into the paypal sandbox. Is this a security loophole or not when somebody can read my test-code and use all services from oddb-ci2?
Adding some debug-info, an email address with an Anrede in oddb-ci2's etc/oddb.yaml.
Before restarting I will take at three errors which showed up in my import_daily.
Error: NoMethodError Message: undefined method `<<' for nil:NilClass Backtrace: (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:255:in `handle_element' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:286:in `block in handle_all_children' (druby://localhost:10002) /usr/local/lib64/ruby/gems/1.9.1/gems/hpricot-0.8.6/lib/hpricot/traverse.rb:499:in `each' (druby://localhost:10002) /usr/local/lib64/ruby/gems/1.9.1/gems/hpricot-0.8.6/lib/hpricot/traverse.rb:499:in `each_child' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:285:in `handle_all_children' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:243:in `handle_element' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:286:in `block in handle_all_children' (druby://localhost:10002) /usr/local/lib64/ruby/gems/1.9.1/gems/hpricot-0.8.6/lib/hpricot/traverse.rb:499:in `each' (druby://localhost:10002) /usr/local/lib64/ruby/gems/1.9.1/gems/hpricot-0.8.6/lib/hpricot/traverse.rb:499:in `each_child' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:285:in `handle_all_children' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:236:in `handle_element' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:286:in `block in handle_all_children' (druby://localhost:10002) /usr/local/lib64/ruby/gems/1.9.1/gems/hpricot-0.8.6/lib/hpricot/traverse.rb:499:in `each' (druby://localhost:10002) /usr/local/lib64/ruby/gems/1.9.1/gems/hpricot-0.8.6/lib/hpricot/traverse.rb:499:in `each_child' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:285:in `handle_all_children' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:232:in `handle_element' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:43:in `chapter' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:89:in `block in extract' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:87:in `each' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:87:in `extract' (druby://localhost:10002) /var/www/oddb.org/ext/fiparse/src/fiparse.rb:201:in `parse_fachinfo_html' (druby://localhost:10002) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' (druby://localhost:10002) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform' (druby://localhost:10002) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' (druby://localhost:10002) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop' (druby://localhost:10002) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' /var/www/oddb.org/src/plugin/text_info.rb:107:in `parse_fachinfo' /var/www/oddb.org/src/plugin/text_info.rb:1114:in `block in parse_and_update' /var/www/oddb.org/src/plugin/text_info.rb:1078:in `each' /var/www/oddb.org/src/plugin/text_info.rb:1078:in `parse_and_update' /var/www/oddb.org/src/plugin/text_info.rb:1138:in `block (3 levels) in import_info' /var/www/oddb.org/src/plugin/text_info.rb:1137:in `each' /var/www/oddb.org/src/plugin/text_info.rb:1137:in `block (2 levels) in import_info' /var/www/oddb.org/src/plugin/text_info.rb:1136:in `each_pair' /var/www/oddb.org/src/plugin/text_info.rb:1136:in `block in import_info' /var/www/oddb.org/src/plugin/text_info.rb:1133:in `each_pair' /var/www/oddb.org/src/plugin/text_info.rb:1133:in `import_info' /var/www/oddb.org/src/plugin/text_info.rb:1341:in `block in import_swissmedicinfo_by_index' /var/www/oddb.org/src/plugin/text_info.rb:1340:in `each_pair' /var/www/oddb.org/src/plugin/text_info.rb:1340:in `import_swissmedicinfo_by_index' /var/www/oddb.org/src/plugin/text_info.rb:1395:in `import_swissmedicinfo' /var/www/oddb.org/src/util/updater.rb:525:in `block in update_notify_simple' /var/www/oddb.org/src/util/updater.rb:501:in `call' /var/www/oddb.org/src/util/updater.rb:501:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:519:in `update_notify_simple' /var/www/oddb.org/src/util/updater.rb:308:in `update_textinfo_swissmedicinfo' /var/www/oddb.org/src/util/updater.rb:193: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>' <..> failsafe rescued TypeError < StandardError 0 is not a symbol /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:122:in `respond_to?' /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:122:in `respond_to?' /var/www/oddb.org/src/util/persistence.rb:284:in `block in resolve' /var/www/oddb.org/src/util/persistence.rb:278:in `each' /var/www/oddb.org/src/util/persistence.rb:278:in `resolve' /var/www/oddb.org/src/util/persistence.rb:208:in `issue_create' /var/www/oddb.org/src/util/oddbapp.rb:112:in `block in create' /var/www/oddb.org/src/util/failsafe.rb:10:in `call' /var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe' /var/www/oddb.org/src/util/oddbapp.rb:111:in `create' /var/www/oddb.org/src/util/persistence.rb:288:in `block in resolve' /var/www/oddb.org/src/util/persistence.rb:278:in `each' /var/www/oddb.org/src/util/persistence.rb:278:in `resolve' /var/www/oddb.org/src/util/persistence.rb:256:in `issue_update' /var/www/oddb.org/src/util/oddbapp.rb:133:in `block in update' /var/www/oddb.org/src/util/failsafe.rb:10:in `call' /var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe' /var/www/oddb.org/src/util/oddbapp.rb:131:in `update' /var/www/oddb.org/src/util/oddbapp.rb:1575:in `update' /var/www/oddb.org/src/plugin/bsv_xml.rb:426:in `block in tag_end' /var/www/oddb.org/src/plugin/bsv_xml.rb:399:in `each' /var/www/oddb.org/src/plugin/bsv_xml.rb:399:in `tag_end' /usr/lib64/ruby/1.9.1/rexml/parsers/streamparser.rb:26:in `parse' /usr/lib64/ruby/1.9.1/rexml/document.rb:205:in `parse_stream' /var/www/oddb.org/src/plugin/bsv_xml.rb:1003:in `update_preparations' /var/www/oddb.org/src/plugin/bsv_xml.rb:660:in `block (2 levels) in _update' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_entry.rb:502:in `get_input_stream' /var/www/oddb.org/src/plugin/bsv_xml.rb:660:in `block in _update' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_entry_set.rb:35:in `each' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_entry_set.rb:35:in `each' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_central_directory.rb:109:in `each' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:132:in `block in foreach' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:90:in `open' /usr/local/lib64/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:131:in `foreach' /var/www/oddb.org/src/plugin/bsv_xml.rb:655:in `_update' /var/www/oddb.org/src/plugin/bsv_xml.rb:650:in `update' /var/www/oddb.org/src/util/updater.rb:248:in `block in update_bsv' /var/www/oddb.org/src/util/updater.rb:501:in `call' /var/www/oddb.org/src/util/updater.rb:501:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:246:in `update_bsv' /var/www/oddb.org/src/util/updater.rb:200: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>' <..> undefined method `values' for "array_of_type":String /var/www/oddb.org/src/model/atcclass.rb:119:in `block in packages' /var/www/oddb.org/src/model/atcclass.rb:119:in `collect' /var/www/oddb.org/src/model/atcclass.rb:119:in `packages' (eval):2:in `send' /var/www/oddb.org/src/view/drugs/csv_result.rb:433:in `block in to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:426:in `each' /var/www/oddb.org/src/view/drugs/csv_result.rb:426:in `to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:470:in `block in to_csv_file' /var/www/oddb.org/src/view/drugs/csv_result.rb:469:in `open' /var/www/oddb.org/src/view/drugs/csv_result.rb:469:in `to_csv_file' /var/www/oddb.org/src/plugin/csv_export.rb:63:in `_export_drugs' /var/www/oddb.org/src/plugin/csv_export.rb:42:in `export_drugs_extended' /var/www/oddb.org/src/util/updater.rb:102:in `block in export_oddb2_csv' /var/www/oddb.org/src/util/updater.rb:501:in `call' /var/www/oddb.org/src/util/updater.rb:501:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:100:in `export_oddb2_csv' /var/www/oddb.org/src/util/updater.rb:266:in `update_bsv_followers' /var/www/oddb.org/src/util/updater.rb:204: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>'
Got others errors, but found my original problem. Specifying the salutation worked only when passing the name of a list and not an array of lists. Fixed this and changed unit-tests accordingly. Pushed commit Allow array of lists to specify salutation
Analysing the error
Error: NotImplementedError Message: method `method_missing' called on hidden T_HASH object (0x007ffde7d3ffa8 flags=0x28 klass=0x0) Backtrace: /usr/lib64/ruby/1.9.1/csv.rb:2116:in `block in init_separators' /usr/lib64/ruby/1.9.1/csv.rb:1742:in `map' /usr/lib64/ruby/1.9.1/csv.rb:1742:in `<<' /usr/lib64/ruby/1.9.1/csv.rb:1282:in `generate_line' /var/www/oddb.org/src/view/drugs/csv_result.rb:462:in `block in to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:460:in `collect' /var/www/oddb.org/src/view/drugs/csv_result.rb:460:in `to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:470:in `block in to_csv_file' /var/www/oddb.org/src/view/drugs/csv_result.rb:469:in `open' /var/www/oddb.org/src/view/drugs/csv_result.rb:469:in `to_csv_file' /var/www/oddb.org/src/plugin/csv_export.rb:63:in `_export_drugs' /var/www/oddb.org/src/plugin/csv_export.rb:30:in `export_drugs' /var/www/oddb.org/src/util/updater.rb:92:in `block in export_oddb_csv' /var/www/oddb.org/src/util/updater.rb:501:in `call' /var/www/oddb.org/src/util/updater.rb:501:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:90:in `export_oddb_csv' /var/www/oddb.org/src/util/updater.rb:265:in `update_bsv_followers' /var/www/oddb.org/src/util/updater.rb:204: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>' /usr/lib64/ruby/1.9.1/csv.rb:2116:in `block in init_separators': method `method_missing' called on hidden T_HASH object (0x007ffde7d3ffa8 flags=0x28 klass=0x0) (NotImplementedError) from /usr/lib64/ruby/1.9.1/csv.rb:1742:in `map' from /usr/lib64/ruby/1.9.1/csv.rb:1742:in `<<' from /usr/lib64/ruby/1.9.1/csv.rb:1282:in `generate_line' from /var/www/oddb.org/src/view/drugs/csv_result.rb:462:in `block in to_csv' from /var/www/oddb.org/src/view/drugs/csv_result.rb:460:in `collect' from /var/www/oddb.org/src/view/drugs/csv_result.rb:460:in `to_csv' from /var/www/oddb.org/src/view/drugs/csv_result.rb:470:in `block in to_csv_file' from /var/www/oddb.org/src/view/drugs/csv_result.rb:469:in `open' from /var/www/oddb.org/src/view/drugs/csv_result.rb:469:in `to_csv_file' from /var/www/oddb.org/src/plugin/csv_export.rb:63:in `_export_drugs' from /var/www/oddb.org/src/plugin/csv_export.rb:30:in `export_drugs' from /var/www/oddb.org/src/util/updater.rb:92:in `block in export_oddb_csv' from /var/www/oddb.org/src/util/updater.rb:501:in `call' from /var/www/oddb.org/src/util/updater.rb:501:in `wrap_update' from /var/www/oddb.org/src/util/updater.rb:90:in `export_oddb_csv' from /var/www/oddb.org/src/util/updater.rb:265:in `update_bsv_followers' from /var/www/oddb.org/src/util/updater.rb:204:in `run' from jobs/import_daily:13:in `block in <module:Util>' from /var/www/oddb.org/src/util/job.rb:40:in `call' from /var/www/oddb.org/src/util/job.rb:40:in `run' from jobs/import_daily:12:in `<module:Util>' from jobs/import_daily:11:in `<module:ODDB>' from jobs/import_daily:10:in `<main>'
Adding some debug info and running import_bsv_followers. Now it completed successfully the generating the files.
Pushed commit Separate invoice_from e-mail address
On June first the BAG-Import did not run, even when the downloaded file had a different size.
Adding some more debug output (adding markers bsv_xml and size of files to compare) to bsv_xml to track, why we got the following entries in log/oddb/debug/2014/06.log
2014-06-01 09:21:10 CEST return_value_update_bsv=nil 2014-06-02 09:22:25 CEST return_value_update_bsv=nil
Found more entries
2014-06-01 09:21:02 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb: 281 skip writing /var/www/oddb.org/data/xls/Packungen-2014.06.01.xlsx as /var/www/oddb.org/data/xls/Packungen-latest.xlsx is 2674915 bytes. Returning latest 2014-06-01 09:21:02 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb: 53 update target nil 2014-06-01 09:21:02 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb: 96 update return false as target is nil 2014-06-01 09:21:02 CEST getin update_bsv 2014-06-01 09:21:09 CEST getin BsvXmlPlugin.update 2014-06-01 09:21:09 CEST target_url = http://bag.e-mediat.net/SL2007.Web.External/File.axd?file=XMLPublications.zip 2014-06-01 09:21:09 CEST save_dir = /var/www/oddb.org/data/xml 2014-06-01 09:21:09 CEST getin download_file 2014-06-01 09:21:10 CEST save_file = /var/www/oddb.org/data/xml/XMLPublications-2014.06.01.zip 2014-06-01 09:21:10 CEST latest_file = /var/www/oddb.org/data/xml/XMLPublications-latest.zip 2014-06-01 09:21:10 CEST File.exists?(/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = true 2014-06-01 09:21:10 CEST FileUtils.compare_file(/var/www/oddb.org/data/xml/XMLPublications-2014.06.01.zip, /var/www/oddb.org/data/xml/XMLPublications-latest.zip) = true 2014-06-01 09:21:10 CEST path = nil 2014-06-01 09:21:10 CEST return_value_BsvXmlPlugin.update = nil 2014-06-01 09:21:10 CEST return_value_update_bsv=nil
Pushed commit More logging for BAG-xml abd pulled it to thinpower.
Also locally I got a nasty segmentation fault when running import_daily. See Attach:segmentation_fault.txt.
Trying to resolve this problem by changing in package.rb cmp = company) && cmp.name
by company.name if company
. Restarting import_daily after restoring latest to previous value.
Using a specified reply_to address for all e-mails. See commit Specify reply_to address