John Whitley wrote:> John Osborne wrote:
>
>> One thing you can try is changing the logging level to debug
>> (http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging)
>> although
>> this didn''t help me. I''m getting a 500 error also
with no debug
>> messages
>> when I moved a working instiki from mac to linux. I''m pulling
my hair
>> out with this one - I get a debug file in log, but no info!
>>
>
> Hmm... did you do a direct copy from a PowerPC Mac to an x86 Linux
> box? If so, then I''d suspect that you might be having trouble
with
> the on-disk format of the sqlite database, likely due to endianness
> issues.
I should have mentioned I am using postgres and I do have it working ok
on my Mac. The 500 error is a total mystery to me, the only other odd
thing about the linux installation versus my Mac installation is a
migration error. I''m more or less following the instructions from here:
http://dppruby.com/dppsrubyplayground/show/Migrating+Instiki+to+PostgreSQL
When I use rake to build the schema for the database it goes well, until
it gets to the dump out section. Then I get the mess below:
[jdo954 at lovie instiki-0.11.0]$ rake --trace migrate(in
/usr/local/share/instiki-0.11.0)
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
** Invoke db_schema_dump (first_time)
** Invoke environment
** Execute db_schema_dump
rake aborted!
Buffer::EOF: cannot read beyond the end of buffer: SELECT
a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = ''pages''::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:88:in
`log''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:133:in
`query''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:438:in
`column_definitions''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:206:in
`columns''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/schema_dumper.rb:52:in
`table''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/schema_dumper.rb:47:in
`tables''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/schema_dumper.rb:45:in
`tables''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/schema_dumper.rb:14:in
`dump''
/usr/local/share/instiki-0.11.0/vendor/rails/activerecord/lib/active_record/schema_dumper.rb:8:in
`dump''
/usr/local/share/instiki-0.11.0/vendor/rails/railties/lib/tasks/databases.rake:20
/usr/local/share/instiki-0.11.0/vendor/rails/railties/lib/tasks/databases.rake:19
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke''
/usr/lib64/ruby/1.8/thread.rb:135:in `synchronize''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke''
/usr/local/share/instiki-0.11.0/vendor/rails/railties/lib/tasks/databases.rake:4
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke''
/usr/lib64/ruby/1.8/thread.rb:135:in `synchronize''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run''
/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
/usr/bin/rake:18
The actual SQL is fine, I tested it. I''m not sure where the buffer
issue
is coming from, the actual code in abstract_adapter line 88 is:
protected
def log(sql, name)
if block_given?
if @logger and @logger.level <= Logger::INFO
result = nil
seconds = Benchmark.realtime { result = yield }
@runtime += seconds
log_info(sql, name, seconds)
result
else
yield
end
else
log_info(sql, name, 0)
nil
end
rescue Exception => e
# Log message and raise exception.
message = "#{e.class.name}: #{e.message}: #{sql}"
log_info(message, name, 0)
raise ActiveRecord::StatementInvalid, message
end
I''m not familar enough with ruby (yet) to follow completely, but the
exception is raised in the Benchmark.realtime function. Any idea what
could be causing this?
I''ve tried ignoring this, but I''m stuck with the 500 error and
NO log
messages so I don''t how to begin debugging the 500 problem other than
investigating this. I''m guessing there are a zillion places where a 500
error gets thrown in Instiki, but hopefully not too many that aren''t
logged!
-John