Random Unknown Error in IEE FBA Solution

Topics: Corporate Intranet Edition, Internet/Extranet Edition
Jul 4, 2008 at 11:15 AM
I'm using the IEE FBA solution and I'm finding it a bit wobbly.  It will let me edit some users details, but not others, and there seems to be no rhyme or reason why.

Creating and deleting appears to work fine, but I just get Unknown Error when I try to edit some users.

Has anyone had similar problems, or know what might cause this?

All users are editable using the .NET configurator in VS2005, so they aren't corrupt, as far as I can tell.
Developer
Sep 1, 2008 at 6:33 PM
Hi,

I've just been testing the delete function in the user manager based on change set 16828... I get an error. In my case its because the user is an NT account, not an FBA provider account. The current code set retrieves a list based on all users in sharepoint so what you see is a mix of users. From what I can see its the only error that can cause an edit to fail.

Anthony
Sep 30, 2008 at 1:45 PM
Edited Sep 30, 2008 at 1:50 PM
Hi,
I'm using the newest change set (17244 or so) and get am unknown error (An unexpected error has occurred) every time I try to edit a user in the Site Membership Review List. I don't quite see what the problem is in the log file (no entry). All I seem to be getting are these messages:

09/30/2008 14:38:19.86     w3wp.exe (0x0A00)                           0x099C    Windows SharePoint Services       General                           8l1n    High        An SPRequest object was not disposed before the end of this thread.  To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.  This object will now be disposed.  Allocation Id: {550C9919-DB88-4D3F-B469-37A3C3A2F172}  To determine where this object was allocated, create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings.  Then create a new DWORD named SPRequestStackTrace with the value 1 under this key.

Does the EditForm.aspx maybe use some special placeholder? (But in that case, something should appear in the log, I guess)

Regards,
Magganpice


UPDATE:

I am also getting:

09/30/2008 14:50:09.14     w3wp.exe (0x0A00)                           0x0AE4    CMS                               Publishing                        8x0a    High        AppDomainUnloadListener.RegisterSelf() entered lock(this=34622967)
Developer
Sep 30, 2008 at 2:02 PM
Hi Magganpice,

The error you are seeing in the logs is caused by code not disposing of the site and or web object. In admin type pages like editing a user this type of error is not critical its just pointing out that the code is not being nice. If this piece of code were say looking up a user inside a background code say an onItemUpdated event handler then it could constitute a memory leak. The code in FBA should (if we had enough time) be combed to ensure that we create references to the site and web objects wrapped in "using" statements. (You'll spot them in some of out code).

What you might like to do (it would help us!) is to enable the SPRequestStackTrace as described above, if you are confident. Ideally you'll be running this on test server, though you can disable the trace later by changing the value to 0. This will tell you what code is executing and not tidying up nicely. (It'll end up in the ULS).

For the EditForm.aspx error, take a look at the SharePoint 2007 Features project on codeplex. http://www.codeplex.com/features. This is a great set of tools, one of which is the Debug Feature. Grab that and install in on the site giving the error, when you activate the feature it will turn on the debugging settings on the site in the web.config which will save you tinkering in the config file, AND, when you deactivate it, it'll turn off the settings again. This is probably far more help that "An unexpected error occurred".

Anthony
Sep 30, 2008 at 2:16 PM
Hi Anthony,

Thanks for the info.

1. I switched on SPRequestStackTrace, but I don't know what you mean by ULS and don't see any change.

2. As updated in the post above, I'm quite sure this is the real error I'm getting when trying to access EditForm.aspx:

09/30/2008 15:14:26.52     w3wp.exe (0x0A00)                           0x099C    CMS                               Publishing                        8x0a    High        AppDomainUnloadListener.RegisterSelf() entered lock(this=34622967)


I will try that feature you mentioned.

Magganpice
Developer
Sep 30, 2008 at 2:27 PM
the ULS is Unified Logging System, the logs in central admin ;)

