view · edit · sidebar · attach · print · history

Index>

20141124-doctors-view

Summary

  • Doctors view must show new fields from medreg import
  • Create docker container for oddb.org with ruby 2.1

Commits

(in medreg branch)

Index

Keep in Mind
  • 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!

---

Doctors view must show new fields from medreg imports

Import of medreg doctors failed twice in the last few days. The first time because of a non responding medregom service

2014-11-22 20:19:02 +0100:  MedregDoctorPlugin Start saving @app.doctors.odba_store
2014-11-22 20:19:04 +0100:  MedregDoctorPlugin Finished @app.doctors.odba_store
2014-11-22 20:19:15 +0100:  MedregDoctorPlugin Saved 15707 doctors in /var/www/oddb.org/data/txt/doctors_2014.11.20-1225.yaml

The second time with an error whil saving the doctors info

2014-11-22 21:46:36 +0100:  MedregDoctorPlugin Searching for doctor with GLN 7601000361080. Skipped 17555, created 1 updated 6 of 33139).
RuntimeError: can't modify frozen String when updating index 'doctor_index' with a ODDB::Doctor
["/var/www/oddb.org/src/util/searchterms.rb:91:in `force_encoding'", "/var/www/oddb.org/src/util/searchterms.rb:91:in `block in search_terms'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `each'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `inject'"]
[...]

RuntimeError: can't modify frozen String when updating index 'doctor_index' with a ODDB::Doctor
["/var/www/oddb.org/src/util/searchterms.rb:91:in `force_encoding'", "/var/www/oddb.org/src/util/searchterms.rb:91:in `block in search_terms'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `each'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `inject'"]
[...]
2014-11-22 21:46:44 +0100:  MedregDoctorPlugin Searching for doctor with GLN 7601000361103. Skipped 17555, created 2 updated 6 of 33139).
failsafe rescued DBI::ProgrammingError < StandardError
message contents do not agree with length in message type "n"
lost synchronization with server: got message type "I", length 1314080082
/usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:62:in `rescue in execute'
/usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:37:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/statement.rb:116:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:263:in `block in ensure_object_connections'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:262:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:262:in `ensure_object_connections'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:553:in `store_object_connections'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:512:in `store'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:274:in `odba_isolated_store'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:395:in `block in odba_store_unsaved'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `odba_store_unsaved'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:380:in `odba_store'
/var/www/oddb.org/src/util/persistence.rb:226:in `issue_create'
/var/www/oddb.org/src/util/oddbapp.rb:111:in `block in create'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:110:in `create'
/var/www/oddb.org/src/util/persistence.rb:288:in `block in resolve'
/var/www/oddb.org/src/util/persistence.rb:278:in `each'
/var/www/oddb.org/src/util/persistence.rb:278:in `resolve'
/var/www/oddb.org/src/util/persistence.rb:256:in `issue_update'
/var/www/oddb.org/src/util/oddbapp.rb:132:in `block in update'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:130:in `update'
/var/www/oddb.org/src/util/oddbapp.rb:1566:in `update'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:391:in `store_doctor'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:207:in `block in get_one_doctor'
/var/www/oddb.org/src/util/resilient_loop.rb:63:in `call'
/var/www/oddb.org/src/util/resilient_loop.rb:63:in `block in try_run'
/usr/local/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
/usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/var/www/oddb.org/src/util/resilient_loop.rb:62:in `try_run'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:154:in `get_one_doctor'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:228:in `block in get_detail_to_glns'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:217:in `each'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:217:in `get_detail_to_glns'
/var/www/oddb.org/src/plugin/medreg_doctor.rb:92:in `update'
/var/www/oddb.org/src/util/updater.rb:237:in `block in update_medreg_doctors'
/var/www/oddb.org/src/util/updater.rb:526:in `call'
/var/www/oddb.org/src/util/updater.rb:526:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:235:in `update_medreg_doctors'
jobs/import_regmed_doctors:14:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_regmed_doctors:12:in `<module:Util>'
jobs/import_regmed_doctors:11:in `<module:ODDB>'
jobs/import_regmed_doctors:10:in `<main>'

I am having the problem, that I the setup on oddb-ci2 is broken and I get only a Internal Server Error and Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. and no entry in the apache error_log/access_log. What is going on here?

But in /var/www/oddb.org/log/oddb/error.log I found

[Mon Nov 24 10:19:04 2014] [error] mod_ruby:   from /usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `handler'
[Mon Nov 24 10:19:04 2014] [error] [client 172.25.1.75] File does not exist: /var/www/oddb.org/doc/var
[Mon Nov 24 10:28:12 2014] [error] mod_ruby: error in ruby
[Mon Nov 24 10:28:12 2014] [error] mod_ruby: /usr/lib64/ruby/1.9.1/rubygems.rb:30:in `require': cannot load such file -- rubygems/defaults (LoadError)
[Mon Nov 24 10:28:12 2014] [error] mod_ruby:   from /usr/lib64/ruby/1.9.1/rubygems.rb:30:in `<top (required)>'
[Mon Nov 24 10:28:12 2014] [error] mod_ruby:   from /var/www/oddb.org/doc/index.rbx:6:in `require'
[Mon Nov 24 10:28:12 2014] [error] mod_ruby:   from /var/www/oddb.org/doc/index.rbx:6:in `<top (required)>'
[Mon Nov 24 10:28:12 2014] [error] mod_ruby:   from /usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `load'
[Mon Nov 24 10:28:12 2014] [error] mod_ruby:   from /usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `handler'
[Mon Nov 24 10:28:12 2014] [error] [client 172.25.1.70] File does not exist: /var/www/oddb.org/doc/var

