view · edit · sidebar · attach · print · history

< Niklaus.20170522-vetoquinol-rack | Index | Niklaus.20170516-virbac >>



  • Fix importer problem
  • Renaming an email address must check correctly whether it is a duplicate
  • Keep in Mind



importer problem

The update started at 23 hours (default update_hour) and 4 NameError for each of the used Importer.

uninitialized constant BBMB::Util::CustomerImporter
/var/www/ `import'
/var/www/ `block in run'
/var/www/ `block in poll_path'
/var/www/ `open'
/var/www/ `poll_path'
/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 other error is uninitialized constant BBMB::Util::ProductImporter.

Looking at log/2017/05/16/app_log for the log entries at 23 hours. Here I see

D, [2017-05-16T23:00:00.000408 #6622] DEBUG -- : server.rb:87:in `block (2 levels) in run_updater' update starting
D, [2017-05-16T23:00:06.055515 #6622] DEBUG -- : server.rb:89:in `block (2 levels) in run_updater' update finished
D, [2017-05-16T23:00:06.055639 #6622] DEBUG -- : server.rb:85:in `block (2 levels) in run_updater' updater sleeping 86393.94 seconds. run_only_once_at_startup false

It looks like ./lib/bbmb/util/csv_importer.rb from virbac was never required as it should be. To debug the Update I did set in my checkout the variable run_only_once_at_startup to true in lib/bbmb/util/server.rb. Now I was able to reproduce the error here.

Waiting for importer to finish before pushing the commit, which just adds a require 'bbmb/util/rack_interface' in the lib/bbmb/virbac/app.rb

Pushed commit To be able to run the Updaters csv_importer must be included

But to avoid the old error of the undefined to_i for False error, I must fix bbmb, too.

Installing the new version on fast-power and running the importer

  • cd /var/www/
  • sudo -u bbmb git pull
  • sudo -u bbmb /usr/local/bin/bundle-240 install
  • sudo svc -h /service/
  • sudo tail /service/ # to verify that it started correctly
  • sudo -u bbmb /usr/local/bin/bundle-240 exec bin/update_abschluss_artikel_artikel_fr_kunden

Running bin/update_abschluss_artikel_artikel_fr_kunden fails, because of my changes of yesterday. Must find the used server differently.

Pushed commit Fixed update_abschluss_artikel_artikel_fr_kunden to use DRbServer via config.server_url

In /service/ we find

ond_to?(:_dump) uses the deprecated method signature, which takes one parameter
@40000000591bfd6e225a5d6c /var/www/ warning: respond_to? is defined here
@40000000591bfd6e261682dc csv_importer.rb: finished. /var/www/ count is 332
@40000000591bfd6e2854eda4 csv_importer.rb: UTF-8 importing /var/www/ 332 lines
@40000000591bfd70006a02ac ...ProductImporter postprocess
@40000000591bfd7321f66794 csv_importer.rb: finished. /var/www/ count is 332
@40000000591bfd732495d264 csv_importer.rb: UTF-8 importing /var/www/ 1234 lines
@40000000591bfd7524ad88b4 .Skipping customer 3219
@40000000591bfd770a067d7c ......... 1000
@40000000591bfd7d0bd88dfc ..CustomerImporter postprocess
@40000000591bfd7d336595cc CsvImporter postprocess
@40000000591bfd7d3365a954 csv_importer.rb: finished. /var/www/ count is 1234

But the files are still found under var/ftp, because the service is still running. My first idea to stop the service did not work. Adding a stop_service method to bbmb. This idea did not work neither. Therefore abandoning this problem.

Renaming an email address must check correctly whether it is a duplicate

When renaming the email, we visit the following procedures

The update_user in state/customer.rb raises an error :e_duplicate_email, it it cannot successfull call session.auth_session.grant. We note the following differences between the pre-rack and our version

Therefore I conculde that the BBMB.auth object is not the correct. Why? I found that BBMB.auth was initialized in bin/bbmbd, which is no longer used. Change the code in app.rb to BBMB.auth instead of @auth. Changing various occurrences of the the same variable. Dropped virbac_bbmd and virbac_bbmb_yus database.

When I start the app I get now #<Errno::ECONNREFUSED: Connection refused - connect(2) for "127.0.01" port 12003>. Comparing again agains bin/bbmbd. Yes. start_service now also sets BBMB.server and BBMB.persistance and I start up as usual.

But the login of an admin or normal user fails now with #<Errno::ECONNREFUSED: Connection refused - connect(2) for "127.0.01" port 12003>

Pushed commits

Adding a possibility to easily run invoicer at startup like for the updater, to check whether this still works.

When trying to set an empty address it generates the error:

RuntimeError at /de/bbmb
Invalid email address: nil
Ruby	/home/niklaus/git/ in email=, line 69

When looking when this line was created by using git blame lib/bbmb/model/customer.rb I get ^1f296dd (Hannes Wyss 2007-04-17 16:16:04 +0200 69) raise "Invalid email address: nil" unless email. Therefore Hannes decided that this was the correct way to do.

Now the question is whether it must be possible to set an empty e-mail or whether we would like to have a nicer error message.

Pushed commits

Reactivated the AdminServer in my sbsm. With a few changes, I get the following error form bin/virbac_admin

ch.bbmb.virbac> ODBA.cache.extent(BBMB::Model::Order).size
-> 0x002b0e5efa70fc is not id value

This looks like we have some problems speaking correctly to the DRbServers. Removed a suspicous line and now I have the first success

ch.bbmb.virbac> ODBA.cache.extent(BBMB::Model::Order).size
-> 10747
ch.bbmb.virbac> ODBA.cache.extent(BBMB::Model::Order).first.order_id
-> 17525-
ch.bbmb.virbac> ODBA.cache.extent(BBMB::Model::Customer).first.customer_id
-> 16810
ch.bbmb.virbac> ODBA.cache.extent(BBMB::Model::Customer)

Testing whether the other stuff still work. All the tests given by completed here. Preparing the commits.

Pushed the following commits:

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