view · edit · sidebar · attach · print · history

20130703-check-alloga-virbac-sandoz-bbmb-and-debug-invoicer-job-index-therapeutics-exporter

<< 20130708-add-oddb2xml-zurrose-option-debug-ch-oddb-org-jobs-failures | 2013 | 20130702-debug-yus-error-and-check-invoice >>


Summary

  • Check alloga, virbac and sandoz bbmb InterFace (htmlgrid)
  • Debug YDIM injection and statistics
  • Debg Exporter Plugin and Exportd

Commits / Patches

Index / Status


Debug alloga, virbac and sandoz bbmb

Checked 3 Web Interfaces.

see


Debug index therapeuticus exporetr error

This Error means, job can not connect @EXPORT_SERVER@ (exported, druby://localhost:10005).
Then I restarted oddbd and exported.

Error: DRb::DRbConnError
Message: druby://localhost:10005 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
Backtrace:
/usr/local/lib/ruby/1.9.1/drb/drb.rb:736:in `rescue in block in open'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:730:in `block in open'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:729:in `each'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:729:in `open'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1191:in `initialize'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1171:in `new'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1171:in `open'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
/var/www/oddb.org/src/plugin/csv_export.rb:160:in `export_index_therapeuticus'
/var/www/oddb.org/src/util/exporter.rb:161:in `block in export_index_therapeuticus_csv'
...

And started Exporeter job from bin/admin in screen.

  • export_index_therapeuticus_csv (index_terapeuticus.csv)
  • export_doc_csv (doctors.csv)

It works.

ywesee@thinpower /var/www/oddb.org $ RUBYOPT="" bin/admin
ch.oddb> Exporter.new(self).export_index_therapeuticus_csv
-> 30
ywesee@thinpower /var/www/oddb.org $ RUBYOPT="" bin/admin
ch.oddb> Exporter.new(self).export_doc_csv
-> 30

Then, I started as Job for E-mail notification.

  • jobs/mail_index_therapeuticus_csv
  • (There is no job for only doctors.csv)

Debug invoice statistics

Local Machine

This was patches against dbi (I took old patches).

% ruby -rrubygems -I/home/yasuhiro/.work/usr/ywesee/src/bbmb/lib bin/admin config=etc/config.yml
ch.bbmb.vetoquinol> BBMB::Util::Invoicer.run(Time.local(2009, 11, 1)..(Time.local(2010, 1, 1)))
-> /usr/local/lib/ruby/gems/1.8/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:62:in `execute': server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

link

Local time is wrong

ch.bbmb.vetoquinol> Date.today
-> 2079--1-37361
% ruby -rrubygems -e "require 'date'; p Date.today.to_s"
"2079--1-37361"

Ruby-1.8.6 with gcc 4.4 was problem.
I must use more old GCC. I have setuped VM for old glibc, but I must compile ruby-1.8.6 with old GCC (z.B. GCC 4.3)

I switched GCC 4.3.5. then

% ruby -rrubygems -e "require 'date'; p Date.today.to_s"
"2013-07-03"

link

Invoicer works

E-mail

## E-mail
Sehr geehrte Frau XXXXX

Anbei die Rechnung für Umsatzbeteiligung 01.11.2009-31.12.2009.

Besten Dank für Ihren Auftrag!

Mit freundlichen Grüssen
Zeno Davatz
043 540 05 50
Rechnung_Vétoquinol_AG_#12145,_Umsatzbeteiligung_01.11.2009-31.12.2009.pdf

## Attach
Rechnung_Vétoquinol_AG_#12145,_Umsatzbeteiligung_01.11.2009-31.12.2009.pdf
6K   View   Download  

log of YDIM

@4000000051d3a97939e7343c D, [2013-07-03T12:42:20.260780 #26215] DEBUG -- druby://localhost:58888: attempting login
@4000000051d3a97939e747c4 I, [2013-07-03T12:42:20.263823 #26215]  INFO -- root: login
@4000000051d3a97939e75764 D, [2013-07-03T12:42:20.264782 #26215] DEBUG -- root: create_invoice(68)
@4000000051d3a97939e76aec D, [2013-07-03T12:42:20.264932 #26215] DEBUG -- root: debitor 68
@4000000051d3a97939e78e14 I, [2013-07-03T12:42:20.769519 #26215]  INFO -- root: logout
@4000000051d3a97939e7a19c D, [2013-07-03T12:51:10.474214 #26215] DEBUG -- druby://localhost:42459: attempting login
@4000000051d3a97939e7b13c I, [2013-07-03T12:51:10.476450 #26215]  INFO -- root: login
@4000000051d3a97939e7c4c4 D, [2013-07-03T12:51:10.477395 #26215] DEBUG -- root: create_invoice(68)
@4000000051d3a97939e7f78c D, [2013-07-03T12:51:10.477519 #26215] DEBUG -- root: debitor 68
@4000000051d3a97939e80efc I, [2013-07-03T12:51:10.548449 #26215]  INFO -- root: logout
@4000000051d3a97939e82284 D, [2013-07-03T12:52:46.633412 #26215] DEBUG -- druby://localhost:36508: attempting login
@4000000051d3a97939e8360c I, [2013-07-03T12:52:46.635313 #26215]  INFO -- root: login
@4000000051d3a97939e845ac D, [2013-07-03T12:52:46.636173 #26215] DEBUG -- root: create_invoice(68)
@4000000051d3a97939e8c694 D, [2013-07-03T12:52:46.636217 #26215] DEBUG -- root: debitor 68
@4000000051d3a97939e8de04 I, [2013-07-03T12:52:46.706153 #26215]  INFO -- root: logout
@4000000051d3a97939e8eda4 D, [2013-07-03T13:29:55.230206 #26215] DEBUG -- druby://localhost:44933: attempting login
@4000000051d3a97939e9012c I, [2013-07-03T13:29:55.232464 #26215]  INFO -- root: login
@4000000051d3a97939e914b4 D, [2013-07-03T13:29:55.233925 #26215] DEBUG -- root: create_invoice(68)
@4000000051d3a97939e937dc D, [2013-07-03T13:29:55.234047 #26215] DEBUG -- root: debitor 68
@4000000051d3a97939e94b64 D, [2013-07-03T13:29:55.284319 #26215] DEBUG -- root: add_items(12145, Array[1], invoice)
@4000000051d3a97939e95eec D, [2013-07-03T13:29:55.284414 #26215] DEBUG -- root: invoice 12145
@4000000051d3a97939e97274 I, [2013-07-03T13:29:55.321020 #26215]  INFO -- root: logout
@4000000051d3a97939e985fc D, [2013-07-03T13:29:55.323374 #26215] DEBUG -- druby://localhost:57744: attempting login
@4000000051d3a97939e9b0f4 I, [2013-07-03T13:29:55.324996 #26215]  INFO -- root: login
@4000000051d3a97939e9c864 I, [2013-07-03T13:29:55.325868 #26215]  INFO -- root: send_invoice(12145)
@4000000051d3a97939e9d804 D, [2013-07-03T13:29:55.325962 #26215] DEBUG -- root: invoice 12145
@4000000051d3a97939e9eb8c I, [2013-07-03T13:30:02.655818 #26215]  INFO -- root: logout
@4000000051d3a97939e9ff14 D, [2013-07-03T13:32:01.766623 #26215] DEBUG -- druby://localhost:12376: attempting login
@4000000051d3a97939ea2624 I, [2013-07-03T13:32:01.768087 #26215]  INFO -- root: login
@4000000051d3a97939ea35c4 D, [2013-07-03T13:32:01.768827 #26215] DEBUG -- root: debitors
@4000000051d3a97939ea494c I, [2013-07-03T13:32:02.416922 #26215]  INFO -- root: logout
@4000000051d3a97939ea5cd4 D, [2013-07-03T13:32:23.130482 #26215] DEBUG -- druby://localhost:12376: attempting login
@4000000051d3a97939ea705c I, [2013-07-03T13:32:23.131658 #26215]  INFO -- root: login
@4000000051d3a97939ea976c D, [2013-07-03T13:32:23.132337 #26215] DEBUG -- root: invoice_infos(is_open)
@4000000051d3a97939eaaaf4 I, [2013-07-03T13:32:23.165609 #26215]  INFO -- root: logout
@4000000051d3a97939eaba94 D, [2013-07-03T13:32:23.166359 #26215] DEBUG -- druby://localhost:12376: attempting login
@4000000051d3a97939eace1c I, [2013-07-03T13:32:23.167642 #26215]  INFO -- root: login
@4000000051d3a97939eaf914 D, [2013-07-03T13:32:23.168444 #26215] DEBUG -- root: invoice_infos(is_due)
@4000000051d3a97939eb0c9c I, [2013-07-03T13:32:23.190891 #26215]  INFO -- root: logout
@4000000051d3a97939eb2024 D, [2013-07-03T13:32:23.191708 #26215] DEBUG -- druby://localhost:12376: attempting login
@4000000051d3a97939eb33ac I, [2013-07-03T13:32:23.193137 #26215]  INFO -- root: login
@4000000051d3a97939eb4734 D, [2013-07-03T13:32:23.193934 #26215] DEBUG -- root: currency_converter
@4000000051d3a97939eb6e44 I, [2013-07-03T13:32:23.194659 #26215]  INFO -- root: logout
@4000000051d3a97939eb81cc D, [2013-07-03T13:32:27.680552 #26215] DEBUG -- druby://localhost:12376: attempting login
@4000000051d3a97939eb916c I, [2013-07-03T13:32:27.681644 #26215]  INFO -- root: login
@4000000051d3a97939eba4f4 D, [2013-07-03T13:32:27.682378 #26215] DEBUG -- root: debitors
@4000000051d3a97939ebb87c I, [2013-07-03T13:32:27.716764 #26215]  INFO -- root: logout
@4000000051d3a97939ebd7bc D, [2013-07-03T13:32:47.960981 #26215] DEBUG -- druby://localhost:12376: attempting login
@4000000051d3a97939ebeb44 I, [2013-07-03T13:32:47.962233 #26215]  INFO -- root: login
@4000000051d3a97939ebfecc D, [2013-07-03T13:32:47.963103 #26215] DEBUG -- root: debitor 68
@4000000051d3a97939ec1254 I, [2013-07-03T13:32:47.969023 #26215]  INFO -- root: logout

YDIM

Debug Invoice on Production

  • 1.6.2013-30.6.2013
fastpower vetoquinol.bbmb.ch $ /usr/local/bin/ruby186/bin/ruby -rrubygems -I/usr/local/share/src/bbmb/lib/ bin/admin config=etc/config.yml 
ch.bbmb.vetoquinol> BBMB::Util::Invoicer.run(Time.local(2013, 6, 1)..(Time.local(2013, 6, 30)))
-> (druby://192.168.0.36:12375) /usr/lib64/ruby/site_ruby/1.8/ydim/server.rb:139:in `logout': undefined method `whoami' for nil:NilClass

It is strange error.

lib/bbmb/util/invoicer.rb

    def ydim_connect(&block)
      config = YDIM::Client::CONFIG
      if(path = BBMB.config.ydim_config)
        config.load(path)
      end 
      server = DRbObject.new(nil, config.server_url)
      client = YDIM::Client.new(config)
      key = OpenSSL::PKey::DSA.new(File.read(config.private_key))
      client.login(server, key)
      block.call(client)
    ensure
      client.logout if(client)  #=>
    end

lib/ydim/client.rb

    def logout
      @server.logout(@session) if(@server) #=> it has if-statement
    end 

Experiment

  • Server Address is correct (druby://xx.xx.xx.xx:12375 on Thinpower).
  • SSH Connection is corrent.
fastpower bbmb # ssh ydim-inject@xx.xx.xx.xx -i /home/bbmb/.ssh/id_dsa
Last login: Tue Jul  2 17:21:29 CEST 2013 from fastpower on ssh
ydim-inject@thinpower ~ $ pwd
/var/lib/ydim-inject/
    def ydim_connect(&block)
      config = YDIM::Client::CONFIG
      if(path = BBMB.config.ydim_config)
        config.load(path)
      end
      server = DRbObject.new(nil, config.server_url)
      client = YDIM::Client.new(config)
      key = OpenSSL::PKey::DSA.new(File.read(config.private_key))
      client.login(server, key)
      p "done!!!"
      #block.call(client)         #=> does not come here.
    ensure
      client.logout if(client)
    end

With Test script, Same result

fastpower vetoquinol.bbmb.ch $ /usr/local/bin/ruby186/bin/ruby -rrubygems -I/usr/local/share/src/bbmb/lib -I/usr/local/share/src/ydim/lib ./test.rb config=etc/config.yml 
#<DRb::DRbObject:0x7f9d54815fa8 @ref=nil, @uri="druby://192.168.0.36:12375">
(druby://192.168.0.36:12375) /usr/lib64/ruby/site_ruby/1.8/ydim/server.rb:139:in `logout': undefined method `whoami' for nil:NilClass (NoMethodError)
        from /usr/local/share/src/ydim/lib/ydim/client.rb:24:in `logout'
        from ./test.rb:82:in `connect'
        from ./test.rb:26:in `invoice'
        from ./test.rb:94

Problem 1 IP-Address for drb client.

This is selver log (Thinpower).
Client must use IP for YDIM (for response from Server. Because Server is of Thinpower.)

thinpower ydim # tail -f /service/ydim/log/main/current | tai64nlocal
2013-07-03 08:48:25.288348500 
2013-07-03 08:48:55.043457500 I, [2013-07-03T08:48:25.289169 #29964]  INFO -- AutoInvoicer: next run Thu Jul  4 02:00:00 2013, sleeping 61894 seconds
2013-07-03 08:48:55.043459500 I, [2013-07-03T08:48:25.290084 #29964]  INFO -- CurrencyUpdater: next run Thu Jul  4 02:00:00 2013, sleeping 61894 seconds
2013-07-03 08:48:55.043460500 I, [2013-07-03T08:48:25.290247 #29964]  INFO -- StatusUpdater: next run Thu Jul  4 01:00:00 2013, sleeping 58294 seconds
2013-07-03 08:48:55.043460500 I, [2013-07-03T08:48:25.290714 #29964]  INFO -- start: starting ydim-server on druby://192.168.0.36:12375
2013-07-03 08:48:55.043489500 D, [2013-07-03T08:48:55.042202 #29964] DEBUG -- druby://localhost:56001: attempting login
2013-07-03 08:48:55.043490500 "ydim-inject"
2013-07-03 08:58:47.961515500 E, [2013-07-03T08:48:55.043266 #29964] ERROR -- unknown user: DRb::DRbConnError - druby://localhost:56001 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>

Probelem 2 Private_KEY

YDIMD needs DSA key of YDPM. (I don't know why ydim use DSA KEY of YDPM.).
And, YDIM Client must use same PRIVATE_KEY.
(username is doesn't matter)

YDIM Invoicer works on Fastpower

2013-07-03 09:45:38.841183500 "ydim-inject"
2013-07-03 09:45:38.994640500 D, [2013-07-03T09:45:38.840403 #4017] DEBUG -- druby://192.168.0.37:41899: attempting login
2013-07-03 09:45:38.994642500 I, [2013-07-03T09:45:38.842982 #4017]  INFO -- root: login
2013-07-03 09:45:38.994643500 D, [2013-07-03T09:45:38.844094 #4017] DEBUG -- root: create_invoice(68)
2013-07-03 09:45:38.994643500 D, [2013-07-03T09:45:38.844340 #4017] DEBUG -- root: debitor 68
2013-07-03 09:45:38.994643500 D, [2013-07-03T09:45:38.960790 #4017] DEBUG -- root: add_items(12130, Array[1], invoice)
2013-07-03 09:45:38.994644500 D, [2013-07-03T09:45:38.960914 #4017] DEBUG -- root: invoice 12130
2013-07-03 09:45:38.994672500 I, [2013-07-03T09:45:38.970295 #4017]  INFO -- root: logout
  • vetoquinol.bbmb.ch
  • sandoz.bbmb.ch

Note

virbac got this error.

bbmb> BBMB::Util::Invoicer.run(Time.local(2013, 6, 1)..(Time.local(2013, 6, 30)))
-> /usr/local/bin/ruby186/lib/ruby/1.8/net/smtp.rb:576:in `auth_plain': 535-5.7.8 Username and Password not accepted. Learn more at
535-5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257
535 5.7.8 {BADCREDENTIALS} xxxxxxxx- gsmtp

cotninue tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on June 14, 2016, at 05:07 PM