view · edit · sidebar · attach · print · history

Index>

20170613-oddb-org-rack

Summary

  • Port oddb.org to use rack
  • install new version of sandoz.bbmb and sandoz.xmlconv on fastpower
  • Keep in Mind

Commits

Index

install new version of sandoz.bbmb and sandoz.xmlconv on fastpower

Following steps were necessary

  • cp /etc/apache2/vhosts.d/sandoz.bbmb.ch.conf ~/sandoz.bbmb.ch.conf.pre_rack
  • sudo cp ~/sandoz.bbmb.ch.conf.new /etc/apache2/vhosts.d/sandoz.bbmb.ch.conf
  • cd /var/www/sandoz.bbmb.ch
    • sudo -u bbmb git pull https://github.com/ngiger/sandoz.bbmb.git
    • sudo -u bbmb /usr/local/bin/bundle-240 install
    • change /service/sandoz.bbmb.ch/run to contain sudo -u bbmb /usr/local/bin/bundle-240 exec rackup
    • sudo svc -d /service/sandoz.bbmb.ch
    • sudo chown -R bbmb log
    • sudo tail /service/sandoz.bbmb.ch/log/main/current # to verify that it starts
  • cd /var/www/sandoz.xmlconv.bbmb.ch/
    • sudo cp etc/xmlconv.yml.with_rack etc/xmlconv.yml
    • sudo -u bbmb git pull https://github.com/ngiger/sandoz.xmlconv.bbmb.ch.git
    • sudo -u bbmb /usr/local/bin/bundle-240 install
    • change /service/sandoz.xmlconv.bbmb.ch/run to contain sudo -u bbmb /usr/local/bin/bundle-240 exec rackup
    • Add destination: "/var/www/sandoz.xmlconv.bbmb.ch/var/output" to etc/xmlconv.yml
    • sudo svc -h /service/sandoz.xmlconv.bbmb.ch/
    • sudo tail /service/sandoz.xmlconv.bbmb.ch/log/main/current
  • sudo /etc/init.d/apache2 reload

To test we call first curl -v http://sandoz.xmlconv.bbmb.ch/propharma -d@test/data/confuse.xml. Got a HTTP/1.1 200 OK response

To test we visit

Looks good.

But after an hour we got 4 empty orders. Why?

Remarked that displaying olders orders does not work. Eg. http://sandoz.xmlconv.bbmb.ch/de/sbsm/self/state_id/69986814058300/page/1 returns only an empty order (not a list of orders). In the service log we find many entries like ["ngiger@ywesee.com"] subject: XmlConv2 - Polling-Error, while I did not receive any messages.

The problem lays in the UTF-encoding. Added test/data/umlaut_utf_8_problem.xml. On oddb-ci2 I see the following the rack output

[2017-06-13 15:10:33] INFO  WEBrick::HTTPServer#start: pid=769 port=8011
NoMethodError: undefined method `deliveries' for nil:NilClass
        /var/www/sandoz.xmlconv.bbmb.ch/lib/conversion/sunstore_bdd.rb:42:in `respond'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/xmlconv-1.1.3/lib/xmlconv/util/transaction.rb:115:in `response'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/xmlconv-1.1.3/lib/xmlconv/util/application.rb:144:in `execute_with_response'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/xmlconv-1.1.3/lib/xmlconv/state/login.rb:27:in `initialize'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/sbsm-1.4.4/lib/sbsm/session.rb:385:in `new'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/sbsm-1.4.4/lib/sbsm/session.rb:385:in `logout'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/sbsm-1.4.4/lib/sbsm/session.rb:225:in `block in process_rack'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/sbsm-1.4.4/lib/sbsm/session.rb:209:in `synchronize'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/sbsm-1.4.4/lib/sbsm/session.rb:209:in `process_rack'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/sbsm-1.4.4/lib/sbsm/app.rb:119:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/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'
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT
        (erb):252:in `concat'
        (erb):252:in `block in pretty'
        (erb):249:in `each'
        (erb):249:in `pretty'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/erb.rb:896:in `eval'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/erb.rb:896:in `result'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:96:in `pretty'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:32:in `rescue in call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/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'
[2017-06-13 15:11:06] ERROR Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT
        (erb):252:in `concat'
        (erb):252:in `block in pretty'
        (erb):249:in `each'
        (erb):249:in `pretty'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/erb.rb:896:in `eval'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/erb.rb:896:in `result'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:96:in `pretty'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:32:in `rescue in call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/sandoz.xmlconv.bbmb.ch/vendor/ruby240/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'

When calling curl -v http://sandoz.xmlconv.bbmb.ngiger.ch/propharma -d@test/data/umlaut_utf_8_problem.xml the transaction.model is empty. Why? The method convert(xml_document) in lib/conversion/sunstore_bdd.rb fails.

