view · edit · sidebar · attach · print · history

20130702-debug-yus-error-and-check-invoice

<< | Index | >>


Summary

  • Debug yus error
  • Debug YDIM injection and statistics
  • Update configuration bbmb/xmlconv applications on production.
    • It has variouse dependencies against htmlgrid and dojo.

Commits / Patches

ch.oddb.org
htmlgrid-1.0.0

Index / Status


Debug yus error

After Long time from login, login_token is called in ODDB::Session.

Yus::Server

    def login(name, password, domain)
      @needle.logger.info(self.class) { 
        sprintf('Login attempt for %s from %s', name, domain)
      }   
      hash = @needle.config.digest.hexdigest(password.to_s)
      session = login_root(name, hash, domain) \
        || login_entity(name, hash, domain) # raises YusError
      @sessions.push(session)
      session
    end 
    def login_token(name, token, domain)
      entity = authenticate_token(name, token)
      entity.login(domain)
      @needle.persistence.save_entity(entity)
      timeout = entity.get_preference("session_timeout", domain) \    #=> why discards this @@timeout@@ ??
        || @needle.config.session_timeout
      TokenSession.new(@needle, entity, domain)
    end 

timeout was 3600.

Yus::Server#login and Yus::Server@login_token is not same.
By Original Specification, Token::Session is not allowed edit of Yus.entities.

Then I returns Entity::Session from yus.
But ODBA Error is caused.

error in SBSM::Session#to_html: /de/gcc/company/ean/7601001320451
NoMethodError
undefined method `odba_replace_stubs' for grauwoelfchen@gmail.com:Yus::Entity      #=> user
/home/yasuhiro/.work/usr/ywesee/src/odba/lib/odba/stub.rb:52:in `odba_receiver'
/home/yasuhiro/.work/usr/ywesee/src/odba/lib/odba/stub.rb:112:in `method_missing'
/home/yasuhiro/.work/usr/ywesee/src/ch.oddb.org/src/view/admin/entities.rb:64:in `affiliations'
/home/yasuhiro/.work/usr/ywesee/src/ch.oddb.org/.bundle/gems/ruby/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/value.rb:33:in `init'
/home/yasuhiro/.work/usr/ywesee/src/ch.oddb.org/.bundle/gems/ruby/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/home/yasuhiro/.work/usr/ywesee/src/ch.oddb.org/.bundle/gems/ruby/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/namedcomponent.rb:34:in `initialize'
...

Maybe, In original specification of ODDB::Session and YUS, User must be one more time login after constant time (3600).

It does not allowed (and can not enable) that TokenSession User (via login_token) access to yus entities (for edit).

Then I just rescued this error.
And update to render login_form again at following cases.

  • Timeout (after long time from login)
  • No-Previlege User
  • after ODDB reboot

User must login, one more time.

commit

Debug invoice statistics

Yesterday, I changed client_url YDIM Invoicer.

Test invoicer

(On local VM)

Check via bin/adimn

% ruby -rrubygems -I/home/yasuhiro/.work/usr/ywesee/src/bbmb/lib bin/admin config=etc/config.yml
ch.bbmb> 

Note

  • If Invoice Job starts in local, it takes 100% CPU of a core.
  • BBMB::Util::Invoice is module, not class.

ch.bbmb.vetoquinol> BBMB::Util::Invoicer.run(Time.local(2009, 11, 1)..(Time.local(2010, 1, 1)))
-> (druby://localhost:12375) /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.

:suspend


Htmlgrid for applications on fastpower

  • virbac.bbmb.ch
[Tue Jul 02 18:34:04 2013] [error] [client 120.143.4.199] File does not exist: /var/www/virbac.bbmb.ch/doc/resources/dijit, referer: http://virbac.bbmb.ch/de
  • some old BBMB applications need old htmlgrid than 1.0.3. (z.B. 1.0.0)
  • But xmlconv needs > 1.0.3. (z.B. 1.0.6)
  • davaz.com works with each versions < 1.0.6. (z.B. 1.0.3)

But,

  • Orders View of vetoquinol.bbmb.ch uses 1.0.6
  • Home View of vetoquinol.bbmb.ch expects < 1.0.3

Finaly,
I configured like this (Updated run script of daemontools to load specified HtmlGrid):

  • vetoquinol.bbmb.ch uses htmlgrid-1.0.3 (+patch, for List, avoid error by argument numbers).
  • globopharm.xmlconv.bbmb.ch use htmlgrid-1.0.6.
    • Added Missing RubyAddPath to SBSM in http.conf.
  • virbac.bbmb.ch uses htmlgrid-1.0.3 (+patch)
  • sandoz.bbmb.ch uses htmlgrid-1.0.3 (+patch)
  • sandoz.xmlconv.bbmb.ch uses htmlgrid-1.0.6
  • davaz.com uses htmlgrid-1.0.3 (+patch)
  • alloga.bbmb.ch uses htmlgrid-1.0.0
fastpower $ /usr/local/bin/ruby186/bin/gem list htmlgrid

*** LOCAL GEMS ***

htmlgrid (1.0.6, 1.0.3, 1.0.0)

HtmlGrid 1.0.0 Patch for vetoquinol.bbmb.ch

fastpower htmlgrid $ diff -ruN list.rb.origin list.rb
--- list.rb.origin      2013-07-02 20:49:40.860462851 +0200
+++ list.rb     2013-07-02 20:50:03.419415470 +0200
@@ -69,8 +69,7 @@
                                #compose_css(offset, resolve_suffix(mdl, bg_flag))
                                #compose_colspan(offset)
                                if(rcss = row_css(mdl, bg_flag))
-                                       @grid.set_row_attributes({'class' => rcss}, offset.at(1),
-                                  self::class::OFFSET_STEP.at(1))
+                                       @grid.set_row_attributes({'class' => rcss}, offset.at(1))
                                end
                                offset = resolve_offset(offset, self::class::OFFSET_STEP)
                                bg_flag = !bg_flag if self::class::STRIPED_BG

links

view · edit · sidebar · attach · print · history
Page last modified on July 02, 2013, at 08:54 PM