Testing whether after removing all cookies I can see the customer. Tried with Firefox. Still too many redirects. Same with chromium.
Checking YUS entities. Running
niklaus@oddb-ci2 ~> /usr/local/bin/ruby186/bin/ruby /usr/local/share/src/yus/bin/yus_show config=/var/www/sandoz.bbmb.ch/etc/yus.yml admin@sandoz.ch /usr/local/share/src/yus/bin/yus_show:7:in `require': no such file to load -- password (LoadError) from /usr/local/share/src/yus/bin/yus_show:7
Installing ruby-password gem. Leads to
niklaus@oddb-ci2 ~> sudo /usr/local/bin/ruby186/bin/gem install ruby-password Fetching: ruby-termios-0.9.6.gem (100%) Building native extensions. This could take a while... Fetching: ruby-password-0.15.5.gem (100%) Building native extensions. This could take a while... Successfully installed ruby-termios-0.9.6 Successfully installed ruby-password-0.15.5 2 gems installed niklaus@oddb-ci2 ~> /usr/local/bin/ruby186/bin/ruby /usr/local/share/src/yus/bin/yus_show config=/var/www/sandoz.bbmb.ch/etc/yus.yml admin@sandoz.ch /usr/local/share/src/yus/bin/yus_show:7:in `require': no such file to load -- password (LoadError) from /usr/local/share/src/yus/bin/yus_show:7 niklaus@oddb-ci2 ~> /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_show config=/var/www/sandoz.bbmb.ch/etc/yus.yml admin@sandoz.ch /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:736:in `open': drbssl://localhost:9997 - #<Errno::ECONNREFUSED: Connection refused - connect(2)> (DRb::DRbConnError) from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:729:in `each' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:729:in `open' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1189:in `initialize' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1169:in `new' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1169:in `open' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing' from /usr/local/share/src/yus/bin/yus_show:54
Uses the wrong port 9997. Using the config from sandoz bbmb gives
niklaus@oddb-ci2 ~> /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_show admin@sandoz.ch --config=/var/www/sandoz.bbmb.ch/etc/yus.yml Password for ngiger@ywesee.com:
I do not have this password.
If I pass directly the drbport I get asked for my user name
niklaus@oddb-ci2 ~> sudo -u bbmb /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_show admin@sandoz.ch --server_url="druby://localhost:12005" Password for ngiger@ywesee.com:
Trying to grant myself the necessary privileges fails with
niklaus@oddb-ci2 ~> sudo -u bbmb /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_grant server_url="druby://localhost:12005" ngiger@ywesee.com login ch.bbmb.Admin expiry_date must be in the Format: mm.dd.YYYY /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:736:in `open': drbssl://localhost:9997 - #<Errno::ECONNREFUSED: Connection refused - connect(2)> (DRb::DRbConnError) from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:729:in `each' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:729:in `open' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1189:in `initialize' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1169:in `new' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1169:in `open' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend' from /usr/local/bin/ruby186/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing' from /usr/local/share/src/yus/bin/yus_grant:67
This is using the wrong port. Must user "--server_url" and not "server_url". This leads to
niklaus@oddb-ci2 ~> sudo -u bbmb /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_grant --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com login ch.bbmb.Admin Password for ngiger@ywesee.com:
Looking at https://raw.githubusercontent.com/ngiger/vagrant-oddb_org/master/static-modules/oddb_org/templates/yus_create_yml.rb.erb and https://raw.githubusercontent.com/ngiger/vagrant-oddb_org/master/static-modules/oddb_org/templates/yus_grant_user.rb.erb to create a new yus user for sandoz.bbmb.
Had no success in creating a /home/niklaus/yus/yus.yml configuration which would allow me to call yus_add_user (or yus_show).
On thinpower installed ruby-password with sudo /usr/local/bin/ruby186/bin/gem install ruby-password
. When trying to call yus_show I get
ngiger@fastpower ~ $ /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_show config=/var/www/sandoz.bbmb.ch/etc/yus.yml admin@sandoz.ch Password for y.grauwoelfchen@gmail.com: ngiger@fastpower ~ $ /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_show --config=/var/www/sandoz.bbmb.ch/etc/yus.yml admin@sandoz.ch Password for ngiger@ywesee.com: /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/ruby-password-0.15.5/lib/password.rb:192:in `gets': Interrupt from /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/ruby-password-0.15.5/lib/password.rb:192:in `get' from /usr/local/share/src/yus/bin/yus_show:58
In the first case it used the root_name specified in /etc/yus/yus.yml.
Calculated the hash for password '1234' using @ ruby18 -e "require 'digest/sha2'; p Digest::SHA256::hexdigest('1234')""03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4" Verified using
ruby /usr/local/share/src/yus/sha256.rb 1234 password: 1234 SHA256 encoding: 03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4
Added some debug output in yus_show to verify as which user I am logged in. Gives
niklaus@oddb-ci2 ~> sudo -u bbmb /usr/local/bin/ruby186/bin/ruby -rubygems /usr/local/share/src/yus/bin/yus_show admin@sandoz.ch --config=/var/www/sandoz.bbmb.ch/etc/yus.yml Password for ngiger@ywesee.com: Logging in as ngiger@ywesee.com with 1234 Unknown Entity 'ngiger@ywesee.com' Failed login as ngiger@ywesee.com with 1234In /service/sandoz.bbmb.ch-yus/log/main/current I see
@40000000574e9e56037eef84 I, [2016-06-01T10:35:24.058582 #25598] INFO -- start: starting yus-server on druby://localhost:12005 using db sandoz_yus @40000000574e9e94212d9954 I, [2016-06-01T10:36:26.556577 #30612] INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from commandline @40000000574e9e94212f6e14 W, [2016-06-01T10:36:26.556732 #30612] WARN -- Yus::Server: Authentication failed for ngiger@ywesee.com @40000000574e9e9826f08b44 I, [2016-06-01T10:36:30.653162 #30612] INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from commandline @40000000574e9e9826f4c934 W, [2016-06-01T10:36:30.653495 #30612] WARN -- Yus::Server: Authentication failed for ngiger@ywesee.com n
Changing /service/sandoz.bbmb.ch-yus/run to call directly the yusd installed as gem, .eg sudo -u bbmb /usr/local/bin/ruby186/bin/yusd -rubygems config=/var/www/sandoz.bbmb.ch/etc/yus.yml
. Now I succeed with
sudo -u bbmb /usr/local/bin/ruby186/bin/yus_show admin@sandoz.ch --config=/var/www/sandoz.bbmb.ch/etc/yus.yml Password for ngiger@ywesee.com: ["admin@sandoz.ch", ["edit", [["yus.entities"]]], ["grant", [["login"]]], ["login", [["ch.bbmb.sandoz.Admin"]]], ["set_password", [["admin@sandoz.ch"], ["everything"]]]]
Conclusion: yus_show and yusd must operate with exactly the same files.
Restarting apache and testing whether after a login in http://sandoz.bbmb.ngiger.ch/ I can see the customers. No. Still having problems.
No I must create the user ngiger@ywesee.com and grant it more privileges.
sudo -u bbmb /usr/local/bin/ruby186/bin/yus_add_user --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com login ch.bbmb.sandoz.Admin <..> sudo -u bbmb /usr/local/bin/ruby186/bin/yus_show --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com Password for ngiger@ywesee.com: ["ngiger@ywesee.com", ["login", [["ch.bbmb.sandoz.Admin"]]], ["set_password", [["ngiger@ywesee.com"]]]]
Still having problems to see the customer. Compairing the two users I see that ngiger does not have all privileges
niklaus@oddb-ci2 /u/l/s/s/yus> sudo -u bbmb /usr/local/bin/ruby186/bin/yus_show --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com Password for ngiger@ywesee.com: ["ngiger@ywesee.com", ["login", [["ch.bbmb.sandoz.Admin"]]], ["set_password", [["ngiger@ywesee.com"]]]] niklaus@oddb-ci2 /u/l/s/s/yus> sudo -u bbmb /usr/local/bin/ruby186/bin/yus_show --config=/var/www/sandoz.bbmb.ch/etc/yus.yml admin@sandoz.ch Password for ngiger@ywesee.com: ["admin@sandoz.ch", ["edit", [["yus.entities"]]], ["grant", [["login"]]], ["login", [["ch.bbmb.sandoz.Admin"]]], ["set_password", [["admin@sandoz.ch"], ["everything"]]]]
sudo -u bbmb /usr/local/bin/ruby186/bin/yus_grant --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com everything <..> sudo -u bbmb /usr/local/bin/ruby186/bin/yus_grant --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com edit yus.entities <..> sudo -u bbmb /usr/local/bin/ruby186/bin/yus_grant --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com grant login <..> niklaus@oddb-ci2 /u/l/s/s/yus> sudo -u bbmb /usr/local/bin/ruby186/bin/yus_show --config=/var/www/sandoz.bbmb.ch/etc/yus.yml ngiger@ywesee.com Password for ngiger@ywesee.com: ["ngiger@ywesee.com", ["edit", [["yus.entities"]]], ["everything", [["everything"]]], ["grant", [["login"]]], ["login", [["ch.bbmb.sandoz.Admin"]]], ["set_password", [["ngiger@ywesee.com"]]]]
Deleted cookies in chromium as seen:
Restarting /service/sandoz.bbmb.ch, /service/sandoz.bbmb.ch-yus and apache server. http://sandoz.bbmb.ngiger.ch/de/customers/ still displays the ERR_TO_MANY_REDIRECTS.
Correcting bin/bbmbd and pushed commit Fixed bin/bbmbd and migrate_to_utf8
Used gem231 to install the new gems bbmb, ydbd-pg and ydbi. Now starting bbmb directly gives me the following error
sudo -u apache /usr/local/bin/bbmbd /var/www/sandoz.bbmb.ch/etc/config.yml Ignoring byebug-8.2.4 because its extensions are not built. Try: gem pristine byebug --version 8.2.4 /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:3: warning: variable $KCODE is no longer effective; ignored Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10 could not find htmlgrid.so, falling back to pure-ruby class /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- bbmb/util/csv_importer (LoadError) from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:15:in `block in <module:BBMB>' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:14:in `each' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:14:in `<module:BBMB>' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:13:in `<top (required)>' from /usr/local/bin/bbmbd:23:in `load' from /usr/local/bin/bbmbd:23:in `<main>'
The missing file bbmb/util/csv_importer is /var/www/sandoz.bbmb.ch/lib/bbmb/util/csv_importer.rb. Adding the missing lib path via -I to ruby231 and I get a step further with
sudo -u apache /usr/local/bin/ruby231 -I/var/www/sandoz.bbmb.ch/lib /usr/local/bin/bbmbd config=/var/www/sandoz.bbmb.ch/etc/config.yml Ignoring byebug-8.2.4 because its extensions are not built. Try: gem pristine byebug --version 8.2.4 /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:3: warning: variable $KCODE is no longer effective; ignored Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10 could not find htmlgrid.so, falling back to pure-ruby class 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 /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:16:in `load': undefined class/module YDIM::Debitor (ArgumentError) from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:16:in `load' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:629:in `restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:319:in `block in fetch_or_restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:318:in `fetch_or_restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:66:in `block in bulk_restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:63:in `each' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:63:in `bulk_restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:57:in `bulk_fetch' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:261:in `fetch_collection' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:633:in `restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:319:in `block in fetch_or_restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:318:in `fetch_or_restore' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:305:in `block in fetch_named' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:297:in `fetch_named' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:352:in `indices' from /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:475:in `setup' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/lib/bbmb/persistence/odba.rb:41:in `<module:BBMB>' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/lib/bbmb/persistence/odba.rb:14:in `<top (required)>' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:17:in `<module:BBMB>' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:13:in `<top (required)>' from /usr/local/bin/bbmbd:23:in `load' from /usr/local/bin/bbmbd:23:in `<main>'
Adding "-rydim/invoice" goes farther and provokes the error
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:34:in ``': No such file or directory - cg-object-id (Errno::ENOENT) from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:34:in `<module:BBMB>' from /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin/bbmbd:13:in `<top (required)>' from /usr/local/bin/bbmbd:23:in `load' from /usr/local/bin/bbmbd:23:in `<main>'
Replacing VERSION = `cg-object-id`
by VERSION = `git rev-parse HEAD`
Now running sudo -u apache /usr/local/bin/ruby231 -I/var/www/sandoz.bbmb.ch/lib -rydim/invoice /usr/local/bin/bbmbd config=/var/www/sandoz.bbmb.ch/etc/config.yml
starts bbmbd successfully. However after a login I still ERR_TOO_MANY_REDIRECTS. Restarting apache and deleting all cookies did not help, neither.
Pushed fix for the VERSION with commit Fix getting git version
Running sandoz.bbmb.ch as user bbmb (instead of apache) did also produce the error ERR_TO_MANY_REDIRECTS
Pushed to two commits for sandoz.bbmb. Added a soft link for sudo ln -s /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/bin .
in /var/www/sandoz.bbmb.ch
Stepped using pry starting at /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.1/lib/bbmb/html/state/login.rb @ line 19 BBMB::Html::State::Login#login:
. Did not see anything abnormal at first glance. But finally the drb return an empty string '' which is surely not correct. See Attach:pry_session_log.txt
To compare it with ydim I tried to get into the same pry debug point via https://ydim.oddb-ci2.dyndns.org/de/ydim. But here I get the following error
SBSM::Session#process: /de/ydim ArgumentError undefined class/module BBMB:: (druby://localhost:12375) /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:16:in `load' (druby://localhost:12375) /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/marshal.rb:16:in `load' (druby://localhost:12375) /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:629:in `restore' (druby://localhost:12375) /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:319:in `block in fetch_or_restore' (druby://localhost:12375) /usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do'
The port idea 12375 reveals that the ydimd throws this error.
Did my changes of today in bbmb break ydim?
On a iPhone the Evidentia icons which contain a german Umlaut in there name do not display. Must fix this problem.
Renamed the files and adapted the lnf names. Pushed commit Fix display evidentia icons on iPhone