view · edit · sidebar · attach · print · history

Index>

20141007-fix-download-search-csv

Summary

  • Analysing error with Download Zulassungsinhaber Desitin

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • Fix analyses search. Eg. for Akute myeloische Leukämie. Also updating the analysis must work.

---

Analysing error with Download Zulassungsinhaber Desitin

I still don't get a CSV-file when trying to download the CSV export for Desiting. Tried http://oddb-ci2.dyndns.org/de/gcc/export_csv/zone/drugs/search_query/Desitin/search_type/st_company. Asking myself again. Why the hell don't I get a clear error message from somewhere?

Added more debug statement showed that the CSV file was constructed correctly, but that afterwards I run in another problem:

2014.10.07 10:41:43: Session::active_state ODDB::State::Drugs::Result
Session::active_state @persistent_user_input changed to {:flavor=>"gcc", :language=>"de", :drugs=>{}, :search_form=>"plus", :search_query=>"marcoumar"}
util.session process request /de/gcc/search/zone/drugs/search_query/marcoumar/search_type/st_sequence?
2014.10.07 10:41:45: Session::active_state ODDB::State::Drugs::Init
State::Drugs::Result inits
User::View::Result init
User::View::ResultComposite init
View results export_csv @model ODDB::SearchResult @lookandfeel.enabled?s true
 results export_csv ODDB::SearchResult @model ODDB::SearchResult true
View::Drugs::Result::DivExportCSV init
View::Drugs::Result::DivExportCSV new_feature Kostenlos!
View::Drugs::Result::DivExportCSV url http://oddb-ci2.dyndns.org/de/gcc/export_csv/zone/drugs/search_query/marcoumar/search_type/st_sequence
util.session process request /de/gcc/export_csv/zone/drugs/search_query/marcoumar/search_type/st_sequence
2014.10.07 10:41:55: Session::active_state ODDB::State::Drugs::Result
Session::active_state @persistent_user_input changed to {:flavor=>"gcc", :language=>"de", :drugs=>{}, :search_form=>"plus", :search_query=>"marcoumar", :search_type=>"st_sequence"}
State::Drugs::Result export_csv  creditable? true
State::Drugs::Result export_csv call PaymentMethod #<ODDB::SearchResult:0x00000009255ea0>
State::Drugs::PaymentMethod
State::Drugs::PaymentMethod @model #<ODDB::YusUser:0x00000007f58578> @search_query marcoumar @search_type st_sequence @result #<ODDB::SearchResult:0x00000009255ea0>
util.session process request /de/gcc
2014.10.07 10:41:57: Session::active_state ODDB::State::Drugs::PaymentMethod
State::Drugs::PaymentMethod proceed_payment credit true method "pm_invoice"
State::Drugs::PaymentMethod call RegisterInvoicedDownload @result ba_container=53065400#98886>]>], @package_count=2>
util.session process request /de/gcc
2014.10.07 10:42:02: Session::active_state ODDB::State::Drugs::RegisterInvoicedDownload
to_csv: encoding "utf-8" keys [:rectype, :barcode, :name_base, :galenic_form, :most_precise_dose, :size, :numerical_size, :price_exfactory, :price_public, :company_name, :ikscat, :sl_entry, :registration_date, :casrn, :ddd_dose, :ddd_price]
to_csv: caller /var/www/oddb.org/src/view/drugs/csv_result.rb:352:in `to_html'
  /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.6/lib/sbsm/state.rb:186:in `to_html'
  /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.6/lib/sbsm/session.rb:450:in `to_html'
  /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.6/lib/sbsm/session.rb:173:in `block in drb_process'
  <internal:prelude>:10:in `synchronize'
  /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.6/lib/sbsm/session.rb:171:in `drb_process'
  /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
  /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
  /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
  /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
  /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
to_csv: result [["Typ", "EAN-Code", "Präparat", "Galenische Form", "Stärke", "Packungsgrösse", "Numerisch", "EFP", "PP", "Zulassungsinh.", "Kat.", "SL", "Reg.Dat.", "CAS Reg.Nr.", "ATC-DDD", "TK"], ["#MGrp", "B01AA04", "Phenprocoumon"], ["#Medi", "7680193950141", "Marcoumar", "Tabletten", Quanty(3,'mg'), "25 Tablette(n)", 25, "3.08", "7.65", "MEDA Pharma GmbH", "A", "Ja", "13.08.1953", "", Quanty(3,'mg'), 0.31], ["#Medi", "7680193950301", "Marcoumar", "Tabletten", Quanty(3,'mg'), "100 Tablette(n)", 100, "10.98", "20.80", "MEDA Pharma GmbH", "A", "Ja", "13.08.1953", "", Quanty(3,'mg'), 0.21]]
to_csv: no execption returning ["Typ;EAN-Code;Präparat;Galenische Form;Stärke;Packungsgrösse;Numerisch;EFP;PP;Zulassungsinh.;Kat.;SL;Reg.Dat.;CAS Reg.Nr.;ATC-DDD;TK\n", "#MGrp;B01AA04;Phenprocoumon\n", "#Medi;7680193950141;Marcoumar;Tabletten;3 mg;25 Tablette(n);25;3.08;7.65;MEDA Pharma GmbH;A;Ja;13.08.1953;\"\";3 mg;0.31\n", "#Medi;7680193950301;Marcoumar;Tabletten;3 mg;100 Tablette(n);100;10.98;20.80;MEDA Pharma GmbH;A;Ja;13.08.1953;\"\";3 mg;0.21\n"]
util.session process request /