I don't recognise the error above,it's a MOSS installation right?

Activate the debugging feature and see what you get for the edituser.aspx

Anthony
Sep 30, 2008 at 2:30 PM
I switched on CallStack manually in the web.config and get this:

Corrupted control template. Please check RenderingTemplate of "SaveButton" in the control template ascx file.


Sep 30, 2008 at 2:37 PM
in CONTROLTEMPLATES I have a File called FBASaveButtonTemplate, containing two rendering templates, one of which has the ID SaveButton:

<SharePoint:RenderingTemplate id="SaveButton" runat="server">
    <Template>
        <CKS:MySettingsSave runat="server"/>
        <asp:Button Visible="false" UseSubmitBehavior="false" ID="diidIOSaveItem" CommandName="SaveItem" Text="<%$Resources:wss,tb_save%>" class="ms-ButtonHeightWidth" accesskey="<%$Resources:wss,tb_save_AK%>" target="_self" runat="server"/>
    </Template>
</SharePoint:RenderingTemplate>


I don't see corruption here - but corruption likes to hide.
Developer
Sep 30, 2008 at 2:42 PM
aha!

It's not the template but the code running on the server behind that control.

You've stumbled on the one bug thats holding back our release. The FBASaveButton code causes this I think. If you have the project to build you could build it without that code ( I think it overrides the existing save button function to synchronise changes to the SQL provider database when you make a change to a user in SharePoint. I could be wrong, but you probably don't need it).

You're going to say you are only running from a WSP from Mike Sharp?

Anthony
Developer
Sep 30, 2008 at 2:50 PM
Magganpice,

Check this out

http://www.codeplex.com/CKS/Thread/View.aspx?ThreadId=31187


Anthony
Sep 30, 2008 at 2:52 PM
Edited Sep 30, 2008 at 3:03 PM
No, I managed to build the WSP myself - but as you see (I guess), I'm quite new to all this.
Sep 30, 2008 at 2:57 PM
I can verify that this code breaks the blogs on my site as well, yes.

I get the same error on blog post pages (/Lists/Posts/Post.aspx?ID=2) as well.

I will try removing that part of the .ascx file (as mentioned in the thread you mentioned above)
Sep 30, 2008 at 3:01 PM
Thanks, Anthony,

it now works - in blogs and also the Membership Review List. If I run into a problem connected to this change I will try to post back more information here.

Magganpice
Developer
Sep 30, 2008 at 3:11 PM
Hi Magganpice,

Good stuff!  Having fired up the code I think Zac / Mike are looking at this. I *think* you might be able to deactivate the FBASaveAction feature and instead of messing with code, but the problem may still be there.

So what did you just change to get it working?

Anthony
Sep 30, 2008 at 3:19 PM
Edited Sep 30, 2008 at 3:29 PM
OK, it helps me explain a bug I have with the new wsp I built... I am not able to create new element in any list of any of my sites (using FBA or not) anymore, and I have an error talking  about "RenderingTemplate of "SaveButton" in the control template ascx file" too...  :o(
I will try to understand what to do in this thread... I'll ask if I'm not sure.
Remove that part of code is safe ? I mean, it has no utility ?  :o/
Sep 30, 2008 at 3:23 PM
Edited Sep 30, 2008 at 3:25 PM
I did nothing except going to: .../12/TEMPLATES/CONTROLTEMPLATES on my server. In the file FBASaveButtonTemplate I just removed the first rendering template as described by susanr in the thread you pointed to.

That's all.

(of course I should have changed it in my visual studio project and made a new WSP, but I just wanted to get the error away quickly)
Developer
Sep 30, 2008 at 4:08 PM
Magganpice, take a look at this site

http://www.chamberoffers.co.uk/default.aspx


It's the one I've used the code, note on the signup thats what the my additional code adds as fields. It auto approves and auto signs in etc. Maybe thats the same fit as yours. In which case, apart from your server being MOSS mines WSS.

Anthony