view · edit · sidebar · attach · print · history

20101227-setup-ydim

<< Masa.20101228-setup-ydim | 2010 | Masa.20101224-check-problem-Ruby_1_8_7-study-ydim >>


  1. Confirm ydim boot
  2. Stop auto invoicer (temporarily)
  3. Set up virtual host
  4. Set up ydim.yml
  5. Login test
  6. Test Neu Kunde test
  7. Test Neue Rechnung
  8. Test sending email
  9. Debug Index Error

Goal
  • Set up ydim / 80%
Milestones
  1. Stop autoinvoicer 9:45
  2. Virtual host 10:15
  3. ydim.yml 14:15
  4. Login test
Summary
Commits
ToDo Tomorrow
Keep in Mind
  1. swissmedic_followers debug
  2. different page 2010, 2011 and navigator link at the bottom of page PM-Wiki Markup for paging between pages
  3. On Ice
  4. export_fachinfo test locally (weekend)
  5. backup script (weekend)
  6. emerge --sync

Confirm ydim runs

  1. git clone ssh://ywesee@scm.ywesee.com/home/ywesee/git/ydim
  2. git clone ssh://ywesee@scm.ywesee.com/home/ywesee/git/ydim_html
  3. copy bin, doc, lib dirctories from ydim-html to ydim
masa@masa ~/ywesee/ydim-html $ cp -r bin ../ydim/
masa@masa ~/ywesee/ydim-html $ cp -r doc ../ydim/
masa@masa ~/ywesee/ydim-html $ cp -r lib ../ydim/

Run ydimd

Result

masa@masa ~/ywesee/ydim $ bin/ydimd 
ERROR:  relation "object" already exists

ERROR:  relation "prefetchable_index" already exists

ERROR:  relation "extent_index" already exists

ERROR:  relation "object_connection" already exists

ERROR:  relation "target_id_index" already exists

ERROR:  relation "collection" already exists

ERROR:  relation "target_id_ydim_invoice_unique_id" already exists

ERROR:  relation "target_id_ydim_debitor_unique_id" already exists

ERROR:  relation "target_id_ydim_autoinvoice_unique_id" already exists

ERROR:  relation "target_id_ydim_debitor_name" already exists

ERROR:  relation "target_id_ydim_debitor_email" already exists

ERROR:  relation "target_id_ydim_invoice_status" already exists

