This project is archived and is in readonly mode.

#2727 ✓stale
Morus Walter

local error page does not show session

Reported by Morus Walter | May 27th, 2009 @ 02:17 PM | in 3.x

In rails 2.3.2 the local error page always shows '---' as the session.

I think the error is in
rails / actionpack / lib / action_controller / templates / rescues / _request_and_response.erb

where the session still is expected to contain a data instance variable:

<%= debug(request.session.instance_variable_get("@data")) %>

The same problem exists in the exception_notification plugin.

Comments and changes to this ticket

  • Morus Walter

    Morus Walter May 27th, 2009 @ 02:18 PM

    • Tag set to 2-3-stable, exception_notification, session
  • Laurent Farcy

    Laurent Farcy July 22nd, 2009 @ 03:27 PM

    I fixed a similar issue with the exception_notification plugin by replacing

    • session id: <%= @request.session.instance_variable_get(:@session_id).inspect %>
    • data: <%= PP.pp(@request.session.instance_variable_get(:@data),"").gsub(/\n/, "\n ").strip %>

    by

    • session id: <%= @request.session_options[:id].inspect %>
    • data: <%= PP.pp(@request.session.to_hash,"").gsub(/\n/, "\n ").strip %>

    in the exception_notification/views/exception_notifier/_session.rhtml file.

  • Gabe da Silveira

    Gabe da Silveira October 10th, 2009 @ 12:41 AM

    • Tag changed from 2-3-stable, exception_notification, session to 2-3-stable, 3.0, exception_notification, session

    I've created a patch for 2-3-stable and tested on my 2.3.4 app. I rebased to master as well. There are no tests because testing the output of this template seems too granular, but I'm open to suggestions on a good way to test it if necessary. My instinct is that it should just be fixed.

  • Brian Kaney
  • Tim Connor

    Tim Connor April 2nd, 2010 @ 08:41 AM

    • Tag changed from 2-3-stable, 3.0, exception_notification, session to 2-3-stable, 3.0, session

    This should be fixed in ExceptionNotifiable (http://github.com/rails/exception_notification), for 3.0 and 2.3 branches, actually via a couple other refactors. Please re-tag and add the appropriate details, if you find that not to be the case.

    Or add a ticket in the Rails plugin project: https://rails.lighthouseapp.com/projects/8995

  • Roland Moriz

    Roland Moriz April 11th, 2010 @ 05:30 AM

    I can confirm the original bug is still present in Rails 2.3.5 / actionpack

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • David Trasbo

    David Trasbo October 19th, 2010 @ 10:37 AM

    • State changed from “new” to “incomplete”
    • Importance changed from “” to “”

    I was unable to reproduce this with edge Rails:

    $ script/rails g controller fails index
          create  app/controllers/fails_controller.rb
           route  get "fails/index"
          invoke  erb
          create    app/views/fails
          create    app/views/fails/index.html.erb
          invoke  test_unit
          create    test/functional/fails_controller_test.rb
          invoke  helper
          create    app/helpers/fails_helper.rb
          invoke    test_unit
          create      test/unit/helpers/fails_helper_test.rb
    

    routes.rb:

    Ticket2727::Application.routes.draw do
      resources :fails
    end
    

    app/controllers/fails_controller.rb:

    class FailsController < ApplicationController
      def index
        session[:foo] = 'bar'
        raise 'fail!'
      end
    end
    

    The error page on http://localhost:3000/fails shows this session dump:

    foo: "bar"
    session_id: "814bfd9248f48b0c965552e06d63b81b"
    

    However, I was I able to reproduce this using the 2-3-stable branch:

    $ script/generate controller fails index
          exists  app/controllers/
          exists  app/helpers/
          create  app/views/fails
          exists  test/functional/
          create  test/unit/helpers/
          create  app/controllers/fails_controller.rb
          create  test/functional/fails_controller_test.rb
          create  app/helpers/fails_helper.rb
          create  test/unit/helpers/fails_helper_test.rb
          create  app/views/fails/index.html.erb
    

    routes.rb:

    ActionController::Routing::Routes.draw do |map|
      map.resources :fails
    end
    

    app/controllers/fails_controller.rb:

    class FailsController < ApplicationController
      def index
        session[:foo] = 'bar'
        raise 'fail!'
      end
    end
    

    The error page shows --- as session dump, as described.

    Please provide a patch (https://rails.lighthouseapp.com/projects/8994/sending-patches) with a fix and/or a failing test.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:47 PM

    • State changed from “incomplete” to “open”
    • Tag changed from 2-3-stable, 3.0, session to 2-3-stable, 30, session

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:47 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages