You are viewing a plain text version of this content. The canonical link for it is here.
Posted to olio-dev@incubator.apache.org by "Mandy Waite (JIRA)" <ji...@apache.org> on 2009/03/03 16:40:56 UTC

[jira] Created: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
------------------------------------------------------------------------------------------------------------------------------

                 Key: OLIO-62
                 URL: https://issues.apache.org/jira/browse/OLIO-62
             Project: Olio
          Issue Type: Bug
          Components: rails-driver
         Environment: Any
            Reporter: Mandy Waite


When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.

The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by "William Sobel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OLIO-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

William Sobel reassigned OLIO-62:
---------------------------------

    Assignee: William Sobel

> Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-62
>                 URL: https://issues.apache.org/jira/browse/OLIO-62
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-driver
>         Environment: Any
>            Reporter: Mandy Waite
>            Assignee: William Sobel
>
> When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.
> The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by William Sobel <ws...@eecs.berkeley.edu>.
On Mar 14, 2009, at 6:12 PM, Amanda Waite wrote:

> development.log:DEPRECATION WARNING: country_select will be removed  
> from 2.2.0.  http://www.rubyonrails.org/deprecation/list-of- 
> countries has more information.  See http://www.rubyonrails.org/deprecation 
>  for details. (called from country_select at /var/ruby/1.8/gem_home/ 
> gems/actionpack-2.1.2/lib/action_view/helpers/form_options_helper.rb: 
> 138)
>
> Which isn't a problem of course until you use 2.2.2 when as you say,  
> you need to add it back manually.*


I just added the plugin for 2.2.2. It should work fine now. I'm now  
fixing up the add attendee. You have to add the Accept header to get  
the js response. I did  this, but the attendance check is not working  
correctly. Once that is fixed, I think we're good for the release.

Cheers,
- Will Sobel


Re: [jira] Commented: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by Amanda Waite <Am...@Sun.COM>.
I wrote this before your last update to the bug. I thought I may as well 
still send it.

William Sobel wrote:
>
> On Mar 14, 2009, at 3:21 PM, Amanda Waite wrote:
>
>> I'm still using 2.1.2, mainly because of all the deprecation messages 
>> that I kept getting. The problem that this ticket related to was that 
>> if something does go wrong in doAddEvent and doAddPerson, and a user 
>> or an event are not added then the driver won't catch that and the op 
>> will still succeed.
>
> I'm using 2.2.2 and have not had any deprecation warnings. Please be 
> specific about the warnings. It looks like there are checks for 
> failure in there already, except now we keep getting the warnings that 
> we aren't following the redirects. I think it would be easier to 
> follow the redirect and check for the successfully added message. This 
> will be easier than all the additional logic in there.

The redirect warnings (actually infos) are an issue with the Apache 
HttpClient, it's not allowed to follow redirects from POST requests so 
we handle them manually, unfortunately we also get the annoying info 
messages. I have checks for failure but as described in the original 
bug,  a failure to add a user or event is just indicated by a flash 
message on the current page. To the driver this can be detected by the 
fact that the return code was SC_OK and not SC_MOVED_TEMPORARILY. This 
means in the switch statement for SC_OK you can scrape the response for 
the flash message. This is what I do in the driver currently. This also 
means we only need to check those responses that have probably failed 
for errors and not check every response for success.

As for the deprecation messages:

development.log:DEPRECATION WARNING: country_select will be removed from 
2.2.0.  http://www.rubyonrails.org/deprecation/list-of-countries has 
more information.  See http://www.rubyonrails.org/deprecation for 
details. (called from country_select at 
/var/ruby/1.8/gem_home/gems/actionpack-2.1.2/lib/action_view/helpers/form_options_helper.rb:138)

Which isn't a problem of course until you use 2.2.2 when as you say, you 
need to add it back manually.*

*
>
> What do you think?
Are you changing the base Rails version to 2.2.2 now? I'm fine with that 
and I'll move to the latest bits after Community One in NY this week. 
After that I can probably start systematically working through all of 
the possible Use Cases and failures.

Amanda

>
> Cheers,
> - Will Sobel
>


Re: [jira] Commented: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by William Sobel <ws...@eecs.berkeley.edu>.
On Mar 14, 2009, at 3:21 PM, Amanda Waite wrote:

