view · edit · sidebar · attach · print · history

< Niklaus.20170829-error-pricehistory | Index | Niklaus.20170823-patinfo-changelog >>

20170823-patinfo-changelog

Summary

  • Fix Connection refused on port 10002 while running ImportDaily
  • Some patinfo do not display correctly
  • Fix undefined method en_US for #<ODDB::Fachinfo
  • Fix ArgumentError: comparison of Time with nil failed
  • Keep in Mind

Commits

Index

Fix Connection refused on port 10002 while running ImportDaily

We have seen the following eror

Plugin: ODDB::TextInfoPlugin

Error: DRb::DRbConnError
Message: druby://localhost:10002 - #<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 10002>
Backtrace:
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:745:in `rescue in block in open'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:739:in `block in open'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:738:in `each'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:738:in `open'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1248:in `initialize'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1228:in `new'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1228:in `open'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1141:in `block in method_missing'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1160:in `with_friend'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1140:in `method_missing'
/var/www/oddb.org/src/plugin/text_info.rb:1282:in `parse_textinfo'
/var/www/oddb.org/src/plugin/text_info.rb:1486:in `block in import_swissmedicinfo'
/var/www/oddb.org/src/plugin/text_info.rb:1485:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:1485:in `import_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:587:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:543:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:581:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:350:in `update_textinfo_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:215: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>'

Zeno reverted to git commit git checkout 6071f6800c92071 on August 25. The port 10002 belongs to the fiparser, which does not long work as verified by the following commands

thinpower oddb.org # grep -r :10002 src/ etc/
src/config.rb:  FIPARSE_URI = "druby://localhost:10002"
thinpower oddb.org # svstat /service/ch.oddb-fiparse/
/service/ch.oddb-fiparse/: up (pid 20328) 1 seconds
tail -f /service/ch.oddb-fiparse/log/main/current
@4000000059a3b59938e9ade4 /var/www/oddb.org/etc/db_connection.rb:9:in `<top (required)>': undefined method `dbi=' for #<ODBA::StorageStub:0x007f5508637b58> (NoMethodError)
@4000000059a3b59938f4e4fc       from ext/fiparse/bin/fiparsed:12:in `require'
@4000000059a3b59938f4e8e4       from ext/fiparse/bin/fiparsed:12:in `<main>'

etc/db_connection.rb is a file which is sinc 2004 no longer part ot the git (VCS) repository. Currently it contains the following relevant lines

require 'dbi'
require 'odba'
require 'odba/connection_pool'
ODBA.storage.dbi = ODBA::ConnectionPool.new('DBI:Pg:oddb.org.ruby193', 'postgres', '')

On oddb-ci2 switched to the branch rack (git commit 8a8de82d3cbc33705b060965c8974ac5368e3f70 of July 24 2017). After calling bundle install running sudo -u apache bundle-240 exec ruby-240 ext/fiparse/bin/fiparsed worked.

Examining the changes in the Gemfile (and Gemfile.lock). Die not find any problem. Examining the few changes in ext/etc/fiparse/src revealed that I had added a line -require 'stub/odba.rb'. After removing it fiparse started correctly again.

Fixed this problem with commit Fixed starting fiparse and restarted import-daily on thinpower.

Pushed the commit Reverted Removed minifi parser

Adding watir tests to check for status-pages.

Pushed the following commits

Some patinfo do not display correctly

Eg: http://ch.oddb.org/de/gcc/patinfo/reg/66343/seq/01/pack/001 (edited) leads to

