view · edit · sidebar · attach · print · history

Masa.20101020-debug-export_chde_xls


  1. Debug xls2odat
  2. Debug export_chde_xls de.oddb.org

Goal
  • debug export_chde_xls de.oddb.org / 50 %
Milestones
  1. git pull de.oddb.org on production server done by Davatz-san
  2. update xls2odat 9:00
  3. Check the chde error in my local -> No error comes 10:00
  4. Look at the error message and BraSt what to do
    • Check /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112 and active_agents method
  5. Backtrace the error report one by one
Summary
Commits
ToDo Tomorrow
Keep in Mind
Attached Files

Debug xls2odat

Davatz-san got the following error EMail Re: xls2odat: additional table 12 - RangeError

 ~/.backup/kunden/i-l/kybun> xls2odat kybun_conf.xls kybunstamm.xls /usr/lib/ruby/gems/1.8/gems/spreadsheet-0.6.4.1/lib/spreadsheet/excel/row.rb:42:in
`at': bignum too big to convert into `long' (RangeError)
       from
/usr/lib/ruby/gems/1.8/gems/spreadsheet-0.6.4.1/lib/spreadsheet/excel/row.rb:42:in
`[]'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:225:in `cell'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:225:in `map'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:225:in `cell'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:266:in `analyzer'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:138:in `parse_data'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:137:in `each'
       from /usr/lib/ruby/site_ruby/1.8/xls2odat.rb:137:in `parse_data'
        ... 13 levels...
       from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`each_with_index'
       from /usr/bin/xls2odat:20:in `each'
       from /usr/bin/xls2odat:20:in `each_with_index'
       from /usr/bin/xls2odat:20
  • This is caused by "Timestamp" in a configuration file.
  • It should be "timestamp" with small "t" at the first letter.
  • Otherwise, the script tries to access "Timestamp" column.
  • In 32bit system, the column number of "Timestamp" is bigger than the max of LONG type integer.

Debug export_chde_xls de.oddb.org

The following error comes on production server, (but never comes in Davatz-san's local) when export_chde_xls runs EMail Wed Oct 20 08:20:00 2010: ODDB::Export::Xls::ComparisonDeCh

Wed Oct 20 08:20:00 2010: ODDB::Export::Xls::ComparisonDeCh#export
NoMethodError
undefined method `active_agents' for nil:NilClass
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send'
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing'
(druby://localhost:10013) /var/www/oddb.org/src/model/part.rb:31:in `active_agents'
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send'
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing'
(druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `active_agents'
(druby://localhost:10013) /usr/lib64/ruby/1.8/drb/drb.rb:395:in `inject'
(druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `each'
(druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `inject'
(druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `active_agents'
(druby://productionserver:46243) /var/www/de.oddb.org/lib/oddb/remote/drugs/package.rb:27:in `active_agents'
(druby://productionserver:46243) /var/www/de.oddb.org/lib/oddb/remote/drugs/package.rb:75:in `local_comparables'
(druby://productionserver:46243) /var/www/de.oddb.org/lib/oddb/export/xls.rb:27:in `collect_comparables'
(druby://productionserver:46243) /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `call'
(druby://localhost:10013) /usr/lib64/ruby/1.8/drb/invokemethod.rb:10:in `block_yield'
(druby://localhost:10013) /usr/lib64/ruby/1.8/drb/invokemethod.rb:17:in `perform_with_block'
(druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:40:in `call'
(druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:40:in `remote_each_package'
(druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:38:in `each'
(druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:38:in `remote_each_package'
/var/www/de.oddb.org/lib/oddb/export/xls.rb:22:in `collect_comparables'
/var/www/de.oddb.org/lib/oddb/export/xls.rb:15:in `export'
/var/www/de.oddb.org/lib/oddb/export/server.rb:57:in `safe_export'
/usr/lib64/ruby/1.8/tempfile.rb:172:in `open'
/var/www/de.oddb.org/lib/oddb/export/server.rb:54:in `safe_export'
/var/www/de.oddb.org/lib/oddb/export/server.rb:25:in `export_chde_xls'
jobs/export_chde_xls:17
/var/www/de.oddb.org/lib/oddb/util/job.rb:16:in `call'
/var/www/de.oddb.org/lib/oddb/util/job.rb:16:in `run'
jobs/export_chde_xls:16

Check the error in my local

Set up

  • run de.oddb.org (de.oddb.org/bin/oddbd)
  • run ch.oddb.org (oddb.org/bin/oddbd) this does not have to run
  • run currencyd (currency/bin/currencyd)
  • run readonlyd (oddb.org/ext/readonly/bin/readonlyd)
  • run jobs/export_chde_xls (de.oddb.org/jobs/export_chde_xls)

In order to run readonlyd, I have to change the require path for multilingual

from

  oddb.org/src/remote/galenic_group.rb:#require 'oddb/util/multilingual'
  oddb.org/src/remote/galenic_form.rb:#require 'oddb/util/multilingual'

to

  oddb.org/src/remote/galenic_group.rb:require 'src/remote/multilingual'
  oddb.org/src/remote/galenic_form.rb:require 'src/remote/multilingual'

Refer

Result

  • No email comes
  • The files are created in de.oddb.org/var/downloads
masa@masa ~/ywesee/de.oddb.org/var/downloads $ ls
chde.xls  chde.xls.3520.0  chde.xls.gz  chde.xls.zip

Next

  1. Look at the error code and experiment in my local
  2. test on production server

Check /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112 and active_agents method

undefined method `active_agents' for nil:NilClass
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send'

Notes

/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112

    def method_missing(meth_symbol, *args, &block)
      if(NO_OVERRIDE.include?(meth_symbol))
        super
      else
        odba_instance.send(meth_symbol, *args, &block)
      end
    end

So

undefined method `active_agents' for nil:NilClass
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send'

means odba_instance became nil.

Question

  • What is the 'odba_instance'?
  • It looks a variable but it is not defined in the method

Answer

  • odba_instance is a method name instead of odba_receiver
alias :odba_instance :odba_receiver

odba_receiver

    def odba_receiver(name=nil)
      if(@receiver && !@receiver_loaded)
        warn "stub for #{@receiver.class}:#{@odba_id} was saved with receiver"
        @receiver = nil
      end
      @receiver || begin
      #begin
        @receiver = ODBA.cache.fetch(@odba_id, @odba_container)
        @receiver_loaded = true
        if(@odba_container)
          @odba_container.odba_replace_stubs(@odba_id, @receiver)
        else
          warn "Potential Memory-Leak: stub for #{@receiver.class}##{@odba_id} was saved without container"
        end
        @receiver
      rescue OdbaError => e
        warn "ODBA::Stub was unable to replace #{@odba_class}##{@odba_id} from #{@odba_container.class}:##{@odba_container.odba_id}"
      end
    end

Notes

  • This (probably) loads the odba instance from the database according to odba_id
  • The error occurs (probably) because an odba instance was not able to be loaded with some reason

Brain Storming

  • Why it (odba_instance) became nil
  • Probably I have to check the odba_receiver method when active_agents method is called
  • What is the odba_instance.class in my local when active_agents method is called?
  • It is possible that method_missing method is not called in the correct case
  • I hate method_missing method!! because it makes debug difficult.

Just for information

masa@masa ~/ywesee/de.oddb.org $ grep -r method_missing *
lib/oddb/export/l10n_sessions.rb:      def method_missing(*args)
lib/oddb/html/state/drugs/result.rb:    def method_missing(key, *args, &block)
lib/oddb/html/state/global.rb:  def method_missing(mth, *args)
lib/oddb/html/util/annotated_list.rb:  def method_missing(key, *args)
lib/oddb/html/util/know_it_all.rb:  def method_missing name, *args, &block
lib/oddb/html/util/known_user.rb:  alias :method_missing :remote_call
lib/oddb/html/util/unsaved_helper.rb:  def method_missing(key, *args, &block)
lib/oddb/model.rb:          if(predicate.action == :method_missing)
lib/oddb/model.rb:        Predicate.new(:method_missing, :delegate, *delegators)
lib/oddb/remote/object.rb:      def method_missing(*args, &block)
lib/oddb/util/annotated_list.rb:  def method_missing(key, *args)
lib/oddb/util/m10l_document.rb:      def method_missing(meth, *args, &block)
lib/oddb/util/multilingual.rb:      def method_missing(meth, *args, &block)

masa@masa ~/ywesee/oddb.org $ grep -r method_missing *
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
ext/fiparse/test/test_fachinfo_doc_parser.rb:    def method_missing(*args)
src/model/atcnode.rb:           def method_missing(*args)
src/model/user.rb:    def method_missing key
src/model/user.rb:    def method_missing(method, *args, &block)
src/plugin/plugin.rb:      def method_missing(*args)
src/plugin/ydim.rb:        @invoice_email = method_missing(:invoice_email) || email
src/plugin/ydim.rb:      def method_missing(method, *args, &block)
src/state/page_facade.rb:      def method_missing(name, *args, &block)
src/util/config.rb:             def method_missing(method, *args)
src/util/language.rb:           def method_missing(symbol, *args, &block)
src/util/persistence.rb:                        def method_missing(key, *args)
  • Oh my God!

Experiment /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb

    def method_missing(meth_symbol, *args, &block)
      if(NO_OVERRIDE.include?(meth_symbol))
        super
      else
print "odba_instance.class=", odba_instance.class, " "
print "meth_symbol=", meth_symbol, " "
print "args="
p args
        odba_instance.send(meth_symbol, *args, &block)
      end
    end

Result

odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
odba_instance.class=ODDB::Drugs::Package meth_symbol=active_agents args=[]
...

Conclusion

  • odba_instance.class is always ODBA::Drugs::Package when active_agents method is called

Next

  • How the odba_instance becomes ODBA::Drugs::Package instance
  • How odba_instance becomes nil (production server)
  • Namely trace odba_receiver method

Experiment

    def odba_receiver(name=nil)
      if(@receiver && !@receiver_loaded)
        warn "stub for #{@receiver.class}:#{@odba_id} was saved with receiver"
        @receiver = nil
      end
      @receiver || begin
      #begin
        @receiver = ODBA.cache.fetch(@odba_id, @odba_container)
        @receiver_loaded = true
        if(@odba_container)
          @odba_container.odba_replace_stubs(@odba_id, @receiver)
        else
          warn "Potential Memory-Leak: stub for #{@receiver.class}##{@odba_id} was saved without container"
        end
if @receiver == nil
  print "@odba_id="
  p @odba_id
  print "@odba_container="
  p @odba_container
  print "@odba_class="
  p @odba_class
end
        @receiver
      rescue OdbaError => e
        warn "ODBA::Stub was unable to replace #{@odba_class}##{@odba_id} from #{@odba_container.class}:##{@odba_container.odba_id}"
      end
    end

Conclustion

  • In my local, @receiver never becomes nil

BraSt

undefined method `active_agents' for nil:NilClass
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send'
(druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing'
(druby://localhost:10013) /var/www/oddb.org/src/model/part.rb:31:in `active_agents'

oddb.org/src/model/part.rb:31

    def active_agents
      @composition ? @composition.active_agents : []
    end

So

  • @composition may be nil, not odba_instance

Let's check @coposition.class

Experiment

oddb.org/src/model/part.rb:31

    def active_agents
print "@composition.class="
p @composition.class
      @composition ? @composition.active_agents : []
    end

Result

@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=NilClass
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=NilClass
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
@composition.class=ODDB::Composition
...

Notes

  • Most of them are ODDB::Conposition but there are some NilClass

Experiment

/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb

    def method_missing(meth_symbol, *args, &block)
      if(NO_OVERRIDE.include?(meth_symbol))
        super
      else
if meth_symbol.to_s == "active_agents"
  print "self.class=",self.class,"\n"
  pp caller(0)
  print "\n"
end

Run de.oddb.org/jobs/import_chde_xls

Result

self.class=ODDB::Part
["/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:129:in `method_missing'",
 "/home/masa/ywesee/oddb.org/src/model/package.rb:68:in `active_agents'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:395:in `inject'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `each'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `inject'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `send'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `method_missing'",
 "/home/masa/ywesee/oddb.org/src/model/package.rb:68:in `active_agents'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/drbwrapper.rb:28:in `__send__'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/drbwrapper.rb:28:in `method_missing'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'",
 "bin/readonlyd:15"]

self.class=ODDB::Composition
["/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:129:in `method_missing'",
 "/home/masa/ywesee/oddb.org/src/model/part.rb:36:in `active_agents'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `send'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `method_missing'",
 "/home/masa/ywesee/oddb.org/src/model/package.rb:68:in `active_agents'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:395:in `inject'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `each'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `inject'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `send'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:139:in `method_missing'",
 "/home/masa/ywesee/oddb.org/src/model/package.rb:68:in `active_agents'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/drbwrapper.rb:28:in `__send__'",
 "/usr/lib64/ruby/site_ruby/1.8/odba/drbwrapper.rb:28:in `method_missing'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'",
 "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'",
 "bin/readonlyd:15"]
....

Consideration

  • The class is alway ODDB::Composition when method_missing is called from oddb.org/src/model/part.rb:36

Hypothesis

  • It might be different class on production server

I found a error log on production server

$ vim /service/ch.oddb-readonly/log/main/current

@400000004cb9dd2a019714e4 ODBA::Stub was unable to replace Array#9463432 from ODDB::Package:#245942
@400000004cb9df1d0038b594 ODBA::Stub was unable to replace Array#9449164 from ODDB::Package:#764258
@400000004cb9ef1915254ea4 ODBA::Stub was unable to replace Array#9463432 from ODDB::Package:#245942
@400000004cb9f8ce0941c61c ODBA::Stub was unable to replace Array#9463420 from ODDB::Package:#245937
@400000004cba00193b4a5a34 ODBA::Stub was unable to replace Array#23430427 from ODDB::Package:#23430426
@400000004cba138f174a9004 ODBA::Stub was unable to replace Array#23430427 from ODDB::Package:#23430426
@400000004cba15382366475c ODBA::Stub was unable to replace Array#9463420 from ODDB::Package:#245937
@400000004cba160f12b4910c ODBA::Stub was unable to replace Array#9463425 from ODDB::Package:#245939
@400000004cba189125343d14 ODBA::Stub was unable to replace Array#9449164 from ODDB::Package:#764258
@400000004cba26b3020c5484 ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cba2bc33b6bdc54 ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cba39232be00864 ODBA::Stub was unable to replace Array#23430427 from ODDB::Package:#23430426
@400000004cba590121437ae4 ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cba9f0a0d66c364 ODBA::Stub was unable to replace Array#9463420 from ODDB::Package:#245937
@400000004cbaa81b049afe44 ODBA::Stub was unable to replace Array#9463432 from ODDB::Package:#245942
@400000004cbaa88b099331dc ODBA::Stub was unable to replace Array#9469045 from ODDB::Package:#220264
@400000004cbab3603a0fbf24 ODBA::Stub was unable to replace Array#9463432 from ODDB::Package:#245942
@400000004cbab97f2984690c ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cbacea828592f7c ODBA::Stub was unable to replace Array#9463425 from ODDB::Package:#245939
@400000004cbad267293a775c ODBA::Stub was unable to replace Array#23430427 from ODDB::Package:#23430426
@400000004cbafcac17246a64 ODBA::Stub was unable to replace Array#23430427 from ODDB::Package:#23430426
@400000004cbafcbb01e2335c ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cbb1061024db2e4 ODBA::Stub was unable to replace Array#9463425 from ODDB::Package:#245939
@400000004cbb296a2dd57b7c ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cbb2bbd21ba9afc ODBA::Stub was unable to replace Array#9470958 from ODDB::Package:#1439602
@400000004cbb2eb72e843dc4 ODBA::Stub was unable to replace Array#9470958 from ODDB::Package:#1439602
@400000004cbb360607fcd684 ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cbb52e004d5925c ODBA::Stub was unable to replace Array#9463432 from ODDB::Package:#245942
@400000004cbb5ab80039de74 ODBA::Stub was unable to replace Array#23430427 from ODDB::Package:#23430426
@400000004cbbc6fd1d6496ec ODBA::Stub was unable to replace #707655 from ODDB::Package:#213239
@400000004cbbc6fd1d691f14 ODBA::Stub was unable to replace #707655 from ODDB::Package:#213239
@400000004cbbc6fd1d6d514c ODBA::Stub was unable to replace #707655 from ODDB::Package:#213239
@400000004cbbc6fd1e94a2dc ODBA::Stub was unable to replace #707654 from ODDB::Package:#213238
@400000004cbbc6fd1e994e2c ODBA::Stub was unable to replace #707654 from ODDB::Package:#213238
@400000004cbbc6fd1e9db32c ODBA::Stub was unable to replace #707654 from ODDB::Package:#213238
@400000004cbbc72c1ca24ca4 ODBA::Stub was unable to replace #707655 from ODDB::Package:#213239
@400000004cbbc72c1ca76d24 ODBA::Stub was unable to replace #707655 from ODDB::Package:#213239
@400000004cbbc72c1cac56f4 ODBA::Stub was unable to replace #707655 from ODDB::Package:#213239
@400000004cbbc72c1dc8ac04 ODBA::Stub was unable to replace #707654 from ODDB::Package:#213238
@400000004cbbc72c1dcda18c ODBA::Stub was unable to replace #707654 from ODDB::Package:#213238
@400000004cbbc72c1dd1fad4 ODBA::Stub was unable to replace #707654 from ODDB::Package:#213238
@400000004cbc422823fb4fb4 ODBA::Stub was unable to replace Array#9460325 from ODDB::Package:#255084
@400000004cbc8f9b2b10ba14 ODBA::Stub was unable to replace Array#9472304 from ODDB::Package:#237347
@400000004cbe313105eb7ecc ODBA::Stub was unable to replace Array#9470958 from ODDB::Package:#1439602
@400000004cbe8a1a1018b464 ODBA::Stub was unable to replace ODDB::Composition#9437477 from ODDB::Part:#9437480
@400000004cbed9862d8dbc4c ODBA::Stub was unable to replace Array#9469045 from ODDB::Package:#220264
@400000004cbee8ea3286e214 ODBA::Stub was unable to replace Array#9497102 from ODDB::Package:#220633

These error message come from

/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb

    def odba_receiver(name=nil)
      if(@receiver && !@receiver_loaded)
        warn "stub for #{@receiver.class}:#{@odba_id} was saved with receiver"
        @receiver = nil
      end
      @receiver || begin
      #begin
        @receiver = ODBA.cache.fetch(@odba_id, @odba_container)
        @receiver_loaded = true
        if(@odba_container)
          @odba_container.odba_replace_stubs(@odba_id, @receiver)
        else
          warn "Potential Memory-Leak: stub for #{@receiver.class}##{@odba_id} was saved without container"
        end
        @receiver
      rescue OdbaError => e
        warn "ODBA::Stub was unable to replace #{@odba_class}##{@odba_id} from #{@odba_container.class}:##{@odba_container.odba_id}"
      end
    end

Notes

  • It looks that OdbaError happens in method_missin method

If I run export_chde_xls again on production server,

@400000004cbef5ec2be91c9c ODBA::Stub was unable to replace ODDB::Composition#9437477 from ODDB::Part:#9437480

is added in /service/ch.oddb-readonly/log/main/current

Question

  • Why is the method_missing method called even though there is a definition of active_agents in ODDB::Compostion class?

src/model/composition.rb

module ODDB
  class Composition
    include Persistence
    include Comparable
    attr_accessor :sequence, :source, :label
    attr_reader :galenic_form, :active_agents

Experiment (in my local)

oddb.org/src/model/part.rb

    def active_agents
print "@composition.class="
p @composition.class
if @compostion.class == ODDB::Composition
  print "@compostion.active_agents="
  p @compostion.active_agents
end
      @composition ? @composition.active_agents : []
    end

Result


view · edit · sidebar · attach · print · history
Page last modified on February 16, 2011, at 08:59 AM