Therefore removing and reinstalling the gems must have broken some stuff. Tried to recompile mod_ruby from scratch

git clone https://github.com/shugo/mod_ruby.git
cd mod_ruby
./configure.rb
<adde manually  -I/usr/include/apr-1 to line APACHE_INCLUDES = -I/usr/include/apache2 
make
<..>
/usr/local/lib/libruby-static.a: could not read symbols: Bad value
collect2: ld gab 1 als Ende-Status zurück
Makefile:182: recipe for target 'mod_ruby.so' failed

I am getting sick chasing installation problem on funtoo, because we are so much behind as we cannot use ruby 2.1. There fore decided to create a docker container for oddb.org with ruby 2.1.

Trying to solve mod-ruby problem by redoing the work done when installing with puppet/vagrant see https://github.com/ngiger/vagrant-oddb_org/blob/master/protocol.textile, running as root

eselect ruby set ruby19
emerge =apache-2.2.26
cd /opt/src/mod_ruby # where I still have copy of my source
./configure.rb --with-apxs --with-apr-includes=/usr/include/apr-1
make 
make install
/etc/init.d/apache2 restart
 * apache2 has detected an error in your setup:
Syntax error on line 7 of /etc/apache2/vhosts.d/oddb.conf:
Invalid command 'RubyAddPath', perhaps misspelled or defined by a module not included in the server configuration
 * ERROR: apache2 failed to stop

grep -r RUBY /etc/conf.d/
/etc/conf.d/apache2:APACHE2_OPTS="-D RUBY -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"

Somehow emerge forgot to install mod_ruby even when RUYBB is specified in the APACHE2_OPTS. Why?

Emerge mod_ruby fails because it uses ruby18

 emerge mod_ruby

 * IMPORTANT: config file '/etc/portage/package.license' needs updating.
 * See the CONFIGURATION FILES section of the emerge
 * man page to learn how to update config files.
Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) www-apache/mod_ruby-1.3.0
 * mod_ruby-1.3.0.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                                        [ ok ]
>>> Unpacking source...
>>> Unpacking mod_ruby-1.3.0.tar.gz to /var/tmp/portage/www-apache/mod_ruby-1.3.0/work
>>> Source unpacked in /var/tmp/portage/www-apache/mod_ruby-1.3.0/work
>>> Compiling source in /var/tmp/portage/www-apache/mod_ruby-1.3.0/work/mod_ruby-1.3.0 ...
ruby18: no such file to load -- auto_gem (LoadError)
make -j13 
make: *** No targets specified and no makefile found.  Stop.
emake failed
 * ERROR: www-apache/mod_ruby-1.3.0 failed (compile phase):
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_compile
 *   environment, line 905:  Called die
 * The specific snippet of code:
 *       emake || die "emake failed";
 * 
 * If you need support, post the output of `emerge --info '=www-apache/mod_ruby-1.3.0'`,
 * the complete build log and the output of `emerge -pqv '=www-apache/mod_ruby-1.3.0'`.
 * The complete build log is located at '/var/tmp/portage/www-apache/mod_ruby-1.3.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_ruby-1.3.0/temp/environment'.
 * Working directory: '/var/tmp/portage/www-apache/mod_ruby-1.3.0/work/mod_ruby-1.3.0'
 * S: '/var/tmp/portage/www-apache/mod_ruby-1.3.0/work/mod_ruby-1.3.0'

>>> Failed to emerge www-apache/mod_ruby-1.3.0, Log file:
<..>

Funtoo drives me crazy!

Create docker container for oddb.org with ruby 2.1

view · edit · sidebar · attach · print · history
Page last modified on November 24, 2014, at 09:42 PM