view · edit · sidebar · attach · print · history

< Niklaus.20160525-evidentia-icons | Index | Niklaus.20160523-sandoz-bbmb >>

20160524-sandoz-bbmb

Summary

  • Setup sandoz.bbmb.ch on oddb-ci2

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
  • Order of entering search type and value should not matter. Both should show long URL with search
  • Remove parser for minifi (but keep the minifi)
  • BSV-Plugin does not send mail. Is it sending two mails at once?
  • remove obsolete pdf_patinfo in model, admin/views
  • Fix sbsm/htmlgrid when DEFAULT_FLAVOUR is nil

Setup sandoz.bbmb.ch on oddb-ci2

Removed two dockerfiles, which I wrongly added with my previous commit. See Removed Dockerfiles which I used for testing

Investigating whether it is possible to test all the bin/yus_* commands without using a persistent storage. E.g. bbmb has a file lib/bbmb/persistence/none.rb. Would such an approach also work with yus? Oh yes! There is a file lib/yus/persistence/og.rb which seems to achieve exactly this. But I cannot find anywhere a implementation of Og (google found only http://scm.ywesee.com/?p=ch.oddb.org/.git;a=patch;h=refs/tags/0.9). But I think it should not be too difficult to write an mock implementation. But may be it would be easier to use/revive sqlite3 as a backend for odba for unit tests. Or use ruby YAML::Store to use a simple to debug yml file. Abandoning the idea to write unit tests for the moment.

But running /usr/local/bin/yus_show --server_url=druby://localhost:12005 ngiger@ywesee.com still access the default yusd on port 9997 and not the yusd for bbmb running at port 12005. Why? Fixed the problem. Found more problems which were fixed by commit Fixed error running yus_show, yus_dump and yus_passwd

After reloading the sandoz_yus-2016-05-17-backup.gz I get the following error in /service/sandoz.bbmb.ch-yus/log/main/current

@400000005744258a2217a364 /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `initialize' may cause serious problems
@400000005744258a2217d244 /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `object_id' may cause serious problems
@400000005744258a2217d62c /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `__send__' may cause serious problems
@400000005744258a23a655cc FEHLER:  Relation »object« existiert bereits
@400000005744258a23ad56c4 FEHLER:  Relation »prefetchable_index« existiert bereits
@400000005744258a23b2d8ec FEHLER:  Relation »extent_index« existiert bereits
@400000005744258a23b6ad64 FEHLER:  Relation »object_connection« existiert bereits
@400000005744258a23bbf4f4 FEHLER:  Relation »target_id_index« existiert bereits
@400000005744258a23be90ec FEHLER:  Relation »collection« existiert bereits
@400000005744258a2513822c /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:15:in `load': undefined class/module Encoding::Character:: (ArgumentError)
@400000005744258a25140ecc       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:15:in `load'
@400000005744258a251412b4       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:629:in `restore'
@400000005744258a251412b4       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:319:in `block in fetch_or_restore'
@400000005744258a2514169c       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do'
@400000005744258a2514169c       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:318:in `fetch_or_restore'
@400000005744258a25142254       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:66:in `block in bulk_restore'
@400000005744258a25142254       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:63:in `each'
@400000005744258a2514263c       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:63:in `bulk_restore'
@400000005744258a2514263c       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:57:in `bulk_fetch'
@400000005744258a25144d4c       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:261:in `fetch_collection'
@400000005744258a25145134       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:633:in `restore'
@400000005744258a25145134       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:319:in `block in fetch_or_restore'
@400000005744258a251460d4       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do'
@400000005744258a251460d4       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:318:in `fetch_or_restore'
@400000005744258a251464bc       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:305:in `block in fetch_named'
@400000005744258a251464bc       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do'
@400000005744258a25146c8c       from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:297:in `fetch_named'
@400000005744258a25146c8c       from /usr/local/lib/ruby/gems/2.3.0/gems/yus-1.0.3/lib/yus/persistence/odba.rb:14:in `initialize'
@400000005744258a25147074       from /usr/local/lib/ruby/gems/2.3.0/gems/yus-1.0.3/bin/yusd:54:in `new'
@400000005744258a25147074       from /usr/local/lib/ruby/gems/2.3.0/gems/yus-1.0.3/bin/yusd:54:in `<top (required)>'
@400000005744258a25147844       from /usr/local/bin/yusd:23:in `load'
@400000005744258a25147844       from /usr/local/bin/yusd:23:in `<main>'

Looks like I have to migrate the YUS database, too. Changed bin/yus_dump to use a root session to dump all entities. Some of them contain UTF-8 characters (e.g. adresses like Zürich). But migration still failes with

2016-05-24 15:00:36 +0200: Loading /mnt/src/yus/bin/migrate_to_utf_8
Ignoring ffi-1.9.10 because its extensions are not built.  Try: gem pristine ffi --version 1.9.10
Ignoring byebug-8.2.4 because its extensions are not built.  Try: gem pristine byebug --version 8.2.4
Ignoring ffi-1.9.10 because its extensions are not built.  Try: gem pristine ffi --version 1.9.10
/usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `initialize' may cause serious problems
/usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `object_id' may cause serious problems
/usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `__send__' may cause serious problems
FEHLER:  Relation &#65533;object&#65533; existiert bereits
FEHLER:  Relation &#65533;prefetchable_index&#65533; existiert bereits
FEHLER:  Relation &#65533;extent_index&#65533; existiert bereits
FEHLER:  Relation &#65533;object_connection&#65533; existiert bereits
FEHLER:  Relation &#65533;target_id_index&#65533; existiert bereits
FEHLER:  Relation &#65533;collection&#65533; existiert bereits
I, [2016-05-24T15:00:37.715842 #30527]  INFO -- Yus::Server: Authentication succeeded for root: ngiger@ywesee.com
2016-05-24 15:00:37 +0200: Start migrating 587 entities
FEHLER:  Relation &#65533;object&#65533; existiert bereits
FEHLER:  Relation &#65533;prefetchable_index&#65533; existiert bereits
FEHLER:  Relation &#65533;extent_index&#65533; existiert bereits
FEHLER:  Relation &#65533;object_connection&#65533; existiert bereits
FEHLER:  Relation &#65533;target_id_index&#65533; existiert bereits
FEHLER:  Relation &#65533;collection&#65533; existiert bereits
149: ignoring Yus::Privilege
force_encoding from ISO_8859_1 ASCII-8BIT. is now regulabinder@sunrise.ch
force_encoding from ISO_8859_1 ASCII-8BIT. is now edc52c3c210992fdc5c6b0ec21bd10a3c8a52e1b3c45a8cc2867bbb1afd7699a
149: ignoring Hash
marshal.rb:10 obj #<Yus::Entity:0x0000000161c898 @odba_observers=nil, @odba_persistent=true, @privileges={"set_password"=>#<Yus::Privilege:0x000000027be358 @items={"regulabinder@sunrise.ch"=>:never}>}, @affiliations=#<ODBA::Stub:11574560#1184 @odba_class=Array @odba_container=11592780#433>, @valid_from=2008-10-17 23:27:53 +0200, @last_logins={"oddb.org"=>2008-10-17 23:27:55 +0200}, @name="regulabinder@sunrise.ch", @valid_until=nil, @passhash="edc52c3c210992fdc5c6b0ec21bd10a3c8a52e1b3c45a8cc2867bbb1afd7699a", @odba_id=433, @preferences={"oddb.org"=>{:name_last=>"Binder", :salutation=>"salutation_f", :name_first=>"Regula"}, "global"=>{}}, @tokens={}>
/usr/local/lib/ruby/2.3.0/drb/drb.rb:393:in `_dump': can't dump (TypeError)
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:12:in `dump'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:12:in `dump'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:269:in `odba_isolated_dump'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:511:in `store'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:274:in `odba_isolated_store'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:395:in `block in odba_store_unsaved'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:392:in `each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:392:in `odba_store_unsaved'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:380:in `odba_store'
        from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/drbwrapper.rb:28:in `method_missing'
        from /mnt/src/yus/bin/migrate_to_utf_8:73:in `_migrate_to_utf8'
        from /mnt/src/yus/bin/migrate_to_utf_8:171:in `<main>'

Why the hell is it impossible to save the changed entity? Or shall I create a yus_load which could load the UTF-8 yaml file generated by yus_dump?

Trying to run yus with Ruby 1.8.6 again. This does not work as I no longer have a gem186 command laying around. And gem was not compiled when compiling ruby 1.8.6.

Trying rbenv install 1.8.6-p383 and rbenv install 1.8.6-p420. Following instructions by zdavatz https://github.com/rbenv/ruby-build/issues/88 to compile

wget http://www.openssl.org/source/openssl-0.9.8zb.tar.gz
tar xzf openssl-0.9.8zb.tar.gz
cd openssl-0.9.8zb
./config --prefix=/usr/local
make
make install

CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" \
  RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/bin" \
  MAKEOPTS="" rbenv install 1.8.6-p420

Also on thinpower I am no longer able to list all the 1.8.6 gems as I get

ywesee@thinpower ~ $ gem186 list
/usr/local/bin/gem186:8:in `require': no such file to load -- rubygems (LoadError)
        from /usr/local/bin/gem186:8

Now using in /usr/local/src/yus18 rbenv local 1.8.6-p420, gem install yus --version=1.0.0, gem install rclconf, gem install odba --version=1.0.0, gem install dbi --version=0.4.5. But dbi must point to our special version of (ydbi) or a the git checkout. I think I must add these into the site_ruby of the rbenv and show how I can use rbenv safely inside the apache user.

TODO: for tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on May 24, 2016, at 07:24 PM