<< | Index | >>
success
Found the cause
Error email Mon Nov 1 04:09:08 2010: ODDB::Export::Xls::ComparisonDeCh
Mon Nov 1 04:09:08 2010: ODDB::Export::Xls::ComparisonDeCh#export NoMethodError undefined method `active_agents' for nil:NilClass (druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send' (druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing' (druby://localhost:10013) /var/www/oddb.org/src/model/part.rb:31:in `active_agents' (druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send' (druby://localhost:10013) /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing' (druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `active_agents' (druby://localhost:10013) /usr/lib64/ruby/1.8/drb/drb.rb:395:in `inject' (druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `each' (druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `inject' (druby://localhost:10013) /var/www/oddb.org/src/model/package.rb:68:in `active_agents' (druby://localhost:11001) /var/www/de.oddb.org/lib/oddb/remote/drugs/package.rb:27:in `active_agents' (druby://localhost:11001) /var/www/de.oddb.org/lib/oddb/remote/drugs/package.rb:75:in `local_comparables' (druby://localhost:11001) /var/www/de.oddb.org/lib/oddb/export/xls.rb:27:in `collect_comparables' (druby://localhost:11001) /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `call' (druby://localhost:10013) /usr/lib64/ruby/1.8/drb/invokemethod.rb:10:in `block_yield' (druby://localhost:10013) /usr/lib64/ruby/1.8/drb/invokemethod.rb:17:in `perform_with_block' (druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:40:in `call' (druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:40:in `remote_each_package' (druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:38:in `each' (druby://localhost:10013) /var/www/oddb.org/ext/readonly/src/readonly_server.rb:38:in `remote_each_package' /var/www/de.oddb.org/lib/oddb/export/xls.rb:22:in `collect_comparables' /var/www/de.oddb.org/lib/oddb/export/xls.rb:15:in `export' /var/www/de.oddb.org/lib/oddb/export/server.rb:57:in `safe_export' /usr/lib64/ruby/1.8/tempfile.rb:172:in `open' /var/www/de.oddb.org/lib/oddb/export/server.rb:54:in `safe_export' /var/www/de.oddb.org/lib/oddb/export/server.rb:25:in `export_chde_xls' /var/www/de.oddb.org/lib/oddb/export/server.rb:39:in `run' /var/www/de.oddb.org/lib/oddb/export/server.rb:48:in `call' /var/www/de.oddb.org/lib/oddb/export/server.rb:48:in `on_monthday' /var/www/de.oddb.org/lib/oddb/export/server.rb:38:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `__send__' /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `perform_without_block' /usr/lib64/ruby/1.8/drb/drb.rb:1515:in `perform' /usr/lib64/ruby/1.8/drb/drb.rb:1589:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1585:in `loop' /usr/lib64/ruby/1.8/drb/drb.rb:1585:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1581:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1581:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1430:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1427:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1427:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1347:in `initialize' /usr/lib64/ruby/1.8/drb/drb.rb:1627:in `new' /usr/lib64/ruby/1.8/drb/drb.rb:1627:in `start_service' /var/www/de.oddb.org/bin/exportd:35
Notes
Reviews
Set up
In order to run readonlyd, I have to change the require path for multilingual
from oddb.org/src/remote/galenic_group.rb:#require 'oddb/util/multilingual' oddb.org/src/remote/galenic_form.rb:#require 'oddb/util/multilingual' to oddb.org/src/remote/galenic_group.rb:require 'src/remote/multilingual' oddb.org/src/remote/galenic_form.rb:require 'src/remote/multilingual'
Refer
Result
masa@masa ~/ywesee/de.oddb.org/var/downloads $ ls -al insgesamt 1448 drwxr-xr-x 2 masa masa 72 12. Nov 09:21 . drwxr-xr-x 3 masa masa 8 12. Nov 08:53 .. -rw-r--r-- 1 masa masa 962048 12. Nov 09:12 chde.xls -rw-r--r-- 1 masa masa 255520 12. Nov 09:12 chde.xls.gz -rw-r--r-- 1 masa masa 255618 12. Nov 09:12 chde.xls.zip
Confirmation files on production server
de.oddb.org/var/downloads $ ls -al total 1297268 drwxrwxr-x 2 apache apache 4096 2010-11-12 02:37 . drwxr-xr-x 11 apache apache 80 2010-03-05 18:05 .. -rw-r--r-- 1 ywesee users 955904 2010-10-22 09:37 chde.xls -rw------- 1 apache apache 0 2010-10-01 04:00 chde.xls.666.0 -rw------- 1 apache apache 0 2010-11-01 04:00 chde.xls.666.1 -rw-r--r-- 1 ywesee users 253784 2010-10-22 09:37 chde.xls.gz -rw-r--r-- 1 ywesee users 253880 2010-10-22 09:37 chde.xls.zip
Notes
Run de.oddb.org/jobs/export_chde_xls manually on production server
Result
success
/var/www/de.oddb.org $ ls var/downloads/ -al total 1297276 drwxrwxr-x 2 apache apache 4096 2010-11-12 10:09 . drwxr-xr-x 11 apache apache 80 2010-03-05 18:05 .. -rw-r--r-- 1 ywesee users 966144 2010-11-12 10:08 chde.xls -rw-r--r-- 1 ywesee users 257057 2010-11-12 10:09 chde.xls.gz -rw-r--r-- 1 ywesee users 257154 2010-11-12 10:09 chde.xls.zip
Email from Davatz-san
Abstract
grant_download 'email@domain.com', 'oddb.csv', 17, Time.local(2011,2,11) - month, day
grant_download test
masa@masa ~/ywesee/oddb.org $ bin/admin ch.oddb> grant_download 'mhatakeyama@ywesee.com', 'oddb.csv', 11, Time.local(2011,11,12) -> http://oddb.masa.org/de/gcc/download/invoice/25503676/email/mhatakeyama@ywesee.com/filename/oddb.csv
Notes
grant_download test
masa@masa ~/ywesee/de.oddb.org $ bin/admin de.oddb> grant_download 'mhatakeyama@ywesee.com', 'chde.xls', 11, Time.local(2011,11,12) -> undefined method `grant_download' for nil:ODDB::Util::Server
oddbd log
E, [2010-11-12T13:32:42.619649 #8086] ERROR -- admin: NoMethodError E, [2010-11-12T13:32:42.619717 #8086] ERROR -- admin: undefined method `grant_download' for nil:ODDB::Util::Server E, [2010-11-12T13:32:42.620289 #8086] ERROR -- admin: ["/home/masa/ywesee/de.oddb.org/lib/oddb/util/server.rb:31:in `_admin'", "(eval):1:in `_admin'", "/home/masa/ywesee/de.oddb.org/lib/oddb/util/server.rb:28:in `initialize'", "/home/masa/ywesee/de.oddb.org/lib/oddb/util/server.rb:28:in `new'", "/home/masa/ywesee/de.oddb.org/lib/oddb/util/server.rb:28:in `_admin'", "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'", "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'", "/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'", "/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'", "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'", "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'", "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'", "/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'", "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'", "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'", "bin/oddbd:24"]
Notes
grep search
masa@masa ~/ywesee/oddb.org $ grep -r grant_download * src/util/oddbapp.rb: def grant_download(email, filename, price, expires=Time.now+2592000)
bin/admin
#!/usr/bin/env ruby # Admin -- oddb -- 09.07.2003 -- hwyss@ywesee.com $0 = "ch.oddb (Admin-Tool)" $: << File.expand_path('../src', File.dirname(__FILE__)) require 'rubygems' require 'drb' require 'util/oddbconfig' require 'readline' include Readline # There is no definition of RequestStub in de.oddb.org class RequestStub def ask(meth, *args) pr = "call: #{meth}(#{args.join(',')}) return? > " readline(pr, true) end def cookies instance_eval(ask(:cookies)) || {} end def params instance_eval(ask(:params)) || {} end def unparsed_uri ask(:unparsed_uri) end def user_agent ask(:user_agent) end end # This part is totally the same as de.oddb.org Kernel.trap('INT') { if($current.respond_to?(:exit)) $current.exit $current = nil else puts "<ctrl-c> is used to kill admin-threads." puts "Type <quit> or <exit> to exit." end } prompt = 'ch.oddb> ' req = RequestStub.new # This is only in oddb.org request = DRb.start_service('druby://localhost:0', req) oddb = DRbObject.new(nil, ODDB::SERVER_URI) last_error = nil priority = 0 while(line = readline(prompt, true)) result = '' result.extend(DRb::DRbUndumped) line.strip! $stdout.print "-> " case line.downcase when 'exit', 'quit' $stdout.puts 'Goodbye' break when 'bt', 'backtrace' if last_error.respond_to?(:backtrace) $stdout.puts last_error.backtrace else $stdout.puts 'No Error' end when /^last_error/ begin $stdout.puts eval(line) rescue StandardError, SyntaxError => last_error $stdout.puts last_error end # Until here, it is exactly the same as de.oddb.org, but # After here it is different from de.oddb.org when 'process' cmd = "self['test'].process(DRbObject.new(nil, '#{request.uri}'))" begin $current = oddb._admin(cmd, result, priority) $current.join $stdout.puts result rescue StandardError, SyntaxError => last_error $stdout.puts last_error end when /to_html(\[[\d,.]+\])?/ begin range = $1 || "[0,200]" cmd = "self['test'].to_html#{range}" $current = oddb._admin(cmd, result, priority) $current.join $stdout.puts result rescue StandardError, SyntaxError => last_error $stdout.puts last_error end # After here, the same as de.oddb.org when /sp\s+(-?\d+)/, /set_priority\s+(-?\d+)/, /^sp$/ priority = $~[1].to_i $stdout.puts "setting Priority to #{priority}" else begin bgflag = line.slice!(/\s*\&\s*$/) $current = oddb._admin(line, result, priority) unless(bgflag) $current.join end $stdout.puts result rescue StandardError, SyntaxError => last_error $stdout.puts last_error end end $current = nil $stdout.flush end
Notes
grep search
masa@masa ~/ywesee/de.oddb.org $ grep -r grant_download * masa@masa ~/ywesee/de.oddb.org $
bin/admin
#!/usr/bin/env ruby # Admin -- oddb -- 09.07.2003 -- hwyss@ywesee.com $0 = "de.oddb (Admin-Tool)" $:.push(File.expand_path('../lib', File.dirname(__FILE__))) $KCODE = 'u' require 'drb' require 'sbsm/drb' require 'oddb' require 'oddb/config' require 'encoding/character/utf-8' require 'readline' include Readline Kernel.trap('INT') { if($current.respond_to?(:exit)) $current.exit $current = nil else puts "<ctrl-c> is used to kill admin-threads." puts "Type <quit> or <exit> to exit." end } prompt = 'de.oddb> ' DRb.start_service('druby://localhost:0') oddb = DRbObject.new(nil, ODDB.config.server_url) last_error = nil priority = -1 while(line = readline(prompt, true)) result = '' result.extend(DRb::DRbUndumped) line.strip! $stdout.print "-> " case line.downcase when 'exit', 'quit' $stdout.puts 'Goodbye' break when 'bt', 'backtrace' if last_error.respond_to?(:backtrace) $stdout.puts last_error.backtrace else $stdout.puts 'No Error' end when /^last_error/ begin $stdout.puts eval(line) rescue StandardError, SyntaxError => last_error $stdout.puts last_error end when /sp\s+(-?\d+)/, /set_priority\s+(-?\d+)/ priority = $~[1].to_i $stdout.puts "setting Priority to #{priority}" else begin bgflag = line.slice!(/\s*\&\s*$/) $current = oddb._admin(line, result, priority) unless(bgflag) last_error = $current.join end $stdout.puts result rescue StandardError, SyntaxError => last_error $stdout.puts last_error end end $current = nil $stdout.flush end
Notes
Notes
$stdout.puts 'Goodbye' break
run.
If we type 'grant_download ...', the 'else' part
else begin bgflag = line.slice!(/\s*\&\s*$/) $current = oddb._admin(line, result, priority) unless(bgflag) $current.join end $stdout.puts result rescue StandardError, SyntaxError => last_error $stdout.puts last_error end end
run in both oddb.org and de.oddb.org.
Question
grep search _admin (oddb.org)
masa@masa ~/ywesee/oddb.org $ grep -r "def _admin" * src/util/oddbapp.rb: def _admin(src, result, priority=0)
grep search _admin (de.oddb.org)
masa@masa ~/ywesee/de.oddb.org $ grep -r "def _admin" * lib/oddb/util/server.rb: def _admin(src, result, priority=0)
Notes
-> undefined method `grant_download' for nil:ODDB::Util::Server
Experiment
de.oddb.org/lib/oddb/util/server
module ODDB module Util class Server < SBSM::DRbServer ENABLE_ADMIN = true SESSION = Html::Util::Session VALIDATOR = Html::Util::Validator def initialize(*args) super @rss_mutex = Mutex.new run_exporter if(ODDB.config.run_exporter) run_updater if(ODDB.config.run_updater) end def masa "Masa" end
oddb = DRbObject.new(nil, ODDB.config.server_url) p oddb.masa
Result
masa@masa ~/ywesee/de.oddb.org $ bin/admin "Masa" de.oddb>
Notes
Consideration
Experiment
masa@masa ~/ywesee/de.oddb.org $ bin/admin de.oddb> masa -> Masa
The error is caused by no definition of 'grant_download' in ODDB::Util::Server class
The solution is to define 'grant_download' method in ODDB::Util::Server class as well as oddb.org
ToDo
def grant_download(email, filename, price, expires=Time.now+2592000) ip = Persistence::Pointer.new(:invoice) inv = update ip.creator, :yus_name => email, :currency => 'EUR' itp = inv.pointer + :item update itp.creator, :text => filename, :price => price, :time => Time.now, :type => :download, :expiry_time => expires, :duration => (Time.now - expires) / 86400, :vat_rate => 7.6 inv.payment_received! inv.odba_store "http://#{SERVER_NAME}/de/gcc/download/invoice/#{inv.oid}/email/#{email}/filename/#{filename}" end
Qeustion
Notes
grep check 'module Persistence'
masa@masa ~/ywesee/oddb.org $ grep -r "module Persistence" * src/util/persistence.rb: module PersistenceMethods src/util/persistence.rb: module Persistence masa@masa ~/ywesee/de.oddb.org $ grep -r "module Persistence" * lib/oddb/persistence/odba.rb: module Persistence lib/oddb/persistence/og.rb: module Persistence
grep check 'class Pointer'
masa@masa ~/ywesee/oddb.org $ grep -r "class Pointer" * src/util/persistence.rb: class Pointer src/util/pointerarray.rb: class PointerArray < Array src/util/pointerarray.rb: class PointerHash < Hash src/view/pointersteps.rb: class PointerSteps < HtmlGrid::List src/view/pointervalue.rb: class PointerValue < HtmlGrid::Value src/view/pointervalue.rb: class PointerLink < View::PointerValue masa@masa ~/ywesee/de.oddb.org $ grep -r "class Pointer" * masa@masa ~/ywesee/de.oddb.org $
Notes