Resettting fastpower as follows:

  • sudo cp /home/ngiger/sandoz.bbmb.ch.conf.pre_rack /etc/apache2/vhosts.d/sandoz.bbmb.ch.conf
  • cd /var/www/sandoz.bbmb.ch
    • sudo git reset --hard b8c5c52e5daa39c66b96affc9c4e7699651f2f41 # last commit before starting rack
    • sudo -u bbmb /usr/local/bin/bundle-240 install
    • change /service/sandoz.bbmb.ch/run to previous content
    • sudo svc -d /service/sandoz.bbmb.ch
    • sudo tail /service/sandoz.bbmb.ch/log/main/current # to verify that it starts
  • cd /var/www/sandoz.xmlconv.bbmb.ch/
    • sudo git reset --hard 528adda3dff7a2b5929b718df96f8cc46eba262e
    • sudo cp etc/xmlconv.yml.pre_rack etc/xmlconv.yml
    • sudo svc -d /service/sandoz.xmlconv.bbmb.ch/
    • change /service/sandoz.xmlconv.bbmb.ch/run to previous content
    • sudo svc -u /service/sandoz.xmlconv.bbmb.ch/
    • sudo tail /service/sandoz.xmlconv.bbmb.ch/log/main/current
  • sudo /etc/init.d/apache2 reload

Tested like follows

