Don't use this search engine!

Friday, July 17, 2009

SSRS 2008 and Forms Authentication

We are currently standardizing everything on SQL 2008. While this does have some known issues with it, i was the changes wtih SSRS that caused me several days of lost time. For the most part SSRS has stayed exactly the same as it was. It still uses the report service webservices released with 2005. However, it no longer requires that IIS be installed on the SQL Server machine (this is a good thing... mostly). I had an application written a few years ago with Custom Forms authentication that I needed to move over. Everything on the web led me believe that it would function the same as before so I wasn't too worried when I moved it over.

First issue. Custom authentication wasn't something one took lightly to begin with. It requires changes to literally every config file that exists in the ReportManager and ReportServer subdirectories under Reporting Services (this is usually found under drive\Program Files\Microsoft SQL Server\#Installed Version#\Reporting Services\). The first issue was that Report Manager\RSWebApplication.config was now deprecated and all of its previous entries had been moved to Report Server\RSReportServer.config. This in itself wasn't that big an issue in that most of the sections were still the same and it only took a minute to get my bearings.

I completed all of the configuration changes as I did for 2005 and joyfully fired it up to get an ugly .NET error that read "Error: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive." Odd I thought, this worked fine before. So I did what any good troubleshooter would do and examined the web.config(s). Ah ha, there it was . I quickly changed the value to InProc and restarted the service.

Same error.

Google can be such a fickle mistress, but she was my first choice. Apparently a lot of people have had this issue. Several links later I had my answer, I need to add enableSessionState to the section. Done. Restart.

Same error.

WTF. Again, this didn't happen with the previous version why is it suddenly a problem. My mistress enticed me again and led me to believe that I also had to add enableSessionState to the page directive on the actual .aspx file. Done. Fingers crossed. Restart.

Same error.

At this point my mistress fled cackling like a mad woman. I was lost, there was no way that this should be happening. I broke down and went directly to MSDN. It took a few hours and I was finally able to wade through that wonderfully organized content (can you feel the sarcasm) to finally discover nothing of value. I moved over to the Microsoft Blog sites before I finally discovered a mention of someone else having a similar issue. In this case he was missing the session declaration from his web.config (I think he removed it on purpose) in the HTTPModules section. This seemed like a stretch but I looked anyway.

What do you know. By default SSRS 2008 does not include the session declaration in it's webconfig. Since it doesn't use IIS, it either doesn't rely on the base .NET configurations or the statement is designed to completely disregard anything at the root level. I suspect that maybe both are true. Regardless, I added the declaration. Restarted. And.

SUCCESS!

For all of the hours that I put in, I felt that if you should come across the same issue, then at least you would be able to solve it. Sorry you had to read all of that to just get to a 2 second fix. But let's face it, if you had the same problem, you needed a break anyway. Good Luck!

No comments:

Post a Comment