view · edit · sidebar · attach · print · history

20121119-debug-vetoquinol-bbmb

<< 20121120-update-oddb2xml | 2012 | 20121116-setup-vetoquinol-bbmb >>


Summary

  • Setup & Debug bbmb (vetoquinol)
    • Debuged E-mail sending via TLS (smtp.gmail.com).
    • Vetoquinol.bbmb.ch Web interface on Local dose not still work.
      • (Maybe) Because Yus-Data of bbmb needs Ruby 1.8.6 (1.8.7 does not work)
      • Updater does work if any data exists.
  • Updated E-mail sending to use smtp.gmail.com server.

Commit

Index


Setup vetoquinol bbmb

sbsm, yaml, stringio loading problem.

irb(main):001:0> require 'stringio'
=> true
irb(main):002:0> require 'yaml'
=> true
irb(main):003:0> require 'sbsm/trans_handler'
=> true
irb(main):004:0> 

Added LoadPath with RubyAddPath

<IfModule mod_ruby.c>
...
# 1.8.7-p358
RubyAddPath /path/to/1.8.7-p358/lib/ruby

# added
RubyAddPath /path/to/lib/ruby/1.8 (for apach/ruby-run)
RubyAddPath /path/to/1.8.7-p358/lib/ruby/1.8/x86_64-linux/ (for stringio)
RubyAddPath /path/to/1.8.7-p358/lib/ruby/site_ruby/1.8 (for sbsm)
...
</IfModule>

character-encodnigs

bbmb does not work with character-encodings gem 0.4.1.
tried with 0.3.

$ gem install character-encodings -v 0.3 -- --with-cflags=\"-Wno-unused-but-set-variable\"
Fetching: character-encodings-0.3.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed character-encodings-0.3.0
1 gem installed
Installing ri documentation for character-encodings-0.3.0...
Installing RDoc documentation for character-encodings-0.3.0...
$ irb
irb(main):001:0> require 'encoding/character/utf-8'
=> true
irb(main):002:0> exit

rubygems

added rubygems into doc/index.rbx

require 'rubygems' <= added

require 'sbsm/request'
require 'encoding/character/utf-8'

Configure bbmb

yus.yaml

bbmb does not read etc/yus.yaml.
Then I edited /etc/yus/yus.yaml for bbmb application.

server_url: druby://localhost:12001

current_order

bin/bbmbd:36: warning: already initialized constant VERSION
I, [2012-11-19T10:29:08.748385 #9002]  INFO -- start: starting bbmb-server on druby://localhost:12000
error in SBSM::Session#process: /de
NoMethodError
undefined method `current_order' for nil:NilClass
/home/yasuhiro/Documents/workspace/ywesee/var/bbmb/lib/bbmb/html/state/current_order.rb:20:in `init'
/path/to/gems/ruby/1.8/gems/sbsm-1.2.2/lib/sbsm/session.rb:367:in `process'
/home/yasuhiro/Documents/workspace/ywesee/var/bbmb/lib/bbmb/html/util/session.rb:44:in `process'
/path/to/gems/ruby/1.8/gems/sbsm-1.2.2/lib/sbsm/session.rb:172:in `drb_process'
/path/to/gems/ruby/1.8/gems/sbsm-1.2.2/lib/sbsm/session.rb:171:in `synchronize'

Restore DB from production.

$ scp ywesee@62.12.131.35:/var/backup/whitie/db/postgresql/November-2012/2012-11-18/21:00-postgresql_database-bbmb-backup.gz .
$ zcat 21\:00-postgresql_database-bbmb-backup.gz | psql -U postgres bbmb

bbmb_yus Data

can't load bbmb_yus data.

/path/to/ruby/1.8/gems/odba-1.0.8/lib/odba/marshal.rb:15:in `load': undefined class/module Encoding:: (ArgumentError)
        from /poth/to/ruby/1.8/gems/odba-1.0.8/lib/odba/marshal.rb:15:in `load'

used yus data of oddb.

["ch.bbmb.admin", [["everything"]]],
 ["ch.bbmb.customer", [["everything"]]],
 ["ch.ddbd.admin", [["everything"]]],
 ["edit", [["org.oddb.drugs"], ["yus.entities"]]],
 ["login", [["ch.bbmb.Admin"], ["ch.bbmb.Customer"], ["org.oddb.RootUser"]]],
 ...
 ["RootUser"]]

updater

error in SBSM::Session#process: /de/current_order/
NoMethodError
undefined method `current_order' for nil:NilClass
/home/yasuhiro/Documents/workspace/ywesee/var/bbmb/lib/bbmb/html/state/current_order.rb:20:in `init'
/path/to/gems/ruby/1.8/gems/sbsm-1.2.2/lib/sbsm/session.rb:367:in `process'
/home/yasuhiro/Documents/workspace/ywesee/var/bbmb/lib/bbmb/html/util/session.rb:44:in `process'
/path/to/gems/ruby/1.8/gems/sbsm-1.2.2/lib/sbsm/session.rb:172:in `drb_process'
/path/to/gems/ruby/1.8/gems/sbsm-1.2.2/lib/sbsm/session.rb:171:in `synchronize'

Debug tls_commit

ch.bbmb> update
-> /usr/local/rbenv/versions/1.8.7-p358/lib/ruby/1.8/net/smtp.rb:954:in `check_auth_response': 530 5.7.0 Must issue a STARTTLS command first. vo8sm5452780pbc.16

tls commit is

ch.bbmb> update
-> /home/yasuhiro/Documents/workspace/ywesee/var/bbmb/lib/bbmb/util/smtp_tls.rb:8:in `check_auth_args': wrong number of arguments (3 for 2)
ch.bbmb> 

Added RUBY_VERSION support

    if RUBY_VERSION == "1.8.6"
      check_auth_args user, secret, authtype if user or secret
    else # > 1.8.7
      check_auth_args user, secret if user or secret
    end 
  • ch.bbmb.Customer => error.
  • ch.bbmb.Admin => redirect loop cauesd.

Ref.

vetoquinol.bbmb.ch in local dose not still work.
But, I could check Error-E-mail sending via TLS (smtp.gmail.com) with my account(yasaka@ywesee.com).


Check configuration

  • PollingMission is data.vetoquinol at bbmb.ch (incomming, via mail.ywesee.com)
  • Sendmail is orders.vetoquinol at bbmb.ch (sendmail, via smtp.gmail.com with tls)

etc/config.yml

# old
#smtp_server: 'mail.ywesee.com'
#smtp_user: 'data.vetoquinol at bbmb.ch'
#smtp_authtype: :plain
#smtp_pass: xxxxx
# new
smtp_server: 'smtp.gmail.com'
smtp_domain: 'ywesee.com'
smtp_port: '587'
smtp_user: 'orders.vetoquinol at bbmb.ch'
smtp_authtype: :plain
smtp_pass: xxxxx
commit
view · edit · sidebar · attach · print · history
Page last modified on October 30, 2013, at 05:19 PM