view · edit · sidebar · attach · print · history

20130716-debug-globopharma-error-and-dobug-editing-davatz-com

<< 20130717-debug-editing-davatz-com | 2013 | 20130710-add-prodno-oddb-article-xml-debug-editing-davatz-com >>


Summary

  • Debug inject error on globopharm
  • Debug Update on davaz.com

Commits / Patches

Index / Status


Debug inject errors on globpharm

Bestellung OK, Eintrag in BBMB Fehlgeschlagen:
DRb::DRbConnError
druby://localhost:9999 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>

/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:736:in `open'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:729:in `each'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:729:in `open'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1189:in `initialize'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1169:in `new'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1169:in `open'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend'
/usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing'
/var/www/globopharm.xmlconv.bbmb.ch/lib/postprocess/bbmb.rb:25:in `inject'
/var/www/globopharm.xmlconv.bbmb.ch/lib/postprocess/bbmb.rb:20:in `each'
/var/www/globopharm.xmlconv.bbmb.ch/lib/postprocess/bbmb.rb:20:in `inject'
/usr/local/share/src/xmlconv/lib/xmlconv/util/transaction.rb:85:in `send'
/usr/local/share/src/xmlconv/lib/xmlconv/util/transaction.rb:85:in `postprocess'
/usr/local/share/src/xmlconv/lib/xmlconv/util/transaction.rb:82:in `each'
/usr/local/share/src/xmlconv/lib/xmlconv/util/transaction.rb:82:in `postprocess'
/usr/local/share/src/xmlconv/lib/xmlconv/util/application.rb:39:in `_execute'
/usr/local/share/src/xmlconv/lib/xmlconv/util/application.rb:31:in `execute'
/usr/local/share/src/xmlconv/lib/xmlconv/util/polling_manager.rb:187:in `poll_sources'
...
...

Note

  • sandoz.xmlconv.bbmb.ch ---> sandoz.bbmb.ch (druby://localhost:12004, bbmb v2)
  • globopharm.xmlconv.bbmb.ch ---> bbmb.ch (druby://localhost:9999, bbmb v1)

Checked all ports with:

% netstat -tulpn

There is no 127.0.0.1:9999. (drb process for globopharm is not runnnig).
alloga.bbmb.ch is running on druby://localhost:9876. (globopharm.bbmb.ch is changed to alloga.bbmb.ch.)

bbmbd does not read /usr/local/share/src/util/bbmbconfig.rb

fastpower bbmb.ch $ grep -r 9876 /usr/local/share/src/bbmb.ch/
/usr/local/share/src/bbmb.ch/src/util/bbmbconfig.rb:    SERVER_URI = ["druby://localhost:9999"]#, "druby://192.168.0.35:9876"]

alloga.bbmb.ch does not use codes in /usr/loca/share/src/bbmb.ch.
It has copies into /var/www/bbmb.ch.

Then I changed config for globopharm.bbmb.ch to be suitable for alloga.bbmb.ch.

Re-execute via bin/admin

I created run-admin script. (this run bin/admin for globopharm.bbmb.ch with same environment to bbmbd.)

in /var/www/globopharm.xmlconv.bbmb.ch

#!/bin/sh
DIR=/var/www/globopharm.xmlconv.bbmb.ch
LIB=/usr/local/share/src/xmlconv/lib
GEM=/usr/local/bin/ruby186/lib/ruby/gems/1.8/gems

exec sudo -u bbmb /usr/local/bin/ruby186/bin/ruby \
  -I$GEM/dbi-0.4.5/lib \
  -I$GEM/dbd-pg-0.3.9 \
  -I$GEM/deprecated-2.0.1/lib \
  -I$GEM/odba-1.1.0/lib \
  -I$GEM/tmail-1.2.7.1/lib \
  -I$GEM/rclconf-1.0.0/lib \
  -I$GEM/smtp_tls-1.0.3/lib \
  -I$GEM/needle-1.3.0/lib \
  -I$GEM/htmlgrid-1.0.6/lib \
  -I$GEM/sbsm-1.2.3/lib \
  -I$GEM/ydim-1.0.0/lib \
  -I$LIB \
  $DIR/bin/admin config=$DIR/etc/xmlconv.yml

Then

% ./run-admin
ch.bbmb.xmlconv.globopharm> transactions.last.transaction_id
-> 662
ch.bbmb.xmlconv.globopharm> transactions.last.status
-> error
ch.bbmb.xmlconv.globopharm> transactions.last.start_time
-> Wed Jul 10 00:35:43 +0200 2013

Make a Transaction, manualy

I had to re-make transaction from backup, manualy.
This is one liner for making a Transaction.

ch.bbmb.xmlconv.globopharm> tr = XmlConv::Util::Transaction.new; \
tr.domain = "globopharm.xmlconv.bbmb.ch"; \
tr.partner = "221200"; tr.reader = "PharmaciePlusBdd"; \
tr.writer = "BddI2"; tr.debug_recipients = ["yasaka@ywesee.com"]; \
tr.error_recipients = ["yasaka@ywesee.cow"]; tr.postprocs = [["Bbmb", "inject", "druby://localhost:9876", "gag", "221200"]]; \
tr.origin = "pop3:orders.pharmacieplus@bbmb.ch@localhost:10000"; \
src = File.read("/var/www/globopharm.xmlconv.bbmb.ch/polling.bak/pharmacieplus/orders.pharmacieplus@bbmb.ch.20130710003618.136870").gsub(/\r\n/, "\n"); \
parts = []; RMail::Parser.read(src).each_part {|part| parts << part unless part.multipart? }; tr.input =  parts.select{|mes| "text/xml".match mes.header.content_type('text/plain')}.first.decode; \
tr.destination = XmlConv::Util::Destination.book("ftp://ualbuyweseep:IntRach3@galbox.alloga.ch/IN/CustomerOrder", "/IN/Temp"); \
tr.arguments = []; @system.execute(tr)

Note

To parse mail body.
We have to parse mail attachment as Input source.

ch.bbmb.xmlconv.globopharm> src = File.read("/var/www/globopharm.xmlconv.bbmb.ch/polling.bak/pharmacieplus/orders.pharmacieplus@bbmb.ch.20130710003618.136870").gsub(/\r\n/, "\n"); \
parts = []; RMail::Parser.read(src).each_part {|part| parts << part unless part.multipart? }; \
parts.select{|mes| "text/xml".match mes.header.content_type('text/plain')}.first.decode.class
-> String

Debug Update on davaz.com

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