niklaus@ng-tr /m/o/g/sandoz.xmlconv.bbmb.ch> curl -v http://sandoz.xmlconv.bbmb.ch/pharmasoft -d@test/data/umlaut_utf_8_problem.xml
* Hostname was NOT found in DNS cache
*   Trying 62.12.131.46...
* Connected to sandoz.xmlconv.bbmb.ch (62.12.131.46) port 80 (#0)
> POST /pharmasoft HTTP/1.1
> User-Agent: curl/7.38.0
> Host: sandoz.xmlconv.bbmb.ch
> Accept: */*
> Content-Length: 1101
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Tue, 13 Jun 2017 13:54:31 GMT
* Server Apache is not blacklisted
< Server: Apache
< Transfer-Encoding: chunked
< Content-Type: text/xml;charset=utf-8
< 
<?xml version='1.0' encoding='UTF-8'?><customerOrderResponse backLogDesired='false' language='de' productDescriptionDesired='false' roundUpForCondition='false' xsi:schemaLocation='http://www.e-galexis.com/schemas/ http://www.e-galexis.com/schemas/POS/customerOrder/customerOrderResponse.xsd' version='1.0' xmlns='http://www.e-galexis.com/schemas/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><clientResponse number='99-119'/><orderHeaderResponse referenceNumber='060620172'><deliveryAddress line1='136, Ch. De-La-Montagne' line4='Pharmacie GOUDA' line5City='Chêne-Bougeries' line5PostalCode='1224'><addressLine2And3Text line2='Chêne-Bougeries' line3='GOUDA'/></deliveryAddress></orderHeaderResponse><orderLinesResponse><productOrderLineResponse backLogLine='false' lineAccepted='true' productReplaced='false' roundUpForConditionDone='false'><productOrderLine orderQuantity='10'><pharmaCode id='3463433'/></productOrderLine><productResponse description='Omeprazol Sandoz Eco 40 mg Kps 56' wholesalerProductCod* Connection #0 to host sandoz.xmlconv.bbmb.ch left intact
e='00610553'/><availability status='yes'/></productOrderLineResponse><productOrderLineResponse backLogLine='false' lineAccepted='true' productReplaced='false' roundUpForConditionDone='false'><productOrderLine orderQuantity='2'><pharmaCode id='3029702'/></productOrderLine><productResponse description='Clarithromycin Sandoz 500 mg Filmtbl 20' wholesalerProductCode='00990331'/><availability status='yes'/></productOrderLineResponse></orderLinesResponse></customerOrderResponse>&#9166;                                                                                                              

Got a very different answer!!!

I think one problem is that handling the POST-request did not return the XML file. Tried to find some clues on howto handle SOAP request under Ruby Rack. For rails found https://github.com/inossidabile/wash_out.

Fixed the conversion error by adding in lib/xmlconv/util/transaction.rb

        if !@input.valid_encoding?
          @input = @input.encode("UTF-8", :invalid=>:replace, :replace=>"?")
        else
          @input = @input.encode("UTF-8")
        end

Creating the correct XML output.

Pushed the following commits:

Port oddb.org to use rack

Adapting src/util/oddbapp.rb.

Starting via sudo -u apache bundle exec rackup (Using Ruby 2.4.0)

NoMethodError: undefined method `sorted_fachinfos' for #<ODDB::RackApp:0x00558f5baf4868>
        /home/niklaus/git/oddb.org/src/state/drugs/init.rb:20:in `init'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:387:in `logout'
        /home/niklaus/git/oddb.org/src/util/session.rb:127:in `logout'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:225:in `block in process_rack'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:209:in `synchronize'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:209:in `process_rack'
        /home/niklaus/git/sbsm/lib/sbsm/app.rb:119:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/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'
::1 - - [13/Jun/2017:09:39:37 +0200] "GET / HTTP/1.1" 500 75498 4.2348

Visiting http://localhost:8012/ return

NoMethodError at /
undefined method `sorted_fachinfos' for #<ODDB::RackApp:0x00558f5baf4868>

Ruby	/home/niklaus/git/oddb.org/src/state/drugs/init.rb: in init, line 20
Web	GET localhost/
+ above posted backtrace.

Somehow initializing the ODBA.persistence does not work. Comparing this with bin/admin.

Tried to add a call ODBA.cache.setup in config.ru (analog to the bin/oddbd) and got

ODBA.cache.setup
FEHLER:  Relation »object« existiert bereits
FEHLER:  Relation »prefetchable_index« existiert bereits
FEHLER:  Relation »extent_index« existiert bereits
FEHLER:  Relation »object_connection« existiert bereits
FEHLER:  Relation »target_id_index« existiert bereits
FEHLER:  Relation »collection« existiert bereits
ArgumentError: not delegated
from /usr/local/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:387:in `__getobj__'

After reverting in the Gemfile from using the gem ydbi to use https://github.com/ngiger/ruby-dbi I get a lot further and got the following error

FEHLER:  Relation »target_id_oddb_package_name_with_size_company_name_and_ean13« existiert bereits
Used version: sbsm 1.4.4 and oddb.org 64a22e00be2b41f7519950319496eb5dfa370114
process: /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/bin/rackup
init system
init system: 4.598791534
setup drb-delegation
reset
bundler: failed to load command: rackup (/home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/bin/rackup)
NoMethodError: undefined method `synchronize' for nil:NilClass
  /home/niklaus/git/oddb.org/src/util/oddbapp.rb:1719:in `reset'
  /home/niklaus/git/oddb.org/src/util/oddbapp.rb:1563:in `initialize'
  /home/niklaus/git/oddb.org/config.ru:56:in `new'
  /home/niklaus/git/oddb.org/config.ru:56:in `block in <main>'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
  /home/niklaus/git/oddb.org/config.ru:in `new'
  /home/niklaus/git/oddb.org/config.ru:in `<main>'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:319:in `build_app_and_options_from_config'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:219:in `app'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:354:in `wrapped_app'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:283:in `start'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:148:in `start'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/bin/rackup:4:in `<top (required)>'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/bin/rackup:22:in `load'
  /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/bin/rackup:22:in `<top (required)>'

Here oddb.org accesses the old @mutex variable from sbsm/session when it tries to reset the sessions. Skipping it for the moment.

After adding a method_missing in oddbapp which delegates to the @system (the OddbPrevalence) I the drugs.init state can load sorted_feeedbacks and sorted_fachinfos. Now visiting http://localhost:8012/ gives

NoMethodError at /
undefined method `valid?' for #<SBSM::UnknownUser:0x005584d7ba9990>

Ruby	/home/niklaus/git/oddb.org/src/view/logohead.rb: in sponsor, line 26
Web	GET localhost/
oMethodError: undefined method `valid?' for #<SBSM::UnknownUser:0x005584d7ba9990>
        /home/niklaus/git/oddb.org/src/view/logohead.rb:26:in `sponsor'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /home/niklaus/git/oddb.org/src/view/custom/head.rb:68:in `new'
        /home/niklaus/git/oddb.org/src/view/custom/head.rb:68:in `head'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /home/niklaus/git/oddb.org/src/view/publictemplate.rb:68:in `init'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /home/niklaus/git/sbsm/lib/sbsm/state.rb:240:in `new'
        /home/niklaus/git/sbsm/lib/sbsm/state.rb:240:in `view'
        /home/niklaus/git/sbsm/lib/sbsm/state.rb:173:in `to_html'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:490:in `to_html'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:251:in `block in process_rack'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:209:in `synchronize'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:209:in `process_rack'
        /home/niklaus/git/sbsm/lib/sbsm/app.rb:119:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /home/niklaus/git/oddb.org/vendor/bundle/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'
        ODDB::View::WelcomeHead::COMPONENTS[[1, 0, 0]] in create(sponsor)
        ODDB::View::Drugs::Search::COMPONENTS[[0, 0]] in create(head)
::1 - - [13/Jun/2017:11:06:53 +0200] "GET / HTTP/1.1" 500 124535 4.2226

I also see some lines in the output like

NoMethodError
undefined method `size' for nil:NilClass

Must look at how the src/util/session.rb handles the UnknownUser. After fixing an error in SBSM I was able to use the ODDB::UnknownUser and the rack app came up, albeit without the CSS, images, etc.

Now making apache config work. Now the main page loads, but searching for aspirin returns

Not Found
The requested URL /de/gcc/search/zone/drugs/search_query/Aspirin/search_type/st_oddb was not found on this server.
Apache Server at oddb-ci2.dyndns.org Port 80

Must correct the rewrite rule in the apache config.

view · edit · sidebar · attach · print · history
Page last modified on June 20, 2017, at 12:13 PM