> I'm still using 2.1.2, mainly because of all the deprecation  
> messages that I kept getting. The problem that this ticket related  
> to was that if something does go wrong in doAddEvent and  
> doAddPerson, and a user or an event are not added then the driver  
> won't catch that and the op will still succeed.

I'm using 2.2.2 and have not had any deprecation warnings. Please be  
specific about the warnings. It looks like there are checks for  
failure in there already, except now we keep getting the warnings that  
we aren't following the redirects. I think it would be easier to  
follow the redirect and check for the successfully added message. This  
will be easier than all the additional logic in there.

What do you think?

Cheers,
- Will Sobel


Re: [jira] Commented: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by Amanda Waite <Am...@Sun.COM>.
I'm still using 2.1.2, mainly because of all the deprecation messages 
that I kept getting. The problem that this ticket related to was that if 
something does go wrong in doAddEvent and doAddPerson, and a user or an 
event are not added then the driver won't catch that and the op will 
still succeed.

Amanda

William Sobel (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/OLIO-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682100#action_12682100 ] 
>
> William Sobel commented on OLIO-62:
> -----------------------------------
>
> There was a missing plugin, in the transition from 2.1.2 to 2.2.2 country_select was removed from the core. I added the plugin and events and users are being added again.
>
>   
>> Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
>> ------------------------------------------------------------------------------------------------------------------------------
>>
>>                 Key: OLIO-62
>>                 URL: https://issues.apache.org/jira/browse/OLIO-62
>>             Project: Olio
>>          Issue Type: Bug
>>          Components: rails-driver
>>         Environment: Any
>>            Reporter: Mandy Waite
>>            Assignee: William Sobel
>>
>> When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.
>> The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.
>>     
>
>   


[jira] Commented: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by "William Sobel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OLIO-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682100#action_12682100 ] 

William Sobel commented on OLIO-62:
-----------------------------------

There was a missing plugin, in the transition from 2.1.2 to 2.2.2 country_select was removed from the core. I added the plugin and events and users are being added again.

> Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-62
>                 URL: https://issues.apache.org/jira/browse/OLIO-62
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-driver
>         Environment: Any
>            Reporter: Mandy Waite
>            Assignee: William Sobel
>
> When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.
> The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by "William Sobel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OLIO-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682110#action_12682110 ] 

William Sobel commented on OLIO-62:
-----------------------------------

This is a bug in the 2.0.1 version of the HTTP client. The event and person are added and then the application redirects to the show page. The redirect is interpreted as a POST again by the http client and it tries to post to a show url. This is a error and does not follow the HTTP specification. 

The manual redirect is required, but it can be solved with a manual redirect. There will be a info message coming out about not following redirects. This is also stupid.

> Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-62
>                 URL: https://issues.apache.org/jira/browse/OLIO-62
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-driver
>         Environment: Any
>            Reporter: Mandy Waite
>            Assignee: William Sobel
>
> When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.
> The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by "William Sobel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OLIO-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

William Sobel resolved OLIO-62.
-------------------------------

    Resolution: Fixed

Fixed handling of redirect after post. Now manually follows redirect and looks for success text.

> Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-62
>                 URL: https://issues.apache.org/jira/browse/OLIO-62
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-driver
>         Environment: Any
>            Reporter: Mandy Waite
>            Assignee: William Sobel
>
> When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.
> The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OLIO-62) Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured

Posted by "William Sobel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OLIO-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

William Sobel closed OLIO-62.
-----------------------------


> Rails Driver does not check the responseBody of doAddPerson or doAddEvent POSTs for flash messages indicating an error occured
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-62
>                 URL: https://issues.apache.org/jira/browse/OLIO-62
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-driver
>         Environment: Any
>            Reporter: Mandy Waite
>            Assignee: William Sobel
>
> When running into a problem with MySQL and duplicate keys which for most of a run resulted in no users or events being inserted into the database. It was seen that this kind of failure was not picked up by the Rails Driver and therefore doAddPerson and doAddEvents oeprations were flagged as being successful regardless of  whether inserts were made or not.
> The symptom to look for is that if the add fails, the status returned by the HTTP POST is SC_OK and not SC_MOVED_TEMPORARILY (i.e.: a redirect) and a flash message is added to the page, either: "Could not create event" for failing to add an event, or "Failed to create user" for  failing to add a user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.