<< Masa.20100906-debug-gkv | 2010 | >>
Attach:00_vhost_de.oddb_local.conf (from zeno local)
Attach:trans_handler.yml (placed in etc/ of de.oddb.org)
Attach:oddb.yml (placed in etc/ of de.oddb.org)
Attach:gem_list_03_09_2010.txt (zeno local file)
Attach:config.rb (from lib/oddb from zeno local)/
yus_grant email@ywesee.com view org.oddb.de
yus_grant email@ywesee.com login org.oddb.de.PowerUser
yus_grant email@ywesee.com login org.oddb.de.Admin
Command
$ git clone ssh://ywesee@scm.ywesee.com/home/ywesee/git/de.oddb.org $ ruby bin/oddbd
Error
/home/masa/ywesee/de.oddb.org/lib/oddb/html/view/drugs/package.rb:373: warning: parenthesize argument(s) for future version /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- htmlentities (LoadError) from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/masa/ywesee/de.oddb.org/lib/oddb/import/pharmnet.rb:5 from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/masa/ywesee/de.oddb.org/lib/oddb/html/state/drugs/admin/package.rb:6 from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/masa/ywesee/de.oddb.org/lib/oddb/html/state/viral/admin.rb:4 ... 17 levels... from /home/masa/ywesee/de.oddb.org/lib/oddb/util.rb:9 from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from bin/oddbd:11
Install htmlentities
$ sudo gem install htmlentities
Log
/home/masa/ywesee/de.oddb.org/lib/oddb/html/view/drugs/package.rb:373: warning: parenthesize argument(s) for future version I, [2010-09-03T09:09:03.910671 #3716] INFO -- start: starting oddb-server on druby://localhost:11000
It looks running.
Setting
$ sudo vim /etc/apache2/vhosts.d/01_oddb_vhost.conf <VirtualHost *:80> DocumentRoot /home/masa/ywesee/de.oddb.org/doc ServerName de.oddb.masa.org DirectoryIndex index.rbx #DirectoryIndex index.html RubyAddPath /home/masa/ywesee/de.oddb.org/src RubyRequire 'sbsm/trans_handler' SetHandler ruby-object RubyTransHandler SBSM::FlavoredTransHandler.instance SetEnv DEFAULT_FLAVOR gcc </VirtualHost> $ sudo vim /etc/host 127.0.0.1 masa localhost oddb.masa.org www.masa.org de.oddb.masa.org $ sudo /etc/init.d/apache2 restart
Browser
Forbidden You don't have permission to access /index.rbx on this server.
$ sudo vim /etc/apache2/vhosts.d/03_de.oddb_vhost.conf <Directory /home/masa/ywesee/de.oddb.org/doc> Options ExecCGI FollowSymlinks Indexes AllowOverride None Order allow,deny Allow from all </Directory> <Directory /home/masa/ywesee/de.oddb.org/data/css> Order allow,deny Allow from all </Directory> <VirtualHost *:80> DocumentRoot /home/masa/ywesee/de.oddb.org/doc ServerName de.oddb.masa.org DirectoryIndex index.rbx #DirectoryIndex index.html RubyAddPath /home/masa/ywesee/de.oddb.org/src RubyRequire 'sbsm/trans_handler' SetHandler ruby-object RubyTransHandler SBSM::FlavoredTransHandler.instance SetEnv DEFAULT_FLAVOR gcc </VirtualHost>
$ sudo /etc/init.d/apache2 restart
Browser
Internal Server Error
Changing virtual host setting
$ sudo vim /etc/apache2/vhosts.d/03_de.oddb_vhost.conf <Directory /home/masa/ywesee/de.oddb.org/doc> Options ExecCGI AllowOverride None Order allow,deny Allow from all </Directory> <Directory /home/masa/ywesee/de.oddb.org/var/images> AllowOverride None Order allow,deny Allow from all </Directory> <Directory /home/masa/ywesee/de.oddb.org/var/captcha> AllowOverride None Order allow,deny Allow from all </Directory> <Directory /home/masa/ywesee/de.oddb.org/var/rss> AllowOverride None Order allow,deny Allow from all </Directory> ## de.oddb.org ## <VirtualHost *:80> DocumentRoot /home/masa/ywesee/de.oddb.org/doc ServerName de.oddb.masa.org DirectoryIndex index.rbx RubyAddPath /home/masa/ywesee/de.oddb.org/lib RubyRequire 'sbsm/trans_handler' SetHandler ruby-object RubyTransHandler SBSM::ZoneTransHandler.instance SetEnv DEFAULT_FLAVOR oddb SetEnv DRB_SERVER druby://localhost:11000 Alias /rss /home/masa/ywesee/de.oddb.org/var/rss Alias /images /home/masa/ywesee/de.oddb.org/var/images Alias /captcha /home/masa/ywesee/de.oddb.org/var/captcha </VirtualHost>
Browswer
Internal Server Error
/var/log/apache2/error_log
[Fri Sep 03 09:32:34 2010] [warn] Unable to load url configuration: No such file or directory - /home/masa/ywesee/de.oddb.org/etc/trans_handler.yml [Fri Sep 03 09:32:34 2010] [notice] Hint: store configuration in a YAML-File at DOCUMENT_ROOT/../etc/trans_handler.yml [Fri Sep 03 09:32:34 2010] [error] mod_ruby: error in ruby [Fri Sep 03 09:32:34 2010] [error] mod_ruby: /home/masa/ywesee/de.oddb.org/doc/index.rbx:5:in `require': no such file to load -- encoding/character/utf-8 (LoadError) [Fri Sep 03 09:32:34 2010] [error] mod_ruby: from /home/masa/ywesee/de.oddb.org/doc/index.rbx:5 [Fri Sep 03 09:32:34 2010] [error] mod_ruby: from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load' [Fri Sep 03 09:32:34 2010] [error] mod_ruby: from /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'
Copying files from production server
masa@masa ~/ywesee/de.oddb.org $ mkdir etc masa@masa ~/ywesee/de.oddb.org $ scp xxx@xxx:/var/www/de.oddb.org/etc/*.yml .
We also haded to add require 'rubygems' to doc/index.rb
masa@masa ~/ywesee/de.oddb.org $ vim doc/index.rbx
Checking it by browswer
Apache error log
[Fri Sep 03 10:14:52 2010] [warn] [client 127.0.0.1] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: Fri Sep 03 10:15:28 +0200 2010 - 69899855256360 - ArgumentError - drbsession_uri not specified [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/cgi/drbsession.rb:12:in `initialize' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/1.8/cgi/session.rb:274:in `new' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/1.8/cgi/session.rb:274:in `initialize' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb:96:in `new' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb:96:in `drb_process' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb:69:in `process' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /home/masa/ywesee/de.oddb.org/doc/index.rbx:11 [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load' [Fri Sep 03 10:15:28 2010] [error] access to / failed for (null), reason: /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'
Modifing config.rb
vim /home/masa/ywesee/de.oddb.org/lib/oddb/config.rb 'server_name' => 'de.oddb.masa.org',
Then it works.
$ vim etc/oddb.yml admins: - @@mhatakeyama@ywesee.com@@ debug_recipients: - @@mhatakeyama@ywesee.com@@ credentials: whocc: username: 'xxxx@ywesee.com' password: xxxx product_infos: pop_server: mail.ywesee.com pop_user: xxxx@oddb.org pop_pass: xxxx log_level: DEBUG http_server: http://de.oddb.masa.org smtp_server: mail.ywesee.com remote_databases: - 'druby://localhost:10013' run_updater: true run_exporter: true paypal_server: www.paypal.com paypal_receiver: xxxx@ywesee.com mail_invoice_from: '"XXXX" <xxxx@ywesee.com>' mail_invoice_smtp: xxxx@ywesee.com remote_export_dir: /var/www/oddb.org/data/downloads smtp_domain: ywesee.com smtp_server: smtp.gmail.com smtp_user: @@mhatakeyama@ywesee.com@@ smtp_pass: @@'xxxx'@@
From Davatz-san
My local imagemagick version is 6.6.1.2 For the images of captcha to be created correctly you need the follwing version /usr/lib/libjpeg.so.62 but as I understand because rmagick 2.9.0 only works with jpeg-8a you have to replace /usr/lib/libjpeg.so.8.0.2 with /usr/lib/libjpeg.so.62 after you done sudo emerge =imagemagick-6.6.1.2 This is from my 32bit system. My local de.oddb.org crashed as well when I tried to click onto the Feedback-RSS-links. The error I got was that libjpeg.so.62 is expected.
test_gkv.rb has 2 Failures and 1 Error.
masa@masa ~/ywesee/de.oddb.org $ ruby test/import/test_gkv.rb Loaded suite test/import/test_gkv Started .FFE.... Finished in 0.060373 seconds. 1) Failure: test_import(ODDB::Import::TestGkv) [test/import/test_gkv.rb:106]: <2> expected but was <0>. 2) Failure: test_import__ml(ODDB::Import::TestGkv) [test/import/test_gkv.rb:178]: <1> expected but was <3>. 3) Error: test_latest_url(ODDB::Import::TestGkv): NoMethodError: undefined method `html_parser' for nil:NilClass /usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:80:in `parser' /home/masa/ywesee/de.oddb.org/lib/oddb/import/gkv.rb:88:in `latest_url' test/import/test_gkv.rb:77:in `test_latest_url' 8 tests, 13 assertions, 2 failures, 1 errors
Checking Mechanize library
masa@masa ~/ywesee/de.oddb.org $ gem search mechanize *** LOCAL GEMS *** mechanize (1.0.0) ywesee@productionserver ~ $ gem search mechanize *** LOCAL GEMS *** mechanize (1.0.0, 0.6.11)
There are two mechanizes on the production server.
Checking Nokogiri library
masa@masa ~/ywesee/de.oddb.org $ gem search nokogiri *** LOCAL GEMS *** nokogiri (1.4.2) ywesee@productionserver ~ $ gem search nokogiri *** LOCAL GEMS *** nokogiri (1.4.0, 1.2.3)
There are also two libraries of Nokogiri on the production server.
This error message
/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:80:in `parser'
means
Mechanize::Page def parser return @parser if @parser if body && response if mech.html_parser == Nokogiri::HTML
mech becomes Nil, in other words, @mech == nil
Testing in my local
require 'mechanize' html_dir = "/home/masa/ywesee/de.oddb.org/test/import/data/html/gkv" path = File.join html_dir, 'URL comes here' html = File.read(path) url = 'URL comes here' response = {'content-type' => 'text/html'} page = Mechanize::Page.new(URI.parse(url), response, html, 200) p page
Result
/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:80:in `parser': undefined method `html_parser' for nil:NilClass (NoMethodError) from test.rb:11
Experiment
$ sudo vim /usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb def parser print caller(0).pretty_inspect
Result
"/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:78:in `parser'", "(__FORWARDABLE__):3:in `search'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:229:in `meta'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:21:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:20:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:150:in `object_group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:16:in `pretty_print'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:119:in `guard_inspect_key'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:51:in `inspect'", "test.rb:16:in `p'",
Experiment
require 'mechanize' html_dir = "/home/masa/ywesee/de.oddb.org/test/import/data/html/gkv" path = File.join html_dir, 'Part of URL comes here' html = File.read(path) url = 'URL comes here' response = {'content-type' => 'text/html'} #page = Mechanize::Page.new(URI.parse(url), response, html, 200) page = Mechanize.new.get(url) p page
Result
"/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:78:in `parser'", "(__FORWARDABLE__):3:in `search'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:229:in `meta'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:21:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:20:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:150:in `object_group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:16:in `pretty_print'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:119:in `guard_inspect_key'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:51:in `inspect'", "test.rb:17:in `p'", "test.rb:17"] ["/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:78:in `parser'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:53:in `title'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:24:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:24:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:150:in `object_group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:16:in `pretty_print'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:119:in `guard_inspect_key'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:51:in `inspect'", "test.rb:17:in `p'", "test.rb:17"] ["/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:78:in `parser'", "(__FORWARDABLE__):3:in `search'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/page.rb:53:in `title'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:24:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:24:in `pretty_print'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:150:in `object_group'", "/usr/lib64/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize/inspect.rb:16:in `pretty_print'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/prettyprint.rb:201:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:227:in `nest'", "/usr/lib64/ruby/1.8/prettyprint.rb:200:in `group'", "/usr/lib64/ruby/1.8/prettyprint.rb:212:in `group_sub'", "/usr/lib64/ruby/1.8/prettyprint.rb:199:in `group'", "/usr/lib64/ruby/1.8/pp.rb:140:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:119:in `guard_inspect_key'", "/usr/lib64/ruby/1.8/pp.rb:77:in `pp'", "/usr/lib64/ruby/1.8/pp.rb:51:in `inspect'", "test.rb:17:in `p'", "test.rb:17"]
From Davatz-san exporting chde.xls from de.oddb.org. - using screen.
If you want to run jobs/export_chde_xls Then you will need oddb.org/ext/readonly/bin/readonlyd running. Also bin/exportd of de.oddb.org has to run. Don't forget to run the jobs from the de.oddb.org/ directory.
From Davatz-san exporting chde.xls from de.oddb.org. - using screen.
I guess the best is if your run all these jobs in one screen with screen then do ctrl+a ctrl+c that will create a new screen in the same session. After that you can switch between screens doing ctrl+a n that will take you through the screens. After that you can detach the screen using ctrl+a ctrl+d If you want to get back you can do screen -list and then scren -x "screen number you want to attach to".