Membership Request - Unknown Error

I installed the wsp and everything seems to be working fine except that I am having a problem with the Add Membership request webpart.

Upon clicking the “Create User” button I receive “unknown error”. Looking at the error log I see the following:

Failed to open the language resource keyfile FBAPackFeatures.

System.Exception: Error sending mail notification     at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequest.ApproveMembership(MembershipRequest request, SPWeb web)

System.Exception: Error sending mail notification     at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequest.ApproveMembership(MembershipRequest request, SPWeb web)     at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequestControl.<>c__DisplayClass2.<OnCreatedUser>b__0()

 

What is odd is that the forgot password webpart as well as the sending an email upon creation of an external user both work.

Any ideas would be appreciated.

Generally that means there was an error sending the email. One reason it might only work in some cases is if the smtp server is not configured for relaying - then things would work ok if you used an internal email address, but external email addresses would fail.

thank you for your reply,

I too had the thought about relaying, however when I started testing the solution to see if I could find root cause of my issue.  I targeted a gmail account.  I used the same external account for all three instances of emails being sent and only the Membership Request failed (the other 2 were sent just fine).

Are you using SSL? If so that could be an issue - but I would think it would affect the password recovery web part as well. Here's info on the SSL issue:

http://sharepoint2010fba.codeplex.com/discussions/260121

No SSL yet, but i saw that discussion and think it will probably come in handy soon. 

One odd thing I noticed is when I get the unknown error, it's not only the email which doesn't get created, but the requested user doesn't show up in the database (SQL membership provider).  I'm pretty sure it's configured correctly as it works through the other modules.  

It's a fairly basic setup SharePoint 2010 (don't remember the SP or CU level) the membership provider is setup in a fairly standard way; based off of your documentation with the exception that i'm using windows auth to get to SQL (app pool identity) 

single web app using claims. 

I'd probably check your smtp logs to see what is getting logged there.  If the email is not going through, you should see the error.  If there's nothing getting logged at all, then the emails's not even getting sent, in which case i'd look into issues accessing the xslt email templates. You should check to make sure you can view them by pointing to them in your browser.

Sounds good. 

I verified that I can browse to the xslt templates via the browser.  I'll see what I can do on the smtp logs.  Thank you for the insight. 

So i got a chance to play further with the issue and this is what I'm seeing. 

I started debugging the app and found where the exception is coming from. When the membershipRequest calls SendEmail [located in the Email class]

It fails on the following line in the try statement:

xslEmailTransform.Load(xsltTemplateFile, settings, resolver);

 

The exception caught is “The remote server returned an error: (407) Proxy Authentication Required

 

full SharePoint log of the event is:

 

System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.  

at System.Net.HttpWebRequest.GetResponse()  

at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)  

at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)  

at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)  

at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)  

at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)  

at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)  

at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)  

at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver)  

at Visigo.Sharepoint.FormsBasedAuthentication.Email.SendEmail(SPWeb web, String emailTo, String xsltTemplateFile, IDictionary xslValues)

 

 

proceeded by this:

 

System.Exception: Error sending mail notification  

at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequest.ApproveMembership(MembershipRequest request, SPWeb web)  

at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequestControl.<>c__DisplayClass2.<OnCreatedUser>b__0()

 

 

 

Thanks for stepping into this to find the failure. Can you check that you have the latest version of the FBA Pack?  There should be a line in the code that was added to take care of this issue:

resolver.Credentials = CredentialCache.DefaultCredentials;  

no problem,

i see the source saying 1.2.0 and i do see that line of code.

 

1 Like

I've raised an issue:

http://sharepoint2010fba.codeplex.com/workitem/729

I'll try and reproduce and fix for the next version.

Sounds Great Thank you!.

As a side note. Nice work.

We had a similar issue and this was our resolution:

It turned out to be because SP doesn’t authenticate but the email connector was set to require authentication instead of anonymous, just for future reference.

This was determined by someone working on the Exchange end for us.  We determined that it wasn't just FBA that was having the problem of sending to an email address outside the network the SP site was on, but even an email being sent from a Workflow.

So, maybe check to make sure it's more than just FBA that can't send.  If so, have your Exchange settings checked as well.