Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Olbert 87 posts 117 karma points
    Oct 30, 2009 @ 01:00
    Mark Olbert
    0

    Mysterious Inactivity on Production Server

    I have an Umbraco site that runs just fine on my development server under ASPNET 3.5.

    When I uploaded it to my hosting service, it doesn't quite work right. Pages render fine, I can use the backoffice to create members, etc., but any page on the front end that appears to involve accessing the sql server database fails. With no exception or other error condition. It just appears like you click the Next button and nothing happens (although the postback is clearly occurring, as I can insert bogus data and trip the validation controls).

    I'm not sure what version of ASPNET the hosting service is running. It might be 2.0. If so, would that cause a problem with database access?

    One other clue: my enrollment procedure isn't working quite right. I use the UmbracoMembershipProvider, but also store extended user information in a separate sqlserver table. The code for creating a new user is as follows:

                        MembershipCreateStatus status = MembershipCreateStatus.Success;
                        MembershipUser memUser = Membership.CreateUser(email, newPW, email, question, answer, false, null, out status);

                        if( status != MembershipCreateStatus.Success )
                        {
                            CustomValidationError.AddError(String.Format("We're sorry, there was a problem processing your information. Please send us an email and include the following status code: {0}", status.ToString()), this.Page);

                            e.Cancel = true;

                            return;
                        }

                        // store extended info in separate table
                        extMemberInfo extInfo = null;

                        extInfo = new extMemberInfo();

                        extInfo.nodeID = NodeID(email);
                        extInfo.alt_phone = tbxAltPhone.Text.Trim();
                        extInfo.best_phone = tbxBestPhone.Text.Trim();
                        extInfo.city = tbxCity.Text.Trim();
                        extInfo.first_name = tbxFirstName.Text.Trim();
                        extInfo.last_name = tbxLastName.Text.Trim();
                        extInfo.state = tbxState.Text.Trim();
                        extInfo.street1 = tbxStreet1.Text.Trim();
                        extInfo.street2 = tbxStreet2.Text.Trim();
                        extInfo.zipcode = tbxZipcode.Text.Trim();

                        ExtDC.extMemberInfos.InsertOnSubmit(extInfo);

                        ExtDC.SubmitChanges();

    >>Something<< happens in the call to CreateUser() in the second line, but the method call doesn't end normally. I can tell that because, while the backoffice shows the member is created, all of the ancillary fields (e.g., question, answer) are blank. Yet the CreateUser() call doesn't return an error condition, and no exception occurs.

    FYI, the line for the UmbracoMembershipProvider in web.config is as follows:

            <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="true" enablePasswordReset="false" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="encrypted" umbracoApprovedPropertyTypeAlias="isVerified" umbracoLockPropertyTypeAlias="isLocked" umbracoFailedPasswordAttemptsPropertyTypeAlias="failedLogins" umbracoLastLoginPropertyTypeAlias="lastLogin" umbracoPasswordRetrievalQuestionPropertyTypeAlias="question" umbracoPasswordRetrievalAnswerPropertyTypeAlias="answer" defaultMemberTypeAlias="WebsiteUser" />

    So, as you can see, the requisite alias fields (the ones that end up being blank, despite the fact that the user gets created) are defined.

    Anyone have any thoughts on what might be causing the problem? Debugging a production server in a hosted environment will be a >>real<< bear...

    - Mark

  • Mark Olbert 87 posts 117 karma points
    Oct 30, 2009 @ 05:04
    Mark Olbert
    1

    Well, golly gee, I've learned something I didn't know about SqlServer!

    It turns out that when you create tables and sprocs on a hosted database server they're generally created in the schema of the account you log in with, not with the dbo schema, even if your user login owns the dbo role.

    And apparently, when LinqToSql looks for, say, an sproc called "dbo.spMyProc", and all it can find is "userName.spMyProc" it fails...silently.

    Which strikes me as a really bad bug in LinqToSql :).

    Anyway, changing the "ownership" of the tables and sprocs solved the "mysterious silent failure" problem.

    - Mark

    p.s. FYI, the Umbraco installer creates almost all, but not all, of its tables in the schema of the database user you tell it to use.

Please Sign in or register to post replies

Write your reply to:

Draft