view · edit · sidebar · attach · print · history

Index>

20170312-fix-update-jobs

Summary

Commits

Index

Fix jobs/update_atc_dosing_link

jobs/update_atc_dosing_link does no longer work as it requires the Ruby gem units.

As we use now bundler to run the ODDB.org, we must also use bundler to run a single update_job, eg. use sudo -u apache /usr/local/bin/bundle-240 exec ruby-240 jobs/update_atc_dosing_link.Tried it on thinpower, where it fails at the moment, as import_daily is still running.

Fix davaz.com

Continue work of last week. Asking why the request.headers contain twice the session_id, e.g language=en; _session_id=0000000000000002; remember=generate_token; name=juerg%40davaz.com; language=en; _session_id=0000000000000008

Looking whether I should replace sbsm/session_store.rb by rack/session/pool.rb. But how we ensure, that our sessions are still able to use the persistence_layer, trans_handler, validator, unknown_user of the SBSM::SessionStore ? And also Rack::Session is a module whereas SBSM::Session is a class.

Now I am having problems that in lib/rack/session/abstract/id.rb:332:in `commit_session'" I have the problem that the session object is a DaVaz::Util::Session instead of Rack::?? Looking at how Sinatra handles session, maybe this inspires me.

After changing sbsm/lib/app.rb to use the Rack::Session::Pool I get an error, in src/state/works/movies.rb in the method init saying NoMethodError: undefined method `load_movies' for #<DaVaz::Util::Session:0x0056218a49c328>. The method @session.app.load_movies however is defined.

No the davaz app no longer has problems handling the request, but the session does not get restored correctly. Debugging the reason. Found the culprit, had removed one line too much in lib/sbsm/app.rb.

Now the login works, but the logout fails in davaz.com/src/state/_partial/admin.rb, because the @previous.request_path is nil. Looks like the variable request_path was not updated correctly. Fixed this problem sbsm. But the Redirect in the same method of admin.rb leads to

Rack::Lint::LintError: header must not contain Status
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:20:in `assert'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:639:in `block in check_headers'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/utils.rb:454:in `block in each'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/utils.rb:453:in `each'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/utils.rb:453:in `each'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:629:in `check_headers'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:53:in `_call'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:37:in `call'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/show_exceptions.rb:23:in `call'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:222:in `context'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:216:in `call'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/handler/webrick.rb:86:in `service'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
        /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
::1 - - [20/Mar/2017:16:43:54 CET] "GET /en/admin/logout/fragment/ HTTP/1.1" 500 55235

Reactivated a line which does not add a stuts header in the reponse (in method call of sbsm/app.rb).

Tried avoiding this error by omitting the redirect, but this lead only

NoMethodError: undefined method `unset_previous' for true:TrueClass
        /home/niklaus/git/davaz.com/src/state/global.rb:115:in `trigger'
        /home/niklaus/git/sbsm/lib/sbsm/viralstate.rb:38:in `trigger'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:222:in `block in process_rack'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:214:in `synchronize'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:214:in `process_rack'
        /home/niklaus/git/sbsm/lib/sbsm/app.rb:160:in `call'

Tomorrow I will test the changes in sbsm and davaz.com on oddb-ci2 and run manual tests to see how the app permits editing an art-object directly after a login.

view · edit · sidebar · attach · print · history
Page last modified on March 20, 2017, at 05:45 PM