view · edit · sidebar · attach · print · history

< Niklaus.20170530-virbac-error | Index | Niklaus.20170524-brand2csv >>



  • Vetoquinol updater problem
  • Port to use the rack based SBSM
  • Keep in Mind



Vetoquinol updater problem

Must fix the error reported by email like

uninitialized constant BBMB::Util::ProductImporter
/var/www/ `import'
/var/www/ `block in run'
/var/www/ `poll_message'
/var/www/ `block in poll_message'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:341:in `each'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:341:in `block in delegating_block'
/var/www/ `poll_message'
/var/www/ `block in poll'
/var/www/ `each'
/var/www/ `poll'
/var/www/ `block in poll_sources'
/var/www/ `block in load_sources'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/psych/deprecated.rb:32:in `each'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/psych/deprecated.rb:32:in `load_documents'
/var/www/ `load_sources'
/var/www/ `poll_sources'
/var/www/ `run'
/var/www/ `update'
/var/www/ `block (2 levels) in run_updater'
/var/www/ `loop'
/var/www/ `block in run_updater'

The missing require stems from the fact, that the importers to be run are defined by the config.yml. The file bbmb/util/csv_importer.rb from BBMB is overridden in vetoquinol. Therefore we must load (not require) it in the Fixed with commit Load CSV-Importer to fix running importers

Port to use the rack based SBSM

Trying to make bundle exec rackup work. Copied yml files from fastpower /var/www/ Copying also doc/ressources/.

Now bundle sudo -u bbmb bundle-240 exec rackup works and the login displays correctyl (images). Login as admin works, but clicking on any link, column title has no effect.

Fixes for javascripts like require(["dojo/domReady! taken from

Asking myself why it does not display the customer when logged in as admin and visiting Javascripts displays no error.

In the virbac app.log, we see that the log entry for app.rb:137:in `call' finish session_id.2 contains a headers parameter "Set-Cookie"=>"language=de; path=/" which is missing in the sandoz app.log. Why? SBSM::Session#import_cookies: does not work correclty as self::class::PERSISTENT_COOKIE_NAME is bbmb-barcodereader and not sandoz.bbmb as specified in the Okay. We have a confusion of the PERSISTENT_COOKIE_NAME which is used in SBSM::Session and SBSM::RackInterface. Where do we have to place it? I think it should not be fixed constant, as it is probably a good idea to have different names for virbac and sandoz. Therefor I want to place it with the same default value into the BBMB.config. Now the cookie gets stored correctly, but I still do no see the customers info.

Stepping with pry when path is de/customer/customer_id/4100609297. After calling import_user_import in SBSM::Session#process_rack the @valid_input.keys.last returns ": 4100609297". Why? The path is /de/customer/customer_id/4100609297 instead of /de/bbmb/customer/customer_id/4100609297 used a non flavour approach. By removing the method base_url and it alias :orig_base_url in lib/bbmb/html/util/lookandfeel.rb we use the bbmb flavor as elsewhere and everything is working fine. Creating and testing the app here. The Admin interface works fine. Generated password, set password, change street and other fields. Checking whether placing an order as a customer works. Found the following entries in /var/www/

D, [2017-05-29T14:38:51.227964 #11682] DEBUG -- : app.rb:115:in `call' starting session_id 4857f77ae5616d012e5cc379b3  session BBMB::Html::Util::Session /de/bbmb: cookies  are {"
D, [2017-05-29T14:38:51.231205 #11682] DEBUG -- : session.rb:279:in `import_cookies' cuki_str _session_id 4857f77ae5616d012e5cc379b3                                              
D, [2017-05-29T14:38:51.231624 #11682] DEBUG -- : session.rb:285:in `import_cookies' @cookie_input now {:language=>"de"}
I, [2017-05-29T14:38:51.497651 #11682]  INFO -- : current_order.rb:47:in `commit' committing 4100606390 4100606390-35 /home/niklaus/git/sbsm/lib/sbsm/state.rb:197:in `_trigger'  
/home/niklaus/git/sbsm/lib/sbsm/state.rb:186:in `trigger'                                         
/home/niklaus/git/bbmb/lib/bbmb/html/state/global.rb:58:in `trigger'                                                                                                              
/home/niklaus/git/sbsm/lib/sbsm/viralstate.rb:38:in `trigger'                                                                                                                     
/home/niklaus/git/sbsm/lib/sbsm/session.rb:218:in `block in process_rack'                                                                                                         
/home/niklaus/git/sbsm/lib/sbsm/session.rb:208:in `synchronize'                                                                                                                  
/home/niklaus/git/sbsm/lib/sbsm/session.rb:208:in `process_rack'                                                                                                                  
/home/niklaus/git/sbsm/lib/sbsm/app.rb:116:in `call'                                                 
/var/www/ `_call'                                                                              
/var/www/ `call'                                                                               
/var/www/ `call'                                                                    
I, [2017-05-29T14:38:51.497804 #11682]  INFO -- : send_order 4100606390-35 and customer 4100606390                                                                                

It appears in the archive, but no e-mail was received. Changing mail_suppress_sending: in etc/config.yml from true to false and sending another order.

Now I see in the output - - [29/May/2017:14:49:38 +0200] "GET /resources/tierchen.jpg HTTP/1.1" 200 15542 0.0028
Mail.sendmail 587 localhost.localdomain smtp_user:  osz6812  plain
Mail.sendmail from to cc [] message: String
Mail.sendmail 587 localhost.localdomain smtp_user:  osz6812  plain
Mail.sendmail from to cc message: String - - [29/May/2017:14:49:43 +0200] "GET /de/bbmb/current_order/ HTTP/1.1" 200 9012 0.0117

Received an order with the lines

4100606390,7601002107945,29052017,36,4448938,7680553880125,44001133,5,1.71,Interne Bestellnummer 00555,Bemerkung
4100606390,7601002107945,29052017,36,5486585,7680629320012,44050498,5,163.85,Interne Bestellnummer 00555,Bemerkung

The confirmation email looked like this

Sandoz: Auftragsbestätigung 4100606390-36

an ahpdl.bachmatte; mich

Ran the importer, too. Did see many lines like

/home/niklaus/git/bbmb/lib/bbmb/model/order.rb:48: warning: respond_to? is defined here
/var/www/ warning: #<BBMB::Model::Order::Position:0x007fe2e5501160>.respond_to?(:_dump) uses the deprecated method signature, which takes one parameter
/home/niklaus/git/bbmb/lib/bbmb/model/order.rb:48: warning: respond_to? is defined here

Pushed commits to silence some warnings when running tests in odba

After thinking again about my changes. I feel confident, that we do not need any changes in SBSM and/or BBMB, as removing the base_url method from lib/bbmb/html/util/lookandfeel.rb should be enough to make work.

Changing the e-mail address of the test user failed with - - [29/May/2017:16:34:23 +0200] "GET /resources/tierchen.jpg HTTP/1.1" 200 15542 0.0029
NoMethodError: undefined method `get_preference' for #<SBSM::UnknownUser:0x00557e5c94f4a0>
        /var/www/ `home'
        /var/www/ `rescue in trigger'
        /var/www/ `trigger'
        /var/www/ `block in process_rack'
        /var/www/ `synchronize'
        /var/www/ `process_rack'
        /var/www/ `call'
        /var/www/ `_call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `_call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'

Pushed commits

view · edit · sidebar · attach · print · history
Page last modified on May 29, 2017, at 05:16 PM