view · edit · sidebar · attach · print · history

Index>

20170419-virbac

Summary

  • Port virbac to use SBSM with rack
  • Fix error parsing drugshortage
  • Must show Teilbarkeit again
  • Error in /service/log/ch.oddb/log/main/current
  • Keep in Mind

Commits

Index

Port virbac to use SBSM with rack

Trying to make the login/logout work. When connecting to http://virbac_rack.ngiger.ch/ I never get a result. Why? After pressing Escape I see the login, but the images are not displayed correctly.

Analysing the context I see the following code <IMG src=" alt=Virbac" name="logo">. Looks like the base URL is not resolved correctly. Why? On the console I see ERROR:navigation_entry_screenshot_manager.cc(135)] Invalid entry with unique id: 117. The @session.server_name is nil for BBMB::Html::Util::Session. Fixed by adding the line @server_name = rack_request.env['SERVER_NAME'] in the method process_rack of lib/sbsm/session.rb.

Fixed a problem that the Virbac Validator was not used. Now the login fails differently. BBMB.auth is nil in /home/niklaus/git/bbmb/lib/bbmb/util/server.rb at line 190.

Will continue tomorrow.

Error in /service/log/ch.oddb/log/main/current

Found

4000000058f7009105538c5c error in SBSM::Session#to_html: /
@4000000058f70091055fa604 NoMethodError
@4000000058f70091055fd4e4 undefined method `[]' for nil:NilClass
@4000000058f70091056120ec /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/dojotoolkit.rb:50:in `dynamic_html'
@4000000058f7009105614414 /var/www/oddb.org/src/view/htmlgrid/component.rb:14:in `dynamic_html'
@4000000058f700910561579c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/link.rb:51:in `to_html'
@4000000058f7009105615b84 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:89:in `block in component_html'
@4000000058f700910562037c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:87:in `each'
@4000000058f7009105620764 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:87:in `component_html'
@4000000058f7009105620b4c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:106:in `block in to_html'
@4000000058f7009105621704 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:55:in `nO_element'
@4000000058f7009105621704 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:62:in `nO_element_def'
@4000000058f7009105621704 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:105:in `to_html'
@4000000058f7009105621aec /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:142:in `block in field_html'
@4000000058f70091056222bc /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:140:in `each'
@4000000058f7009105623644 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:140:in `field_html'
@4000000058f7009105623a2c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:131:in `block in to_html'
@4000000058f7009105623a2c /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:55:in `nO_element'
@4000000058f7009105623e14 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:62:in `nO_element_def'
@4000000058f7009105625d54 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:130:in `to_html'
@4000000058f700910562613c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:280:in `block (2 levels) in to_html'
@4000000058f70091056274c4 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:280:in `collect'
@4000000058f700910562884c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:280:in `block in to_html'
@4000000058f7009105629bd4 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:15:in `nn_element'
@4000000058f700910562bb14 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:21:in `nn_element_def'
@4000000058f700910562da54 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:279:in `to_html'
@4000000058f700910562f994 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/composite.rb:267:in `to_html'
@4000000058f70091056318d4 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:89:in `block in component_html'
@4000000058f7009105633814 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:87:in `each'
@4000000058f7009105635754 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:87:in `component_html'
@4000000058f700910563824c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:106:in `block in to_html'
@4000000058f7009105638634 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:55:in `nO_element'
@4000000058f70091056399bc /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:62:in `nO_element_def'
@4000000058f7009105639da4 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:105:in `to_html'
@4000000058f700910563b12c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:142:in `block in field_html'
@4000000058f700910563c4b4 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:140:in `each'
@4000000058f700910563c4b4 /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:140:in `field_html'
@4000000058f700910563d83c /var/www/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.3/lib/htmlgrid/grid.rb:131:in `block in to_html'
@4000000058f700910563ebc4 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:55:in `nO_element'
@4000000058f70091056435fc /usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/html.rb:62:in `nO_element_def'
current [1] RO 1-1, 521 of 553, (61277) 94% 0x40 (64)                                                                                                                                                                                                                          

The problem stems from the fact that parsing the user_agent for the MS Internet explorer does not work correctly. Fixed the unit tests, the problem and added a new unit test for the problem.

We do not seem to have may IE users, as they would only see "NoMethodError undefined method `[]' for nil:NilClass" when accessing ch.oddb.org.

Pushed commits:

As htmlgrid 1.1.4 is released, I could fix the error on oddb.org with the commit Require htmlgrid >= 1.1.4 to fix access via MS Internet Explorer

Fix error parsing drugshortage

The format of the drugshortage HTML has changed. Adapting the parser.

I am unable to reproduce the error here. Tried againg after scp of yesterday /var/www/oddb.org/data/html/drugshortage-2017.04.18.html. Same result. Adding a pry statement on thinspower and starting it there.

Copying drugshortage-2017.04.18.html to drugshortage-latest.html and running sudo -u apache /usr/local/bin/bundle-240 exec ruby-240 jobs/import_daily manually on thinpower did not reproduce the problem seen as e-mail

Plugin: ODDB::ShortagePlugin

Error: RuntimeError
Message: unable to parse
https://www.drugshortage.ch/UebersichtaktuelleLieferengpaesse2.aspx
Backtrace:
/var/www/oddb.org/src/plugin/shortage.rb:145:in `update_drugshortage'
/var/www/oddb.org/src/plugin/shortage.rb:49:in `update'
/var/www/oddb.org/src/util/updater.rb:369:in `block in update_drugshortage'
/var/www/oddb.org/src/util/updater.rb:543:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:367:in `update_drugshortage'
/var/www/oddb.org/src/util/updater.rb:207:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

Must show Teilbarkeit again

A view like http://oddb-ci2.dyndns.org/de/gcc/show/reg/31706/seq/01 should show the Teilbarkeit This is not the case. bin/admin shows

ch.oddb> registration('31706').sequence('01').division.empty?
-> true

Okay. Found that the sequence 02 is not empty

ch.oddb> registration('31706').sequence('02').division.empty?
-> false
ch.oddb> registration('31706').sequence('02').division.divisable
-> Ja (Bruchrille)
ch.oddb> registration('31706').sequence('02').division.crushable
-> Ja
ch.oddb> registration('31706').sequence('02').division.notes
-> 
ch.oddb> registration('31706').sequence('02').division.openable
-> --
ch.oddb> registration('31706').sequence('02').division.dissolvable
-> Ja
ch.oddb> registration('31706').sequence('02').division.source
-> 

For http://oddb-ci2.dyndns.org/de/gcc/show/reg/31706/seq/02 we see a chapter title "Teilbarkeit" but it does not contain any element. Why?

Pushed commit Display teilbarkeit for non-admin users. Verified with http://ch.oddb.org/de/gcc/show/reg/31706/seq/02

view · edit · sidebar · attach · print · history
Page last modified on April 19, 2017, at 05:37 PM