view · edit · sidebar · attach · print · history

< Niklaus.20170621-sandoz-xmlconv | Index | Niklaus.20170619-sandoz-xmlconv >>

20170620-sandoz-xmlconv

Summary

  • Port oddb.org to use rack
  • Fix submitting orders to sandoz.xmlconv
  • Keep in Mind

Commits

Index

Fix submitting orders to sandoz.xmlconv (Fiddler tests)

Why do orders for ywesee pass and those for other companies not?

Looking for entries around time 17:14 (when I was able to place an order as customer 99) and 18:24 where placing an order failed. Order changed to reflect chronoligal order

Successfull order

grep T17:14 /var/www/san*/log/2017/06/19/*log
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:I, [2017-06-19T17:14:12.406950 #12688]  INFO -- : app.rb:78:in `initialize' initialize validator XmlConv::Util::Validator th  cookie virbac.bbmb session XmlConv::Util::Session app XmlConvApp multi_threaded 
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:I, [2017-06-19T17:14:12.410356 #12688]  INFO -- XmlConv2: drb-service listening on druby://localhost:12006
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:I, [2017-06-19T17:14:12.410454 #12688]  INFO -- : app.rb:78:in `initialize' initialize validator XmlConv::Util::Validator th  cookie virbac.bbmb session XmlConv::Util::Session app #<XmlConvApp:0x007f4954cce1e8> multi_threaded 
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:E, [2017-06-19T17:14:12.426674 #12688] ERROR -- XmlConv2: Errno::EACCES
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:I, [2017-06-19T17:14:21.101870 #12688]  INFO -- : session.rb:114:in `initialize' initialize th #<SBSM::TransHandler:0x007f4954c97f58> validator XmlConv::Util::Validator app XmlConvApp multi_threaded false
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:21.112352 #12688] DEBUG -- : session.rb:135:in `initialize' session initialized #<XmlConv::Util::Session:0x007f4956181a90> with @cgi #<CGI:0x007f4956166010> multi_threaded false app 69976466026740 and user SBSM::UnknownUser @unknown_user XmlConv::Util::KnownUser
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:21.112473 #12688] DEBUG -- : app.rb:118:in `call' starting session_id 11e0e4a443e3481b8e13b2dd84b  session XmlConv::Util::Session /propharma: cookies  are {} @cgi NilClass
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:21.120595 #12688] DEBUG -- : session.rb:227:in `process_rack' @post_content is <?xml version "1.0" encoding="utf-8"?><customerOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" language="fr" productDescriptionDesired="true" communicationSoftwareId="ywesee Test" xmlns="http://www.e-galexis.com/schemas/">  <client number="99" password="" />  <orderHeader deliveryDate="2016-07-15" referenceNumber="99"/>  <orderLines>    <productOrderLine orderQuantity="2">      <pharmaCode id="2508375" />    </productOrderLine>    <productOrderLine orderQuantity="2">      <pharmaCode id="5195126" />    </productOrderLine>  </orderLines></customerOrder>

/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T17:14:22.065587 #10334]  INFO -- : send_order 99-129 and customer 99
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T17:14:23.651896 #10334]  INFO -- : server.rb:86:in `inject_order' inject_order 99-129 for customer_id 99 done at 2017-06-19 17:14:23 +0200

/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:25.445940 #12688] DEBUG -- : session.rb:412:in `logout' logout "/propharma" setting @state 69976483748680 XmlConv::State::Login remember nil XmlConv::Util::KnownUser
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:25.447075 #12688] DEBUG -- : session.rb:256:in `block in process_rack' active_state.trigger state 69976483748680 XmlConv::State::Login remember nil
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:25.447161 #12688] DEBUG -- : session.rb:265:in `block in process_rack' Changing from 69976483748680 to state XmlConv::State::Login 69976483748680 remember nil  XmlConv::Util::KnownUser
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T17:14:25.450497 #12688] DEBUG -- : app.rb:150:in `call' finish session_id.1 11e0e4a443e3481b8e13b2dd84b: matches response.headers['Set-Cookie']

Failed order

egrep "T18:2(4|5)" /var/www/san*/log/2017/06/19/*log

/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:E, [2017-06-19T18:24:12.460117 #12688] ERROR -- XmlConv2: Errno::EACCES
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:I, [2017-06-19T18:24:48.847724 #12688]  INFO -- : session.rb:114:in `initialize' initialize th #<SBSM::TransHandler:0x007f4954c97f58> validator XmlConv::Util::Validator app XmlConvApp multi_threaded false
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:48.847944 #12688] DEBUG -- : session.rb:135:in `initialize' session initialized #<XmlConv::Util::Session:0x007f495d06d800> with @cgi #<CGI:0x007f495d05f6d8> multi_threaded false app 69976466026740 and user SBSM::UnknownUser @unknown_user XmlConv::Util::KnownUser
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:48.848010 #12688] DEBUG -- : app.rb:118:in `call' starting session_id 73bf87f973f7953084982fbe0a  session XmlConv::Util::Session /pharmasoft: cookies  are {} @cgi NilClass
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:48.848119 #12688] DEBUG -- : session.rb:227:in `process_rack' @post_content is <?xml version="1.0" encoding="utf-8"?><customerOrder xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" compressionDesired="false" productDescriptionDesired="true" backLogDesired="true" language="fr" roundUpForCondition="true" version="1.0">
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:50.640737 #12688] DEBUG -- : session.rb:412:in `logout' logout "/pharmasoft" setting @state 69976534989220 XmlConv::State::Login remember nil XmlConv::Util::KnownUser
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:50.641828 #12688] DEBUG -- : session.rb:256:in `block in process_rack' active_state.trigger state 69976534989220 XmlConv::State::Login remember nil
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:50.641892 #12688] DEBUG -- : session.rb:265:in `block in process_rack' Changing from 69976534989220 to state XmlConv::State::Login 69976534989220 remember nil  XmlConv::Util::KnownUser
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:D, [2017-06-19T18:24:50.644227 #12688] DEBUG -- : app.rb:150:in `call' finish session_id.1 73bf87f973f7953084982fbe0a: matches response.headers['Set-Cookie']
/var/www/sandoz.xmlconv.bbmb.ch/log/2017/06/19/app.log:E, [2017-06-19T18:25:12.460791 #12688] ERROR -- XmlConv2: Errno::EACCES

/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T18:25:16.511906 #10334]  INFO -- : session.rb:114:in `initialize' initialize th #<SBSM::TransHandler:0x007fa317db7b28> validator BBMB::Html::Util::Validator app BBMB::Util::App
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.512078 #10334] DEBUG -- : session.rb:135:in `initialize' session initialized #<BBMB::Html::Util::Session:0x007fa3187eb298> with @cgi #<CGI:0x007fa3187ea6e0> multi_threaded false app 70169228356740 and user SBSM::UnknownUser @unknown_user SBSM::UnknownUser
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.512139 #10334] DEBUG -- : app.rb:118:in `call' starting session_id dc37cc42f0a243bef549e08cb5  session BBMB::Html::Util::Session /: cookies  are {} @cgi NilClass
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T18:25:16.512452 #10334]  INFO -- : session.rb:39:in `logout' BBMB::Html::Util::Session logout @auth_session NilClass
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.512588 #10334] DEBUG -- : session.rb:386:in `logout' logout "/" setting @state 70169233670160 BBMB::Html::State::Login remember nil SBSM::UnknownUser
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.513783 #10334] DEBUG -- : session.rb:230:in `block in process_rack' active_state.trigger state 70169233670160 BBMB::Html::State::Login remember nil
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.513845 #10334] DEBUG -- : session.rb:239:in `block in process_rack' Changing from 70169233670160 to state BBMB::Html::State::Login 70169233670160 remember nil  SBSM::UnknownUser
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.513950 #10334] DEBUG -- : session.rb:472:in `set_cookie_input' cookie_set_or_get language de
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:D, [2017-06-19T18:25:16.515564 #10334] DEBUG -- : app.rb:135:in `call' finish session_id.1 dc37cc42f0a243bef549e08cb5: matches response.headers['Set-Cookie']

On fastpower I get the following entries when grepping for send_order in the log files.

grep send_order /var/www/sand*/log/2017/06/19/*log
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T12:08:51.407046 #16550]  INFO -- : send_order 99-123 and customer 99
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T16:52:05.459407 #10334]  INFO -- : send_order 99-128 and customer 99
/var/www/sandoz.bbmb.ch/log/2017/06/19/app_log:I, [2017-06-19T17:14:22.065587 #10334]  INFO -- : send_order 99-129 and customer 99

whereas I get no entry at all locally. Looks like on oddb-ci2 we do not pass the order to sandoz.bbmb but treat them directly.

On oddb-ci2 id did not reach my locally started sandoz.bbmb.ch as there was still on running via a service as seen by

sudo netstat -lptu | grep 12004
tcp        0      0 oddb-ci2:12004          0.0.0.0:*               LISTEN      31430/Bbmb(Sandoz)  
tcp6       0      0 oddb-ci2:12004          [::]:*                  LISTEN      1905/Bbmb(Sandoz)  

The send_order is a post_process of the transaction. And its exit status is not checked. Placing some more debug statement (SBSM.debug) to be able to follow them closely.

Also I think we should replace in the xmlconv.yml localhost by 127.0.0.1 to for IPv4 connections.

Fixed also an error initializing the BBMB::Util::KnownUser by passing as parameter @auth_session and not session, to make it work together we SBSM 1.4.5.

Pushed the following commits

And release gem BBMB 2.3.2.

Pushed commit in sandoz.bbmb.ch Require bbmb 2.3.2

Pushed commits for xmlconv

and release the xmlconv gem 1.1.6

Pushed commits for sandoz.xmlconv

Installed new version on fastpower and launched order which looks fine 33895 http://80.218.53.88 20.06.2017 12:12:58 file:/.../var/output/99_20170620121258008.txt Bestellung via BBMB erfolgreich

After some minutes I detected another successfull order 33896 http://83.173.197.74 20.06.2017 12:25:35 file:/.../var/output/4100602575_20170620122535020.txt Bestellung via BBMB erfolgreich. It could be seen via http://sandoz.bbmb.ch/de/bbmb/order/order_id/4100602575-189, too.

Port oddb.org to use rack

Export jobs to check are:

  • jobs/export_oddb2_csv
  • jobs/export_oddb2tdat
  • jobs/export_oddb_csv
  • jobs/export_swissdrug-update
  • jobs/export_teilbarkeit
  • jobs/export_daily

Watir tests cannot login, whereas testing by myself I had no problem logging in. Why? Firefox pops up now "Insecure password warning in Firefox". Can we suppress this?

Installed https://www.joedog.org/siege-manual/ via ./configure; make and sudo make install. Added a file siege_urls.txt and ran some tests against oddb-ci2 and ch.oddb.org. Results are good, locally I have 6421 on ch.oddb.org 2741 in 1 minute.

Adding some more URL from the lua tests, I got locally 1407 hits and on ch.oddb.org 1054 hits when running it with the parameters siege -v -t1m -f test/siege_urls.txt. Pushed commit Added test/siege_urls.txt for performance tests

Pushed commit Make watir tests work again with chromium

Running the smoketest leaves me the following failures

rspec ./spec/smoketest_spec.rb:107 # ch.oddb.org should display a limitation link for Sevikar
rspec ./spec/smoketest_spec.rb:315 # ch.oddb.org should download the example
rspec ./spec/smoketest_spec.rb:354 # ch.oddb.org should download the results of a search
rspec ./spec/smoketest_spec.rb:387 # ch.oddb.org should display search and search_type for fachinfo diff
rspec ./spec/smoketest_spec.rb:397 # ch.oddb.org should display the correct calculation for Bicalutamid Actavis
rspec ./spec/smoketest_spec.rb[1:31] # ch.oddb.org should have a working instant search for Augmentin and takeskosten

The problem with the downloadDir was fixed with commit Fix settting downloadDir for chromiume

But on oddb-ci2 we have problem displaying the de/gcc/show/fachinfo/40501/diff/28.11.2015. Why? Are the changes to correctly restored after a database dump?

Gettting yesterday database dump from thinpower and loading it locally.

Must modifiy the startup to enable separate services for crawler and google-crawler. Pushed commit Added bin/crawler and adapte startup for it. Services must contain a line like sudo -u apache bundle-240 exec bin/crawler google_crawler

Installing on thinpower with these steps

  • cd /var/www/oddb.org
    • git checkout -b rack
    • git pull https://github.com/ngiger/oddb.org.git rack
    • activate line exec sudo -u apache bundle-240 exec rackup in /service/ch.oddb/run
    • activate line exec sudo -u apache bundle-240 exec bin/crawler google_crawler in /service/ch.oddb-google_crawler/run
    • activate line exec sudo -u apache bundle-240 exec bin/crawler crawler in /service/ch.oddb-crawler/run
    • cp /etc/apache2/vhosts.d/20_oddb.org.conf /home/ywesee/20_oddb.org.conf.pre_rack

While adapting the 20_oddb.org.conf I remarked that I would not handle correctly sites like santesuisse or desitin. Therefore reverting the work and postponing it to tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on June 20, 2017, at 05:12 PM