view · edit · sidebar · attach · print · history




  • Fix ArgumentError: comparison of Time with nil failed
  • Some patinfo links do not work correctly
  • Webalizer must work again
  • Fix interacion problem
  • Keep in Mind



Fix ArgumentError: comparison of Time with nil failed

Must fix the following problem. ArgumentError: comparison of Time with nil failed when visiting

The newly created test case is not sufficient when we really have several prices as in Adding a second unit test for this case.

At the moment I avoid the error, but not the correct price/date is displayed.

The prices are as follow (from a pry session)

=> {:public=>
  [#<ODDB::Util::Money:0x007f1af1ad8988 @amount=40.7, @authority=:sl, @country="CH", @credits=4070, @mutation_code="SLAUFNAHME", @origin=" (01.10.2015)", @type="public", @valid_from=2015-10-01 00:00:00 +0200>,
   #<ODDB::Util::Money:0x007f1af1ad8438 @amount=62.85, @authority=nil, @country="CH", @credits=6285, @origin=nil, @type="public", @valid_from=nil>],
  [#<ODDB::Util::Money:0x007f1af1ad8258 @amount=21.15, @authority=:sl, @country="CH", @credits=2115, @mutation_code="SLAUFNAHME", @origin=" (01.10.2015)", @type="exfactory", @valid_from=2015-10-01 00:00:00 +0200>]}

Fixed this problem by returning only the values where the valid_from is != nil. Now both URL and display the correct information.

Pushed commit Handle nil values for valid_from in price-history

Some patinfo links do not work correctly

E.g. are

These packages do not display, even if the contain a valid change_log, as seen by the following bin/admin snippet

ch.oddb> registration('50141').package('055')[0..120]
-> Accupro® 5/10/20
Was ist Accupro und wann wird es angewendet?
Accupro ist ein Arzneimittel, das auf Verschreibung des Arz
ch.oddb> registration('63042').package('002')[0..120]
-> Giotrif®
Was ist Giotrif® und wann wird es angewendet?
Giotrif enthält den Wirkstoff Afatinib. Dieser hemmt die Aktivität
ch.oddb> registration('63042').package('002')
-> 1
ch.oddb> registration('50141').package('055')
-> 1


The sequence number of the package used to find is wrong, it should be '02' and not '01' as suggested by the URL, as seen by this bin/admin snippet

ch.oddb> registration('50141').package('055').seqnr
-> 02
ch.oddb> registration('50141').sequence('01').package('055')

Must fix using a wrong sequence number, when generating the links for patinfo. Waiting for my import_daily to finish importing the patinfos.

Fixed the problem. Adding a watir test for it. Pushed the commits

Webalizer must work again

We have two problems:

  1. We produce at the moment only an access_log, eg./var/www/, whereas we had an access and an error_log. The distinction between error and access log does not make sense for webrick and the links I did see for rack based web applications always spoke of a single file. We do hover have different logging levels like info, warn, debug, error inside each log file. The SBSM logs got to

files like /var/www/ (for oddb) or /var/www/

  1. We do not emit the access log in the same format as apache Which is shown by the following example lines

In /var/www/ we find

[Wed Jun 28 12:34:44 2017] [error] [client] File does not exist: /var/www/

In/var/www/ we find - - [28/Jun/2017:12:03:47 +0200] "GET /de/gcc/rss/channel/sl_introduction.rss HTTP/1.1" 200 430613 "-" "Akregator/5.2.3; syndication"

Whereas in /var/www/ we find - - [27/Aug/2017:23:59:59 +0200] "GET /en/gcc/show/reg/57593/seq/04/pack/007/currency/USD HTTP/1.1" 200 23040 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +"

In /var/www/ we find - - [29/Aug/2017 00:00:00] "GET HTTP/1.1" 200 114 0.0007 "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53 BingPreview/1.0b"

I think it might make sense to use the output of the logs produced by the services as error_log and the log produced by the SBSM.logger as access_log.

Changed locally on oddb-ci2 the log_pattern. Now I get the following content

 cat /var/www/ 
/var/www/ warning: circular argument reference - now
racc/parser.rb:189: warning: already initialized constant Racc::Parser::Racc_Runtime_Version
/var/www/ warning: previous definition of Racc_Runtime_Version was here
racc/parser.rb:190: warning: already initialized constant Racc::Parser::Racc_Runtime_Revision
/var/www/ warning: previous definition of Racc_Runtime_Revision was here
racc/parser.rb:192: warning: already initialized constant Racc::Parser::Racc_Runtime_Core_Version_R
/var/www/ warning: previous definition of Racc_Runtime_Core_Version_R was here
racc/parser.rb:193: warning: already initialized constant Racc::Parser::Racc_Runtime_Core_Revision_R
/var/www/ warning: previous definition of Racc_Runtime_Core_Revision_R was here
racc/parser.rb:197: warning: already initialized constant Racc::Parser::Racc_Runtime_Core_Revision_C
/var/www/ warning: previous definition of Racc_Runtime_Core_Revision_C was here
racc/parser.rb:205: warning: already initialized constant Racc::Parser::Racc_Main_Parsing_Routine
/var/www/ warning: previous definition of Racc_Main_Parsing_Routine was here
racc/parser.rb:206: warning: already initialized constant Racc::Parser::Racc_YY_Parse_Method
/var/www/ warning: previous definition of Racc_YY_Parse_Method was here
racc/parser.rb:207: warning: already initialized constant Racc::Parser::Racc_Runtime_Core_Version
/var/www/ warning: previous definition of Racc_Runtime_Core_Version was here
racc/parser.rb:208: warning: already initialized constant Racc::Parser::Racc_Runtime_Core_Revision
/var/www/ warning: previous definition of Racc_Runtime_Core_Revision was here
racc/parser.rb:209: warning: already initialized constant Racc::Parser::Racc_Runtime_Type
/var/www/ warning: previous definition of Racc_Runtime_Type was here
[DEPRECATED] By requiring 'spreadsheet/excel' you are loading a Compatibility
             layer which provides a drop-in replacement for Spreadsheet::Excel
             versions <= This code will be removed in Spreadsheet
             version 1.0.0
/var/www/ warning: already initialized constant HtmlGrid::List::BACKGROUND_SUFFIX
/var/www/ warning: previous definition of BACKGROUND_SUFFIX was here
W, [2017-08-29T14:21:45.866867 #7251]  WARN -- : `block in <main>' Starting Rack::Server with log_pattern /var/www/
[2017-08-29 14:21:57] INFO  WEBrick 1.3.1
[2017-08-29 14:21:57] INFO  ruby 2.4.0 (2016-12-24) [x86_64-linux]
[2017-08-29 14:21:57] INFO  WEBrick::HTTPServer#start: pid=7251 port=8012 - - [29/Aug/2017 14:22:01] "GET HTTP/1.1" 200 21132 0.5287  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36" - - [29/Aug/2017 14:22:10] "GET HTTP/1.1" 200 106829 7.7392  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"
W, [2017-08-29T14:22:27.243064 #7251]  WARN -- : session_store.rb:115:in `clean' Cleaned 0 sessions. Took 0 seconds
W, [2017-08-29T14:22:57.243261 #7251]  WARN -- : session_store.rb:115:in `clean' Cleaned 0 sessions. Took 0 seconds


@4000000059a55c620cbf8eb4 Attention: monkey-patching CSV::Cell
@4000000059a55c632b7def1c loading testenvironment
@4000000059a55c632b7def1c DEVELOPER_HOST =
@4000000059a55c632b7def1c DEVELOPER_MAIL =
@4000000059a55c6333bb56ec process: /var/www/ server_uri druby://localhost:10000  auxiliary  
@4000000059a55c6333dfa3e4 init system starting after 0.002398399 seconds
@4000000059a55c6a182e9ed4 Took 2 seconds to load /var/www/
@4000000059a55c6f0e69991c initialized: 11.37392353
@4000000059a55c730e4dd3bc ::1 - - [29/Aug/2017:14:22:01 +0200] "GET HTTP/1.1" 200 21132
@4000000059a55c7c387acf14 ::1 - - [29/Aug/2017:14:22:10 +0200] "GET HTTP/1.1" 200 106829

It took 3 commits till Zeno and I were satisfied with the path for the log files produced by the Rack process, as they cannot go into the same log directories as the chronolog access/error_logs, as these files and directories belong to root, whereas the rack process runs as apache

Pushed the commits

Now I must see why the Apache logging works fine for flavors like generika, but not for This proved to be easy. I was sufficient to move the log statement to near the beginning of VirtualHost section. Also deactived the RewriteLog as we have no longer problems with rewriting.

Also I must add the SSL lines added by Zeno a few days ago.

Pushed commits:

Fix interaction problem

Found the following error in /var/www/ when visiting,G04BE03

TypeError: no implicit conversion from nil to integer
        /var/www/ `[]'
        /var/www/ `block in init'
        /var/www/ `each'
        /var/www/ `init'
        /var/www/ `block in process_rack'
        /var/www/ `synchronize'
        /var/www/ `process_rack'
        /var/www/ `call'
        /var/www/ `_call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `_call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `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' - - [29/Aug/2017 16:25:03] "GET,G04BE03 HTTP/1.1" 500 83068 0.0121  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"

Fixed with commit Fix :interaction_detail and avoid NPE

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