<< | Index | >>
---
(2 PM) Still waiting for the new PC to come, but thinking about how to bring up the new machine.
Steps to bring up a new machines are:
Testing the vagrant on a freshly checkout virtualbox I remarked that the old way of installing yus under ruby 1.8 did not work any longer, as some old gems could no longer be installed via emerge. Therefore I reworked my install_yus.sh using the insights gained in the last few months namely.
bundle exec ruby18 bin/yusd
to avoid runtime errors
Even after this changes I remarked that after sudo eselect ruby set ruby18
yusd started okay, but after a sudo eselect ruby set ruby19
it failed.
No my new VM runs oddb.org without any problems and I was able to reset my admin password. See patch Fixed running yusd under ruby18
Calling jobs/rebuild_indices on my VM returned after 40 seconds. Investigation showed, that the name passed to src/util/oddbapp.rb rebuild_indices was an empty string and not nil. Pushed fix Fix rebuild_indices if no name given
Adapting jobs/import_swissmedic and src/util/updater.rb to provoke the error as soon as possible. But it took over 3 hours till I got there. Will add more debug info and restart the run again.
Makeing unit tests working in logical order
Making the unit tests passed involved changing small things. Created a new branch https://github.com/ngiger/yus/commits/without_needle with a single commit Trying to make yus work without needle gem.
Will test the stuff on the my VM. Runninb bin/oddbd fails with now with the following error
process: Oddb (OddbApp) init system /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing': undefined method `update' for Ledermix Eugenol N, Lösung:ODDB::Sequence (NoMethodError) from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:590:in `block in update_indices' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `each' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `update_indices' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:515:in `store' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:274:in `odba_isolated_store' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:395:in `block in odba_store_unsaved' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `each' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `odba_store_unsaved' from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:380:in `odba_store' from /var/www/oddb.org/src/util/oddbapp.rb:1423:in `initialize' from bin/oddbd:42:in `new' from bin/oddbd:42:in `<main>'
Changing the /var/www/oddb.org/Gemfile to use the branch of yus, change yus specification to gem "yus", :git => 'https://github.com/ngiger/yus.git', :branch => 'without_needle'
.
Unfortunately use is not yet conform to the bundler world, as I get the following error:
Could not find gem 'yus (>= 0) ruby' in https://github.com/ngiger/yus.git (at without_needle). Source does not contain any versions of 'yus (>= 0) ruby'
The unit tests work on my developer machine for Ruby 1.8, 1.9 and 2.0. But they fail on Travis-CI because cracklib could not be installed. Commit this patch Added group yus_runtime to avoid errors on travis-ci to fix this problem.
Okay, consulting the Bundler documentation for gem from git http://bundler.io/v1.5/git.html , I see that I must artificially specify a version from the git gem. E.g gem "yus", '1.0.2.alpha', :git => 'https://github.com/ngiger/yus.git', :branch => 'without_needle'
But I still get the same error when launching bin/oddbd. Therefore I try to use the old yusd again. The error about the missing "update" disappeared after reloading the postgres database. However afterward I get the following error in bin/oddbd
error in SBSM::Session#process: /de/gcc NoMethodError undefined method `digest' for nil:NilClass (drbssl://localhost:9997) /opt/src/yus/lib/yus/session.rb:295:in `generate_token' (drbssl://localhost:9997) /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/drbwrapper.rb:28:in `method_missing' (drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' (drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform' (drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' error in SBSM::Session#process: /de/gcc
Note: I had clone without_needle branch of yus into /opt/src/yus/. At the same time bin/yusd
reported:
I, [2013-11-11T21:05:07.497441 #9281] INFO -- start: starting yus-server on drbssl://localhost:9997 W, [2013-11-11T21:10:38.003502 #9281] WARN -- Yus::Server: Token-Authentication failed for ngiger@ywesee.com I, [2013-11-11T21:10:41.439912 #9281] INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org I, [2013-11-11T21:10:41.440187 #9281] INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com I, [2013-11-11T21:10:43.727902 #9281] INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org I, [2013-11-11T21:10:43.728000 #9281] INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com I, [2013-11-11T21:10:49.185800 #9281] INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org I, [2013-11-11T21:10:49.185970 #9281] INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com
Looking at the tests for yus I find that we have no call to generate_token in the test directory. Therefore it is time to activate a coverage report, analysing it and adding the missing tests. Added commit Added default configuration
After pushing/getting these changes and restarting yusd and bin/oddb. I try to enter my login credentials and got the following (good) result for yusd w
I, [2013-11-11T22:17:42.263479 #10176] INFO -- start: starting yus-server on drbssl://localhost:9997 W, [2013-11-11T22:21:11.403687 #10176] WARN -- Yus::Server: Token-Authentication failed for ngiger@ywesee.com I, [2013-11-11T22:22:44.950147 #10176] INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org I, [2013-11-11T22:22:44.950643 #10176] INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com
but bin/oddb reported the following failure
error in SBSM::Session#process: /de/gcc NoMethodError undefined method `hexdigest' for 1:Fixnum (drbssl://localhost:9997) /opt/src/yus/lib/yus/session.rb:290:in `generate_token' (drbssl://localhost:9997) /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/drbwrapper.rb:28:in `method_missing' (drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' (drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform' (drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
Therefore my default configuration is used. Why didn't we use the real configuration? Does the persistance not work correctly?