enters errors/down

2014.10.07 10:43:02: Session::active_state ODDB::State::Drugs::RegisterInvoicedDownload

Adding debug output to each proc in src/view/drugs/csv_result.rb. Cannot find any anomalies as to_html returns a sane value

State::View::to_html res ["Typ;EAN-Code;Präparat;Galenische Form;Stärke;Packungsgrösse;Numerisch;EFP;PP;Zulassungsinh.;Kat.;SL;Reg.Dat.;CAS Reg.Nr.;ATC-DDD;TK\n", "#MGrp;B01AA04;Phenprocoumon\n", "#Medi;7680193950141;Marcoumar;Tabletten;3 mg;25 Tablette(n);25;3.08;7.65;MEDA Pharma GmbH;A;Ja;13.08.1953;\"\";3 mg;0.31\n", "#Medi;7680193950301;Marcoumar;Tabletten;3 mg;100 Tablette(n);100;10.98;20.80;MEDA Pharma GmbH;A;Ja;13.08.1953;\"\";3 mg;0.21\n"]

But why is this not displayed? Why does it display http://oddb-ci2.dyndns.org/resources/errors/appdown.html? Could not step with pry outside of the current function. Also oddbd gets invoke from apache via DRB and pry does not support various threads. Did not find any traces in /var/log/apache2/error.log neither.

Trying again to debug the whole stuff with HttpFox and active java-script console. Did not produce any result.

The fix for this problem was very simple. The to_csv should not return an array but a string. Running the watir tests show, that the paypal checkouts do not work correctly (as a consequence of https://github.com/ngiger/oddb.org/commit/67455d1747fc517f3246bdca50c260d7dbdf6d67 Fix download of yesterday). I will fix these problems later, but I have now watir tests for all the different scenarios for checkout/download.

Pushed commits:

The following failures are still present

  1) ch.oddb.org should be possible to create a CompanyUser
  2) ch.oddb.org should be possible to checkout doctors.csv via paypal
  3) ch.oddb.org should be checkout via paypal a poweruser
  4) ch.oddb.org should return a correct link to a CSV file if the payment is okay
  5) ch.oddb.org should not download a CSV file if the payment was not accepted
  6) ch.oddb.org should be possible to find 125Dihydroxycholecalciferol via analysen
  7) ch.oddb.org should should be possible to add and delete several drugs:
     Failure/Error: @browser.text.should_not match /Actemra/
  8) ch.oddb.org should be possible to find Abacavir via Wirkstoffe

The fix for these problems was quite simple. However making the watir tests work proved to be more difficult, especially as I sometimes got Exceptions in in oddbd process. Here is one backtrace I need to analyze

ODDB-Client-Error: method `method_missing' called on terminated object (0x0000000be44c28 flags=0x0 klass=0x0)                     
NotImplementedError                                                                                                               
(druby://localhost:10000) /var/www/oddb.org/src/model/fachinfo.rb:91:in `localized_name'                                          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'                 
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:349:in `name'                                    
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:143:in `create'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:33:in `block in compose'
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `each'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `compose'         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:12:in `block in compose'     
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:10:in `each'                 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:10:in `each_with_index'      
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:10:in `compose'              
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'        
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:140:in `new'               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:140:in `create'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:33:in `block in compose'
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `each'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `compose'         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'        
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:412:in `new'                                     
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:412:in `rss_feeds_left'                          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'             
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'  
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'              
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'           
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'        
(druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:62:in `new'                                                            
(druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:62:in `content'                                            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'             
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'  
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'              
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'           
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'               
(druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:59:in `init'                                               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'        
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:245:in `new'                           
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:245:in `view'                          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:181:in `to_html'                       
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/session.rb:447:in `to_html'                     
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/session.rb:173:in `block in drb_process'        
(druby://localhost:10000) <internal:prelude>:10:in `synchronize'                                                                  
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/session.rb:171:in `drb_process'                 
(druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'                                    
(druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'                                                  
(druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'                            
(druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'                                                     
(druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'                                       
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:163:in `drb_process'                                         
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:66:in `process'                                              
/var/www/oddb.org/doc/index.rbx:21:in `<top (required)>'                                                                          
/usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `load'                                                                             
/usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `handler'                                                                          
ODDB-Client-Error: method `method_missing' called on terminated object (0x0000000be44c28 flags=0x0 klass=0x0)                     
view · edit · sidebar · attach · print · history
Page last modified on October 07, 2014, at 05:56 PM