I, [2010-12-27T08:03:06.357834 #2945]  INFO -- AutoInvoicer: next run Tue Dec 28 01:00:00 2010, sleeping 61013 seconds
I, [2010-12-27T08:03:06.372388 #2945]  INFO -- CurrencyUpdater: next run Tue Dec 28 02:00:00 2010, sleeping 64613 seconds
I, [2010-12-27T08:03:06.372458 #2945]  INFO -- StatusUpdater: next run Tue Dec 28 01:00:00 2010, sleeping 61013 seconds
I, [2010-12-27T08:03:06.372777 #2945]  INFO -- start: starting ydim-server on druby://localhost:12375

Note

  • Data has been already restored in database, ydim
  • Database user, ydim, has already been created.
masa@masa ~/ywesee/ydim $ psql -U postgres
psql (8.4.2)
Geben Sie »help« für Hilfe ein.

postgres=# \l
                                   Liste der Datenbanken
    Name     | Eigentümer | Kodierung | Sortierfolge | Zeichentyp |    Zugriffsrechte     
-------------+-------------+-----------+--------------+------------+-----------------------
 oddb        | postgres    | UTF8      | C            | C          | 
 oddb.org    | postgres    | UTF8      | C            | C          | 
 testdb      | masa        | UTF8      | C            | C          | 
 ydim        | postgres    | UTF8      | C            | C          | 
 ydpm        | postgres    | SQL_ASCII | C            | C          | 
 yus         | postgres    | SQL_ASCII | C            | C          | 
(10 Zeilen)

postgres=# SELECT * FROM pg_user;
 usename  | usesysid  | usecreatedb | usesuper | usecatupd |  passwd  | valuntil | useconfig 
----------+-----------+-------------+----------+-----------+----------+----------+-----------
 postgres |        10 | t           | t        | t         | ******** |          | 
 masa     |     16389 | t           | t        | t         | ******** |          | 
 ydpm     |     16395 | t           | t        | t         | ******** |          | 
 yus      |   5018772 | t           | f        | f         | ******** |          | 
 ydim     | 320141698 | t           | t        | t         | ******** |          | 

Stop auto invoicer (temporarily)

Experiment

lib/ydim/server.rb

        def initialize(config, logger)
p "getin Server#initialize"

Run bin/ydimd

Result

masa@masa ~/ywesee/ydim $ bin/ydimd 
ERROR:  relation "object" already exists

ERROR:  relation "prefetchable_index" already exists

ERROR:  relation "extent_index" already exists

ERROR:  relation "object_connection" already exists

ERROR:  relation "target_id_index" already exists

ERROR:  relation "collection" already exists

ERROR:  relation "target_id_ydim_invoice_unique_id" already exists

ERROR:  relation "target_id_ydim_debitor_unique_id" already exists

ERROR:  relation "target_id_ydim_autoinvoice_unique_id" already exists

ERROR:  relation "target_id_ydim_debitor_name" already exists

ERROR:  relation "target_id_ydim_debitor_email" already exists

ERROR:  relation "target_id_ydim_invoice_status" already exists

I, [2010-12-27T08:50:00.443671 #3547]  INFO -- AutoInvoicer: next run Tue Dec 28 01:00:00 2010, sleeping 58199 seconds
I, [2010-12-27T08:50:00.444248 #3547]  INFO -- CurrencyUpdater: next run Tue Dec 28 02:00:00 2010, sleeping 61799 seconds
I, [2010-12-27T08:50:00.444353 #3547]  INFO -- StatusUpdater: next run Tue Dec 28 01:00:00 2010, sleeping 58199 seconds
I, [2010-12-27T08:50:00.444733 #3547]  INFO -- start: starting ydim-server on druby://localhost:12375

Note

  • It seems that YDIM::Server#initialize is not called
  • Why

Experiment

masa@masa ~/ywesee $ sudo -u postgres dropdb ydim
masa@masa ~/ywesee $ sudo -u postgres createdb -E UTF8 -T template0 ydim
masa@masa ~/ywesee/ydim $ mv lib/ydim/server.rb ~/work/

Run bin/ydimd

Result

masa@masa ~/ywesee/ydim $ bin/ydimd 
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "object_pkey" for table "object"
NOTICE:  CREATE TABLE / UNIQUE will create implicit index "object_name_key" for table "object"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "object_connection_pkey" for table "object_connection"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "collection_pkey" for table "collection"
I, [2010-12-27T09:17:14.073480 #3844]  INFO -- AutoInvoicer: next run Tue Dec 28 01:00:00 2010, sleeping 56565 seconds
I, [2010-12-27T09:17:14.745734 #3844]  INFO -- CurrencyUpdater: next run Tue Dec 28 02:00:00 2010, sleeping 60165 seconds
I, [2010-12-27T09:17:14.745798 #3844]  INFO -- StatusUpdater: next run Tue Dec 28 01:00:00 2010, sleeping 56565 seconds
I, [2010-12-27T09:17:14.746005 #3844]  INFO -- start: starting ydim-server on druby://localhost:12375

Note

  • Even if there is no lib/ydim/server.rb, the server daemon (thread) looks running?

Check ydimd

masa@masa ~/ywesee/ydim $ whereis ydimd
ydimd: /usr/bin/ydimd

Note

  • ydim is installed, that is why ydimd runs without lib/ydim/server.rb

Uninstall ydimd

masa@masa ~/ywesee/ydim $ cp ../xls2odat/setup.rb .
masa@masa ~/ywesee/ydim $ sudo setup.rb
masa@masa ~/ywesee/ydim $ sudo setup.rb --force uninstall

Stop AutoInvoicer, CurrencyUpdater, StatusUpdater

Clean database

masa@masa ~/ywesee $ sudo -u postgres dropdb ydim
masa@masa ~/ywesee $ sudo -u postgres createdb -E UTF8 -T template0 ydim

Comment out

        def initialize(config, logger)
...
=begin
            if(hour = config.autoinvoice_hour)
                @autoinvoicer = repeat_at(hour, 'AutoInvoicer') {
                    AutoInvoicer.new(@serv).run
                }
            end
            if(hour = config.currency_update_hour)
                if(@serv.currency_converter.known_currencies \
                     < @serv.config.currencies.size)
                    CurrencyUpdater.new(@serv).run
                end
                @currency_updater = repeat_at(hour, 'CurrencyUpdater') {
                    CurrencyUpdater.new(@serv).run
                }
            end
      @status_updater = repeat_at(1, 'StatusUpdater') {
        Invoice.all { |inv| inv.save }
      }
=end
            @sessions = []
        end

Run bin/ydimd

masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd 
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "object_pkey" for table "object"
NOTICE:  CREATE TABLE / UNIQUE will create implicit index "object_name_key" for table "object"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "object_connection_pkey" for table "object_connection"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "collection_pkey" for table "collection"
I, [2010-12-27T09:39:34.843470 #4319]  INFO -- start: starting ydim-server on druby://localhost:12375

Note

  • Good

Set up virtual host

Check the setting on ydim server

masa@masa ~/work $ scp ywesee@$THIN:/etc/apache2/vhosts.d/ydim.ywesee.com.conf .
ydim.ywesee.com.conf                                                                                                                 100% 1741     1.7KB/s   00:00    

masa@masa /etc/apache2/vhosts.d $ sudo vim 06_ydim_vhost.conf

<Directory /home/masa/ywesee/ydim/doc>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<VirtualHost *:80>
DocumentRoot /home/masa/ywesee/ydim/doc
ServerName masa.ydim.com
DirectoryIndex index.rbx
RubyAddPath /var/www/ydim.ywesee.com/
RubyRequire 'sbsm/trans_handler'
SetHandler ruby-object
RubyTransHandler SBSM::TransHandler.instance
</VirtualHost>

Reboot apache

masa@masa /etc/apache2/vhosts.d $ sudo /etc/init.d/apache2 restart
* Stopping apache2...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                                                     [ok]
* Starting apache2...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                                                     [ok]

Run

  • bin/ydimd
  • bin/ydim-htmld

ydimd

masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd 
I, [2010-12-27T10:10:14.087471 #4885]  INFO -- start: starting ydim-server on druby

ydim-htmld

masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld 
./lib/ydim/html/view/htmlgrid.rb:17: warning: already initialized constant HTTP_HEADERS
./lib/ydim/html/view/htmlgrid.rb:80: warning: already initialized constant STRIPED_BG
./lib/ydim/html.rb:3: warning: already initialized constant VERSION
./lib/ydim/html/util/server.rb:18:in `read': can't convert nil into String (TypeError)
        from ./lib/ydim/html/util/server.rb:18:in `initialize'
        from bin/ydim-htmld:32:in `new'
        from bin/ydim-htmld:32

Check lib/ydim/html/util/server.rb:18

    def initialize(server)
        @server = server
        @private_key = OpenSSL::PKey::DSA.new(File.read(Html.config.root_key))  #<= here
        @system = YDIM::Client.new(Html.config)
        super(@system)
    end

Note

  • I have to set up ydim.yml

Set up ydim.yml

Check config.rb

lib/ydim/config.rb

#!/usr/bin/env ruby
# CONFIG -- ydim -- 12.01.2006 -- hwyss@ywesee.com

require 'rclconf'
require 'fileutils'

module YDIM
        VERSION = '1.0.0'
    class Client
        home_dir = ENV['HOME'] || '/tmp'
        ydim_default_dir = File.join(home_dir, '.ydim')
        default_config_files = [
            File.join(ydim_default_dir, 'ydim.yml'),
            '/etc/ydim/ydim.yml',
        ]

lib/ydim/server.rb

module YDIM
    class Server
    ydim_default_dir = File.join(ENV['HOME'], '.ydim')
    default_config_files = [
      File.join(ydim_default_dir, 'ydimd.yml'),
      '/etc/ydim/ydimd.yml',
    ]

lib/ydim/html/config.rb

module YDIM
    module Html
ydim_default_dir = '/var/ydim/'
if(home = ENV['HOME'])
  ydim_default_dir = File.join(home, '.ydim')
end
default_config_files = [
 'etc/ydim-htmld.yml',
  File.join(ydim_default_dir, 'ydim-htmld.yml'),
  '/etc/ydim/ydim-htmld.yml',
]

Notes

  • lib/ydim/config.rb, ydim.yml: parameters for Client
  • lib/ydim/server.rb, ydimd.yml: parameters for Server (ydimd)
  • lib/ydim/lib/html/config.rb, ydim-htmld.yml: parameters for Server (ydim-htmld)
    • The file names are not good
  • ydim.yml (Client) files are 1.$HOME/.ydim/ydim.yml, or 2. /etc/ydim/ydim.yml
  • ydimd.yml (Server) files are 1. $HOME/.ydim/ydimd.yml, or 2. /etc/ydim/ydimd.yml
  • ydim-htmld.yml (Server) files are 1. $HOME/.ydim/ydim-htmld.yml, or 2. /etc/ydim/ydim-htmld.yml

Check ydim.yml, ydimd.yml on ydim server

masa@masa ~/work/ydim_etc $ scp ywesee@$THIN:/etc/ydim/*.yml .
ydim-htmld.yml                                                                                                                       100%  147     0.1KB/s   00:00    
ydim.yml                                                                                                                             100%   81     0.1KB/s   00:00    
ydimd.yml                                                                                                                            100%  532     0.5KB/s   00:00   

masa@masa ~/work/ydim_home_etc $ scp ywesee@$THIN:/var/www/ydim.ywesee.com/etc/*.* .
config.rb                                                                                                                            100%  919     0.9KB/s   00:00    
ydim-htmld.yml                                                                                                                       100%  108     0.1KB/s   00:00    
ydim.ywesee.com.crt                                                                                                                  100% 1229     1.2KB/s   00:00    
ydim.ywesee.com.key                                                                                                                  100%  497     0.5KB/s   00:00    

ydim.yml

---
private_key: '/usr/share/ydim/xxx'
server_url: druby://192.168.0.xx:12375

Note

  • I guess I have to create 'private_key'

ydimd.yml

---
autoinvoice_hour: 2
log_level: DEBUG
mail_from: 'Zeno Davatz <zdavatz@ywesee.com>'
mail_recipients:
- 'hwyss@ywesee.com'
server_url: druby://192.168.0.xx:12375
smtp_from: 'zdavatz@ywesee.com'
smtp_server: 'mail.ywesee.com'
root_email: 'zdavatz@ywesee.com'
root_key: '/etc/xxx/xxx'
smtp_domain: ywesee.com
smtp_server: smtp.gmail.com
smtp_user: xxx@ywesee.com
smtp_pass: 'xxx'
mail_body: |
 %s %s

 Anbei die Rechnung für %s.

 Besten Dank für Ihren Auftrag!

 Mit freundlichen Grüssen
 Zeno Davatz
 043 540 05 50

Note

  • Two 'smtp_server' parameters are here
  • Which is valid?
  • I have to create 'root_key'

ydim-html.yml

---
server_url: druby://192.168.0.xx:12375
email: 'zdavatz@ywesee.com'
md5_pass: 'xxx'
root_key: '/etc/xxx/xxx'

Note

  • I have to create 'root_key'

make yml files for local environment

ydim.yml

---
private_key: '/home/masa/.ssh/id_dsa'

ydimd.yml

---
autoinvoice_hour: 2
log_level: DEBUG
mail_from: 'Masa <mhatakeyama@ywesee.com>'
mail_recipients:
- 'mhatakeyama@ywesee.com'
smtp_from: 'mhatakeyama@ywesee.com'
root_email: 'mhatakeyama@ywesee.com'
root_key: '/home/masa/.ssh/root_dsa'
smtp_domain: ywesee.com
smtp_server: smtp.gmail.com
smtp_user: mhatakeyama@ywesee.com
smtp_pass: 'xxx'
mail_body: |
 %s %s

 This is a test.

ydim-htmld.yml

---
email: 'mhatakeyama@ywesee.com'
md5_pass: 'xxx'
root_key: '/home/masa/.ssh/id_dsa'

Note

  • How do I make the 'md5_pass'?

Check md5

masa@masa ~/ywesee/sbsm $ grep -r "digest" *
lib/sbsm/drbserver.rb:require 'digest/md5'
lib/sbsm/validator.rb:require 'digest/md5'
lib/sbsm/validator.rb:                    Digest::MD5::hexdigest(value)

test.rb

require 'digest/md5'
p Digest::MD5::hexdigest(ARGV[0])
masa@masa ~/work $ ruby md5.rb xxx
"9415cb40b7edf3886ed28b07d7c07610"

Question

  • How do I start ydim client?

Run

  • ydimd
  • ydim-htmld

bin/ydimd

masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" 
I, [2010-12-27T11:31:40.242442 #6345]  INFO -- start: starting ydim-server on druby://localhost:12375

bin/ydim-htmld

masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml" 
./lib/ydim/html/view/htmlgrid.rb:17: warning: already initialized constant HTTP_HEADERS
./lib/ydim/html/view/htmlgrid.rb:80: warning: already initialized constant STRIPED_BG
./lib/ydim/html.rb:3: warning: already initialized constant VERSION

Note

  • Looks good

Access http://masa.ydim.com/

Result

  • I cannot see the top page

/etc/hosts

127.0.0.1   masa localhost masa.ydim.com

Reboot apache

masa@masa ~/ywesee/ydim $ sudo /etc/init.d/apache2 restart
* Stopping apache2...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                                                     [ok]
* Starting apache2...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                                                     [ok]

Access again http://masa.ydim.com/

Result

  • Internal Server Error

Check apache log

masa@masa ~/ywesee/ydim $ vim /var/log/apache2/error_log 

[Mon Dec 27 11:35:39 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 11:35:39 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 11:35:39 2010] [error] mod_ruby: error in ruby
[Mon Dec 27 11:35:39 2010] [error] mod_ruby: /home/masa/ywesee/ydim/doc/index.rbx:5:in `load': no such file to load -- etc/config.rb (LoadError)
[Mon Dec 27 11:35:39 2010] [error] mod_ruby:   from /home/masa/ywesee/ydim/doc/index.rbx:5
[Mon Dec 27 11:35:39 2010] [error] mod_ruby:   from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Mon Dec 27 11:35:39 2010] [error] mod_ruby:   from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'
[Mon Dec 27 11:35:39 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 11:35:39 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 11:35:39 2010] [error] [client 127.0.0.1] File does not exist: /home/masa/ywesee/ydim/doc/favicon.ico
[Mon Dec 27 11:35:40 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 11:35:40 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 11:35:40 2010] [error] [client 127.0.0.1] File does not exist: /home/masa/ywesee/ydim/doc/favicon.ico

Note

  • etc/config.rb load error
  • favicon.ico load error
  • trans_handler.yml load error

locate trans_handler.yml

masa@masa ~/ywesee/ydim $ locate trans_handler.yml
/home/masa/bbmb.ch_setup/whitie_etc/trans_handler.yml
/home/masa/de_oddb_setup/etc/trans_handler.yml
/home/masa/ywesee/de.oddb.org/etc/trans_handler.yml
/home/masa/ywesee/oddb.org/etc/trans_handler.yml

Down load favicon.ico

masa@masa ~/ywesee/ydim/doc $ scp ywesee@$THIN:/var/www/ydim.ywesee.com/doc/favicon.ico .
favicon.ico                                                                                                                          100% 1406     1.4KB/s   00:00    

Reboot

  • ydimd
  • ydim-htmld
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" 
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml" 

Access http://masa.ydim.com/

Result

  • Internal Server Error

/var/log/apache2/error_log

[Mon Dec 27 13:43:09 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 13:43:09 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 13:43:09 2010] [error] mod_ruby: error in ruby
[Mon Dec 27 13:43:09 2010] [error] mod_ruby: /home/masa/ywesee/ydim/doc/index.rbx:5:in `load': no such file to load -- etc/config.rb (LoadError)
[Mon Dec 27 13:43:09 2010] [error] mod_ruby:   from /home/masa/ywesee/ydim/doc/index.rbx:5
[Mon Dec 27 13:43:09 2010] [error] mod_ruby:   from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Mon Dec 27 13:43:09 2010] [error] mod_ruby:   from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'

Note

  • 'favicon.ico' error is resolved

Check doc/index.rbx:5

#!/usr/bin/env ruby
# index.rbx -- ydim-html -- hwyss@ywesee.com

require 'sbsm/request'
load 'etc/config.rb'      #<= here

DRb.start_service('druby://localhost:0')

begin
    config = YDIM::Html::Util::CONFIG
    SBSM::Request.new(config.html_url).process
rescue Exception => e
    $stderr << "ydim-html Client Error: " << e.message << "\n"
    $stderr << e.class << "\n"
    $stderr << e.backtrace.join("\n") << "\n"
end

Download config.rb

masa@masa ~/ywesee/ydim $ mkdir etc
masa@masa ~/ywesee/ydim $ cd etc
masa@masa ~/ywesee/ydim/etc $ scp ywesee@$THIN:/var/www/ydim.ywesee.com/etc/config.rb .
config.rb                                                                                                                            100%  919     0.9KB/s   00:00    

ydim/etc/config.rb

#!/usr/bin/env ruby
# etc/config -- ydim -- 12.01.2006 -- hwyss@ywesee.com

require 'rclconf'
require 'digest/md5'

module YDIM
        module Html
                module Util
ydim_default_dir = '/var/ydim/'
if(home = ENV['HOME'])
        ydim_default_dir = File.join(home, '.ydim')
end
default_config_files = [
        File.join(ydim_default_dir, 'ydim-htmld.yml'),
        '/etc/ydim/ydim-htmld.yml',
]
defaults = {
        'config'                                        => default_config_files,
        'client_url'                    => 'druby://localhost:0',
        'currency'                              => 'CHF',
        'email'                                         => 'mhatakeyama@ywesee.com',
        'html_url'                              => 'druby://localhost:12376',
        'md5_pass'                              => Digest::MD5.hexdigest('52aec317b37d4c99e9ff7adcf140fe34'),
        'proxy_url'                             => 'druby://localhost:0',
        'server_url'                    => 'druby://localhost:12375', 
        'root_key'                              => '/home/masa/.ssh/id_dsa',
        'user'                                          => nil,
        'ydim_dir'                              => ydim_default_dir,
}
config = RCLConf::RCLConf.new(ARGV, defaults)
config.load(config.config)

CONFIG = config
                end
        end
end

Reboot

  • ydimd
  • ydim-htmld
  • apache2
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" 
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml" 
masa@masa ~/ywesee/ydim $ sudo /etc/init.d/apache2 restart

Access http://masa.ydim.com/

Result

  • Internal Server Error

var/log/apache2/error_log

[Mon Dec 27 13:53:19 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 13:53:19 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 13:53:19 2010] [error] mod_ruby: error in ruby
[Mon Dec 27 13:53:19 2010] [error] mod_ruby: /home/masa/ywesee/ydim/doc/index.rbx:5:in `load': no such file to load -- etc/config.rb (LoadError)
[Mon Dec 27 13:53:19 2010] [error] mod_ruby:   from /home/masa/ywesee/ydim/doc/index.rbx:5
[Mon Dec 27 13:53:19 2010] [error] mod_ruby:   from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Mon Dec 27 13:53:19 2010] [error] mod_ruby:   from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'

Note

  • There is still 'etc/config.rb' error

ydim/doc/index.rbx

#load 'etc/config.rb'
load '/home/masa/ywesee/ydim/etc/config.rb'

Reboot

  • ydimd
  • ydim-htmld
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" 
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml" 

Access http://masa.ydim.com/

Result

  • Success (login interface comes)

Login test

Email: mhatakeyama@ywesee.com Pass: xxx

Result

ydimd console

D, [2010-12-27T14:18:18.318108 #8904] DEBUG -- druby://localhost:12376: attempting login
Enter PEM pass phrase:   (pass phrase is required here)
E, [2010-12-27T14:19:21.698504 #8904] ERROR -- unknown user: OpenSSL::PKey::DSAError - Neither PUB key nor PRIV key:: nested asn1 error

ydim-htmld console

error in SBSM::Session#process: /de
OpenSSL::PKey::DSAError
Neither PUB key nor PRIV key:: nested asn1 error
(druby://localhost:12375) ./lib/ydim/util.rb:13:in `initialize'
(druby://localhost:12375) ./lib/ydim/util.rb:13:in `new'
(druby://localhost:12375) ./lib/ydim/util.rb:13:in `load_key'
(druby://localhost:12375) ./lib/ydim/server.rb:77:in `initialize'
(druby://localhost:12375) /usr/lib64/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/lifecycle/singleton.rb:42:in `call'

Note

  • This is probably due to trans_handler.yml

/var/log/apache2/error_log

[Mon Dec 27 14:14:43 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 14:14:43 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml
[Mon Dec 27 14:18:18 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/ydim/etc/trans_handler.yml
[Mon Dec 27 14:18:18 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml

browser

Note

  • It looks succeeded in login but this is probably failure result

Check ydimd.yml

root_email: 'mhatakeyama@ywesee.com'
#root_key: '/home/masa/.ssh/root_dsa'
root_key: '/home/masa/.ssh/id_dsa'

Note

  • 'root_key' path is wrong

Reboot

  • ydimd
  • ydim-htmld
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydimd config="ydimd.yml" 
masa@masa ~/ywesee/ydim $ ruby -I lib bin/ydim-htmld config="ydim-htmld.yml" 

Access http://masa.ydim.com/

Result

  • Success

Test Neu Kunde test

Note

  • Success

Test Neue Rechnung

Note

  • How do I put a price in the 'Rechnung'?

Note

  • 'Neue Position' button does not work
  • Why?

Index Error

IndexError
invalid invoice_id: 10000
(druby://localhost:12375) ./lib/ydim/root_session.rb:114:in `invoice'
./lib/ydim/client.rb:26:in `send'
./lib/ydim/client.rb:26:in `method_missing'
./lib/ydim/html/util/server.rb:28:in `send'
./lib/ydim/html/util/server.rb:28:in `method_missing'

Notes

  • If I click 'Rechnung ID', then the error comes
  • If I use data on ydim server, the 'Neue Position' button works and the 'Rechnung ID' error has gone

Notes

  • I do not know why the error comes
    • It is certain that missing some data is the cause

Test sending email

Sehr geehrter Herr Masa

This is a test.
Attached: Rechnung_masapotheke_#11562,_aaa.pdf

Debug Index Error

Clear data

masa@masa ~/ywesee/ydim $ sudo -u postgres dropdb ydim
masa@masa ~/ywesee/ydim $ sudo -u postgres createdb -E UTF8 -T template0 ydim

Reboot

  • ydimd
  • ydim-htmld

ydim-htmld console

error in SBSM::Session#process: /de/invoice/unique_id/10000
IndexError
invalid invoice_id: 10000
(druby://localhost:12375) ./lib/ydim/root_session.rb:114:in `invoice'
./lib/ydim/client.rb:26:in `send'
./lib/ydim/client.rb:26:in `method_missing'
./lib/ydim/html/util/server.rb:28:in `send'
./lib/ydim/html/util/server.rb:28:in `method_missing'

Note

  • This error comes when I click 'Rechnung ID'
  • This error is probably related to 'Neue Position' button function
view · edit · sidebar · attach · print · history
Page last modified on July 13, 2011, at 12:04 PM