I am writing a double-opt-in registration routine. An incoming reply email is supposed to trigger an update to the database. I am getting this error: ''log'': SQLite3::SQLException: attempt to write a readonly database: UPDATE "members" SET "double_opt_in" = ''OK'', "updated_at" = ''2009-12-13 19:54:56'' WHERE "id" = 24 It seems very likely that the relevant process doesn''t have permissions to write to the database. That''s not too surprising since the database is owned by a particular user. However, all of my other Rails methods have no problem writing to the database. So, I''m a bit perplexed. More importantly, before I go off changing permissions on the database, I''m wondering if anyone has any insight on what''s going on here, why I would suddenly be seeing this issue and what the appropriate fix should be. Thanks for any input. ... doug -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>an incoming reply emailhow do you "handle" the incoming reply emails? Via cron-job?>However, all of my other >Rails methods have no problem writing to the databasewell they all run within the same mongrel-process (I guess)... On 13 Dez., 21:22, doug <ddjol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am writing a double-opt-in registration routine. An incoming reply > email is supposed to trigger an update to the database. I am getting > this error: > > ''log'': SQLite3::SQLException: attempt to write a readonly database: > UPDATE > "members" SET "double_opt_in" = ''OK'', "updated_at" = ''2009-12-13 > 19:54:56'' > WHERE "id" = 24 > > It seems very likely that the relevant process doesn''t have > permissions to write to the database. That''s not too surprising since > the database is owned by a particular user. However, all of my other > Rails methods have no problem writing to the database. So, I''m a bit > perplexed. More importantly, before I go off changing permissions on > the database, I''m wondering if anyone has any insight on what''s going > on here, why I would suddenly be seeing this issue and what the > appropriate fix should be. > > Thanks for any input. > > ... doug-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> how do you "handle" the incoming reply emails? Via cron-job?Incoming emails are processed immediately by a model method. That is, when the incoming email arrives the model method converts it to a TMail::Mail object which is assigned to a variable. Relevant data is extracted from that variable and then an attempt is made to write that data to the database. It is that write to the database that is being blocked.> well they all run within the same mongrel-process (I guess)...I don''t know whether it''s relevant; but, I''m running passenger. Thanks for the input. ... doug -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Dec 14, 12:21 pm, doug <ddjol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > how do you "handle" the incoming reply emails? Via cron-job? > > Incoming emails are processed immediately by a model method. That is, > when the incoming email arrives the model method converts it to a > TMail::Mail object which is assigned to a variable. Relevant data is > extracted from that variable and then an attempt is made to write > that data to the database. It is that write to the database that is > being blocked. >I''d guess that whatever''s handing the mail off to the model method isn''t running as the same user as the webserver; you may want to look into that. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> I''d guess that whatever''s handing the mail off to the model method > isn''t running as the same user as the webserver; you may want to look > into that.I was able to fix the problem by making the database writeable by the user that the smtp server was running as. It works just fine. I just get nervous when I have to expand the write permissions on the database. Basically, I''m thinking that I''m probably missing something. In this case, maybe not. Thanks for the input. ... doug -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I wanted to correct an error that I made in a prior post just in case anyone is or will be following this. My fix was to make the database writable by the user, "nobody" rather than the user the smtp server was running as. Sorry for the mis-spoke. ... doug -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.