NoMethodError: undefined method `packages' for nil:NilClass                                                         
        /var/www/oddb.org/src/view/drugs/patinfo.rb:124:in `change_log'                                             
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'            
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose' 
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'             
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'          
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'              
        /var/www/oddb.org/src/view/drugs/patinfo.rb:119:in `init'                                                   
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'       
        /var/www/oddb.org/src/view/drugs/patinfo.rb:216:in `new'                                                    
        /var/www/oddb.org/src/view/drugs/patinfo.rb:216:in `chapter_chooser'                                        
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'            
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'                                                                                                                                    
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'                                                                                                                                     
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'                                                                                                                                                 
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'                                                                                                                                              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'                                                                                                                                                  
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'                                                                                                                                           
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `new'                                                                                                                                                                                        
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `content'                                                                                                                                                                                    
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'                                                                                                                                                
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'                                                                                                                                    
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'                                                                                                                                     
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'                                                                                                                                                 
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'                                                                                                                                              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'                                                                                                                                                  
        /var/www/oddb.org/src/view/publictemplate.rb:68:in `init'                                                                                                                                                                                       
        /var/www/oddb.org/src/view/privatetemplate.rb:17:in `init'                                                                                                                                                                                      
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'                                                                                                                                           
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/state.rb:240:in `new'                                                                                                                                                              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/state.rb:240:in `view'                                                                                                                                                             
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/state.rb:173:in `to_html'                                                                                                                                                          
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:548:in `to_html'                                                                                                                                                        
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:280:in `block in process_rack'                                                                                                                                          
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:209:in `synchronize'                                                                                                                                                    
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:209:in `process_rack'                                                                                                                                                   
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/app.rb:127:in `call'                                                                                                                                                               

Okay. I must modify the PatinfoWrapper to be able to access the information, whether it contains a change_log or not. No. It wasn't necessary. Fixed the link with commit Fixed link for patinfo changes and Added another watir test for the patinfo changes

Fix undefined method en_US for #<ODDB::Fachinfo

Found in yesterday log the following error

NoMethodError: undefined method `en_US' for #<ODDB::Fachinfo:0x007f5e4805f020>
        /var/www/oddb.org/src/util/language.rb:53:in `method_missing'
        /var/www/oddb.org/src/model/fachinfo.rb:79:in `localized_name'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing'
        /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:347:in `name'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:145:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:33:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:15:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:15:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divlist.rb:12:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divlist.rb:10:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divlist.rb:10:in `each_with_index'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divlist.rb:10:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:142:in `new'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:142:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:33:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:15:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:15:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:411:in `new'
        /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:411:in `rss_feeds_left'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `new'
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `content'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/src/view/publictemplate.rb:68:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/state.rb:240:in `new'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/state.rb:240:in `view'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/state.rb:173:in `to_html'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:548:in `to_html'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:280:in `block in process_rack'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:209:in `synchronize'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:209:in `process_rack'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/app.rb:127:in `call'
<..>
9.135.230.116 - - [27/Aug/2017 14:30:22] "GET http://www.nachahmer.ch/test/wp-admin/setup-config.php?language=en_US HTTP/1.1" 500 6293 0.0369  "libwww-perl/6.05"
W

Fixed with commit Catch error with wp-admin/setup-config.php?language=en_US

Fix ArgumentError: comparison of Time with nil failed

Must fix the following problem.

ArgumentError: comparison of Time with nil failed
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `sort_by'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing'
  /var/www/oddb.org/src/state/drugs/price_history.rb:37:in `block in init'
  /var/www/oddb.org/src/state/drugs/price_history.rb:35:in `each'
  /var/www/oddb.org/src/state/drugs/price_history.rb:35:in `init'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:264:in `block in process_rack'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:209:in `synchronize'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/session.rb:209:in `process_rack'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.8/lib/sbsm/app.rb:127:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler/webrick.rb:86:in `service'
  /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
  /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
  /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'                                                                                                                                     
06.120.173.129 - - [27/Aug/2017 21:29:19] "GET http://generika.cc/de/generika/price_history/reg/54845/seq/02/pack/022 HTTP/1.1" 500 80244 0.0376  "Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)"

Added a new unit test. But did not catch all cases. http://ch.oddb.org/de/gcc/price_history/reg/55717/seq/01/pack/002 is a package with two different prices from 2010 and 2012. Adding a Watir test for it.

Must fix the problem that my fix did not work correctly, when several prices exist, e.g. http://ch.oddb.org/de/gcc/price_history/reg/55717/seq/01/pack/002.

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