view · edit · sidebar · attach · print · history

Index>

20140929-fix-mail-patinfo-invoices

Summary

  • Fix Error Export: Mail Patinfo-Invoices
  • Fix Stammdaten export via paypal

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

---

Fix Stammdaten export via paypal

Again I have problem seeing where I finally land. After adding debug output I see

download_link link http://oddb-ci2.dyndns.org/de/gcc/download/email/20140929-141032%40ywesee.com/invoice/32356673/filename/oddb.csv.zip                   
data {:email=>"20140929-141032@ywesee.com", :invoice=>32356673, :filename=>"oddb.csv.zip"} value http://oddb.csv.zip
additional_download_link model.expired?
State::View::ReturnDownloads components {[0, 0]=>:download_link, [1, 0]=>:additional_download_link} 
res of ReturnDownloads is ODDB::View::PayPal::ReturnDownloads

in the spec output I see that I try to follow this link, but I get only an empty oddb.org view.

Could make pry working when accessing /de/gcc/export_csv/zone/drugs/search_query/Desitin/search_type/st_company. Stepping and debugging is much better than a few months ago and doesn't crash the ruby process as before. This opens new possibilities for tracing problems.

Also I face the problem that on ch.oddb.org I get a CSV-files (albeit only one with the headers) and on oddb-ci2 I get an http://oddb-ci2.dyndns.org/resources/errors/appdown.html. Why? Tracing request.unparsed_uri in session shows: util.session process request /de/gcc/home/ View resuls export_csv true View resuls export_csv ODDB::State::PageFacade 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/desitin/search_type/st_company de/gcc/search/zone/drugs/search_query/desitin/search_type/st_company? /de/gcc/search/zone/drugs/search_query/desitin/search_type/st_company? /de/gcc /de/gcc

If I compare the user information on oddb-ci2 and ch.oddb.org I don't see any groups which you can check. Instead it displays "Es wurden keine Einträge gefunden". Why?

Error Export: Mail Patinfo-Invoices

Found the following error-mail in my inbox:

Error: RuntimeError
Message: can't add a new key into hash during iteration
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache_entry.rb:49:in `store'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache_entry.rb:49:in `block in odba_add_reference'
<internal:prelude>:10:in `synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache_entry.rb:48:in `odba_add_reference'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:310:in `fetch_or_do'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:225:in `fetch'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:49:in `odba_receiver'
/var/www/oddb.org/src/plugin/info_invoicer.rb:26:in `block (2 levels) in active_companies'
/var/www/oddb.org/src/plugin/info_invoicer.rb:22:in `each'
/var/www/oddb.org/src/plugin/info_invoicer.rb:22:in `block in active_companies'
/var/www/oddb.org/src/plugin/info_invoicer.rb:20:in `each'
/var/www/oddb.org/src/plugin/info_invoicer.rb:20:in `active_companies'
/var/www/oddb.org/src/plugin/info_invoicer.rb:159:in `group_by_company'
/var/www/oddb.org/src/plugin/info_invoicer.rb:227:in `send_annual_invoices'
/var/www/oddb.org/src/plugin/info_invoicer.rb:15:in `run'
/var/www/oddb.org/src/util/exporter.rb:361:in `block in mail_patinfo_invoices'
/var/www/oddb.org/src/util/exporter.rb:431:in `call'
/var/www/oddb.org/src/util/exporter.rb:431:in `safe_export'
/var/www/oddb.org/src/util/exporter.rb:360:in `mail_patinfo_invoices'
/var/www/oddb.org/src/util/exporter.rb:56:in `run'
jobs/export_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/export_daily:12:in `<module:Util>'
jobs/export_daily:11:in `<module:ODDB>'
jobs/export_daily:10:in `<main>'

Found a similar entry

But when I look at the code in src/plugin/info_invoicer.rb:26 I see that the we already iterate over a dup. items = inv.items.values.dup. But may be we should dup active_companies.push(company.odba_instance)

Analysing the code def active_companies inside InfoInvoicer I remark that it uses the same name active_companies for a local variable as well as for the method name. I wonder whether this might lead to any problems. The backtrace also shows that there is a recursion starting. Therefore I believe that we should rename the local variable active_companies to result to fix the problem.

Will try first to see whether I can reproduce the error locally on oddb-ci2. This did not work. Export completed an my debug output says:

patinfo_invoices daily 0 items
patinfo_invoices annual 18 items

Rerunning the import with my changes. In parallel downloding dbdump from thinpower.

Adding an entry into the debug log when items get invoiced.

Searching in th logfile log/oddb/debug/2014/09.log of thinpower I also see that the error vanished

2014-09-25 02:01:34 CEST safe_export Mail Patinfo-Invoices starting
2014-09-25 02:30:35 CEST safe_export Mail Patinfo-Invoices completed
2014-09-26 02:01:35 CEST safe_export Mail Patinfo-Invoices starting
2014-09-26 02:26:31 CESTlog notify Error Export: Mail Patinfo-Invoices: start outgoing process ["log"] 

2014-09-26 02:26:32 CEST Util.log_and_deliver_mail to=["ngiger@ywesee.com", "zdavatz@ywesee.com"] subject ch.ODDB.org Report - Error Export: Mail Patinfo-Invoices - 09/2014 size Error: RuntimeError
/var/www/oddb.org/src/util/exporter.rb:361:in `block in mail_patinfo_invoices'
/var/www/oddb.org/src/util/exporter.rb:360:in `mail_patinfo_invoices'
2014-09-26 02:26:36 CESTlog notify Error Export: Mail Patinfo-Invoices: sent mail
2014-09-26 02:26:36 CEST safe_export Mail Patinfo-Invoices failed

2014-09-27 06:03:50 CESTlog notify  Warning Export: patinfo.yaml: start outgoing process ["log"] 
2014-09-27 06:03:52 CEST Util.log_and_deliver_mail to=["ngiger@ywesee.com", "zdavatz@ywesee.com"] subject ch.ODDB.org Report -  Warning Export: patinfo.yaml - 09/2014 size Message: 

2014-09-28 02:01:35 CEST safe_export Mail Patinfo-Invoices starting
2014-09-28 02:31:11 CEST safe_export Mail Patinfo-Invoices completed

2014-09-29 02:01:41 CEST safe_export Mail Patinfo-Invoices starting
2014-09-29 02:32:07 CEST safe_export Mail Patinfo-Invoices completed

It looks to me that this error only appears when there a many items to be invoiced and that at least a few items get invoiced, shorting the queues to be invoiced next day. When running the newly imported I get the following output

2014-09-29 10:00:58 +0200: safe_export Mail Patinfo-Invoices starting
2014-09-29 10:09:39 +0200: patinfo_invoices annual 17/17 payable_items/items
2014-09-29 10:15:12 +0200: safe_export Mail Patinfo-Invoices completed

As the unit-tests under test/test_plugin/suite.rb passed. I push the commit Fix patinfo mail-invoice and log payable items. Pulled into thinpower, too.

view · edit · sidebar · attach · print · history
Page last modified on September 29, 2014, at 06:31 PM