[Radiant] mailer extension and 0.8

27 views
Skip to first unread message

john muhl

unread,
Jul 8, 2009, 11:05:28 AM7/8/09
to Rad...@radiantcms.org
has anyone successfully used mailer on 0.8? whenever i try to send
mail i get a 500 error page and the following:

SQL (1.2ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

SQL (1.9ms) SELECT DISTINCT class_name FROM pages WHERE class_name
<> '' AND class_name IS NOT NULL
/!\ FAILSAFE /!\ Wed Jul 08 09:01:58 -0600 2009
Status: 500 Internal Server Error
wrong number of arguments (1 for 2)
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:94:in
`restore_response'
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:94:in
`invalidate'
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:93:in
`map'
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:93:in
`invalidate'
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/context.rb:137:in
`invalidate'
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/context.rb:69:in
`call!'
/private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/context.rb:50:in
`call'
/opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in `call'
/opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in
`call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in
`call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in
`call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in
`call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in
`call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in
`call'
/opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call'
/opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
`synchronize'
/opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in
`call'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:44:in
`dispatch_cgi'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:102:in
`dispatch_cgi'
/private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:28:in
`dispatch'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/rack/adapter/rails.rb:81:in
`call'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/rack/adapter/rails.rb:69:in
`call'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/connection.rb:76:in
`pre_process'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/connection.rb:74:in
`catch'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/connection.rb:74:in
`pre_process'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/connection.rb:57:in
`process'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/connection.rb:42:in
`receive_data'
/opt/ree/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in
`run_machine'
/opt/ree/lib/ruby/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in
`run'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/backends/base.rb:57:in
`start'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/server.rb:156:in `start'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/controllers/controller.rb:80:in
`start'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/runner.rb:174:in `send'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/runner.rb:174:in
`run_command'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/runner.rb:140:in `run!'
/opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/bin/thin:6
/opt/ree/bin/thin:19:in `load'
/opt/ree/bin/thin:19
_______________________________________________
Radiant mailing list
Post: Rad...@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant

Cristi Duma

unread,
Jul 8, 2009, 12:02:56 PM7/8/09
to rad...@radiantcms.org
Hi John,

I'm playing with it right now, tried some fixes, features and stuff

It works for me on a site I'm currently developing

Check it out: http://github.com/Aissac/radiant-mailer-extension/tree/master

john muhl

unread,
Jul 8, 2009, 12:34:10 PM7/8/09
to rad...@radiantcms.org
thanks but it gives the same error.

Istvan Hoka

unread,
Jul 8, 2009, 12:49:56 PM7/8/09
to rad...@radiantcms.org
John, it looks like you are getting this on your production machine where
you are using Thin. Could you test with Passenger or Mongrel, perhaps
locally and see if you get the same error?
Also, could you provide some more context? For instance, are you trying to
attach a file or is it a simple form you are mailing?

Cheers!
--
Istvan Hoka

john muhl

unread,
Jul 8, 2009, 1:43:39 PM7/8/09
to rad...@radiantcms.org
this is running locally in the development environment. i've tested
with webrick, mongrel, thin and passenger and they all have the same
error message until you get to server specific part. the test site is
the styled blog with only the mailer extension added. all the page
parts and environment.rb are here: http://gist.github.com/142995 - i
also have mailer.post_to_page? = true set.

just to make sure it wasn't inherent in the system i setup a styled
blog with 0.7.1 installed mailer, used the same parts and smtp
settings and was able to send mail on all 4 servers.

thanks for help.

john muhl

unread,
Jul 8, 2009, 1:47:40 PM7/8/09
to rad...@radiantcms.org
oh, and those results are the same with radiant/mailer or aissac/mailer

Istvan Hoka

unread,
Jul 8, 2009, 2:01:37 PM7/8/09
to rad...@radiantcms.org
Could you try moving the contents of your config.after_initialize block to
development.rb or production.rb?
--
Istvan Hoka

john muhl

unread,
Jul 8, 2009, 2:58:53 PM7/8/09
to rad...@radiantcms.org
same error with the smtp settings in development.rb

Cristi Duma

unread,
Jul 8, 2009, 3:10:40 PM7/8/09
to rad...@radiantcms.org
I created a radiant project with the code from the gist you supplied,
and after putting the config.after_initialize block in development.rb
worked flawlessly. So is there the possibility that the problem is not
in mailer_extension?

john muhl

unread,
Jul 8, 2009, 3:51:36 PM7/8/09
to rad...@radiantcms.org
i went down through the code and think i may have found the issue
which appears to be at the radiant level. thanks again for all the
help.

Victor Elsendoorn

unread,
Jul 8, 2009, 3:56:43 PM7/8/09
to rad...@radiantcms.org
Only mentioning you fixed it, won't do any help for the Radiant
community. Please inform us about the solution or bugs you have found.

Thanks in advance.

john muhl

unread,
Jul 8, 2009, 4:20:44 PM7/8/09
to rad...@radiantcms.org
yes, of course. i'm just not convinced it's the proper fix, it just
happened to be the most expedient one. here is the diff for the
curious:

diff --git a/lib/radiant/cache.rb b/lib/radiant/cache.rb
index a825555..2e16de9 100644
--- a/lib/radiant/cache.rb
+++ b/lib/radiant/cache.rb
@@ -48,7 +48,7 @@ module Radiant
end

private
- def restore_response(hash, body)
+ def restore_response(hash, body=nil)
# Cribbed from the Rack::Cache source
status = hash.delete('X-Status').to_i
response = Rack::Cache::Response.new(status, hash, body)

>>>>>>> parts and environment.rb are here: http://gist.github.com/142995 - i

>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:94:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `restore_response'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:94:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `invalidate'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:93:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `map'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/metastore.rb:93:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `invalidate'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/context.rb:137:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `invalidate'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/context.rb:69:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call!'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>

>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rack-cache/lib/rack/cache/context.rb:50:in


>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>

>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>

>>>>>> /private/tmp/mailer/vendor/radiant/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in


>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `synchronize'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `call'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>

>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/backends/base.rb:57:in


>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `start'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/server.rb:156:in
>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `start'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>

>>>>>> /opt/ree/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/thin/controllers/controller.rb:80:in

john muhl

unread,
Jul 8, 2009, 5:31:53 PM7/8/09
to rad...@radiantcms.org
the issue seems to have resolved itself with radiant edge.

john muhl

unread,
Jul 13, 2009, 5:24:23 PM7/13/09
to rad...@radiantcms.org
turns out the culprit is "mailer.post_to_page? = true"

Cristi Duma

unread,
Jul 14, 2009, 2:23:07 AM7/14/09
to rad...@radiantcms.org
glad you figured it out. this means I can anounce the "new" version of
mailer

this version
<http://github.com/Aissac/radiant-mailer-extension/tree/master> of
Mailer Extension works on Radiant 0.8 and I added the mail attachments
from Jomz's branch. Also there are some cucumber features and the specs
have been fixed. Hasn't been tested on a production site yet, but
locally it works pretty good.

Pull requests have been sent.

Cheers, Cristi

On 7/14/09 12:24 AM, john muhl wrote:
> turns out the culprit is "mailer.post_to_page? = true"
>

_______________________________________________

john muhl

unread,
Jul 14, 2009, 11:37:19 AM7/14/09
to rad...@radiantcms.org
do you mean works with 0.8.0 as in being able to use
"mailer.post_to_page? = true" without having to hack on it? as far as
i can tell it still causes 500s in your "new" version.
Reply all
Reply to author
Forward
0 new messages