Application pool crashing regularly (8007006d) (Service Unavailable)
- by Phil
I have a basic web form site running. Nothing out of the ordinary. It is frequently crashing the application pool.
The error code I got from the logs is '8007006d'. Googling this does not come up with the usual bevy of results.... I do get a few people with a similar problem. Any the advise seems to be that the error is related to registry permissions.
Can anyone confirm / disconfirm this theory. That if I get error 8007006d it is definately a reg permissions problem?
Here is the code from my page. I'm not seeing anything that would cause a memory leak or make this happen. It is basically just one big insert command with many parameters?
Imports System.Web.Configuration
Imports System.Data.SqlClient
Imports System.Net.Mail
Imports System.IO
Imports System.Globalization
Partial Class _Default
Inherits System.Web.UI.Page
Public Sub WriteError(ByVal errorMessage As String)
Try
Dim path As String = "~/Error/" & DateTime.Today.ToString("dd-mm-yy") & ".txt"
If (Not File.Exists(System.Web.HttpContext.Current.Server.MapPath(path))) Then
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close()
End If
Using w As StreamWriter = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path))
w.WriteLine(Constants.vbCrLf & "Log Entry : ")
w.WriteLine("{0}", DateTime.Now.ToString(CultureInfo.InvariantCulture))
Dim err As String = "Error in: " & System.Web.HttpContext.Current.Request.Url.ToString() & ". Error Message:" & errorMessage
w.WriteLine(err)
w.WriteLine("__________________________")
w.Flush()
w.Close()
End Using
Catch ex As Exception
WriteError(ex.Message)
End Try
End Sub
Protected Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreLoad
otherlanguagespecify.Text = "Language: Speaking: Reading: Writing:"
'Show / hide 'other' panels
ProvincePanel.Visible = False
If Province.SelectedValue = "Other" Then
ProvincePanel.Visible = True
End If
languagespanel.Visible = False
If OtherLanguage.Checked Then
languagespanel.Visible = True
End If
End Sub
Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.Click
Dim areasexpertise As String = String.Empty
Dim areasli As ListItem
Dim english As String = String.Empty
Dim connstring As String = WebConfigurationManager.ConnectionStrings("Str").ToString()
Dim c As SqlConnection = New SqlConnection(connstring)
Dim s As String = ("INSERT INTO [MBA_EOI]") & _
("([subdate],[surname], [name], [dob], [nationality], [postaladdress],") & _
("[province],[city], [postcode], [worktelephone],") & _
("[hometelephone], [mobile], [email],[fax], [institution1],") & _
("[institution2], [institution3], [institution4], [institutiondate1], [institutiondate2],") & _
("[institutiondate3], [institutiondate4],[institutionquals1], [institutionquals2], [institutionquals3],") & _
("[institutionquals4],[profdates1], [profdates2],") & _
("[profdates3], [profdates4], [profdates5], [profdates6], [profdates7], ") & _
("[profloc1], [profloc2], [profloc3], [profloc4], [profloc5],") & _
("[profloc6], [profloc7], [profcomp1], [profcomp2], [profcomp3],") & _
("[profcomp4], [profcomp5], [profcomp6], [profcomp7], [profpos1],") & _
("[profpos2], [profpos3], [profpos4], [profpos5], [profpos6],") & _
("[profpos7], [profdesc1], [profdesc2], [profdesc3], [profdesc4],") & _
("[profdesc5],[profdesc6],[profdesc7], [company1], [company2],") & _
("[company3], [company4], [company5], [nature1], [nature2],") & _
("[nature3], [nature4], [nature5], [workdate1], [workdate2],") & _
("[workdate3], [workdate4], [workdate5], [contactname1], [contactname2],") & _
("[contactname3], [contactname4], [contactname5], [wtelephone1], [wtelephone2],") & _
("[wtelephone3],[wtelephone4], [wtelephone5], [philosophy], [publications],") & _
("[english], [otherlanguage], [areasofexpertise], [otherareasofexpertise],") & _
("[assessortrue], [coordinatortrue], [facilitatortrue], [moderatortrue], [productdevelopertrue],") & _
("[projectmanagertrue], [assessorexp], [coordinatorexp], [facilitatorexp], [moderatorexp],") & _
("[productdeveloperexp], [projectmanagerexp], [assessorlvl], [coordinatorlvl], [facilitatorlvl],") & _
("[moderatorlvl], [productdeveloperlvl], [projectmanagerlvl], [assessorpref], [coordinatorpref],") & _
("[FacilitatorPref], [ModeratorPref], [ProductDeveloperPref], [ProjectManagerPref], [designation], [professortrue],") & _
("[professorlvl], [professorexp], [professorpref], [lecturertrue], [lecturerpref], [lecturerlvl], [lecturerexp], [affiliations], [educationmore], ") & _
("[wemail1], [wemail2], [wemail3], [wemail4], [wemail5])") & _
("VALUES") & _
("(@subdate, @surname, @name, @dob, @nationality, @postaladdress,") & _
("@province,@city, @postcode, @worktelephone,") & _
("@hometelephone, @mobile, @email, @fax, @inst1,") & _
("@inst2, @inst3, @inst4, @instdate1, @instdate2,") & _
("@instdate3, @instdate4, @instquals1, @instquals2, @instquals3,") & _
("@instquals4, @profdates1, @profdates2,") & _
("@profdates3, @profdates4, @profdates5, @profdates6, @profdates7,") & _
("@profloc1, @profloc2, @profloc3, @profloc4, @profloc5,") & _
("@profloc6, @profloc7, @profcomp1, @profcomp2, @profcomp3,") & _
("@profcomp4, @profcomp5, @profcomp6, @profcomp7, @profpos1,") & _
("@profpos1, @profpos1, @profpos4, @profpos5, @profpos6,") & _
("@profpos7, @profdesc1, @profdesc2, @profdesc3, @profdesc4,") & _
("@profdesc5, @profdesc6, @profdesc7, @company1, @company2,") & _
("@company3, @company4, @company5,@nature1, @nature2,") & _
("@nature3, @nature4, @nature5, @workdate1, @workdate2,") & _
("@workdate3, @workdate4, @workdate5, @contactname1, @contactname2,") & _
("@contactname3, @contactname4, @contactname5, @wtelephone1, @wtelephone2,") & _
("@wtelephone3,@wtelephone4, @wtelephone5, @philosophy, @publications,") & _
("@english, @otherlanguage, @areasofexpertise, @otherareasofexpertise,") & _
("@assessor, @coordinator, @facilitator, @moderator, @productdeveloper,") & _
("@projectmanager, @assessorexp, @coordinatorexp, @facilitatorexp, @moderatorexp,") & _
("@productdeveloperexp, @projectmanagerexp, @assessorlvl, @coordinatorlvl, @facilitatorlvl,") & _
("@moderatorlvl, @productdeveloperlvl, @projectmanagerlvl, @assessorpref, @coordinatorpref,") & _
("@facilitatorpref, @moderatorpref, @productdeveloperpref, @projectmanagerpref, @designation, @professor, @professorlvl, @professorexp, @professorpref,") & _
("@lecturer, @lecturerpref, @lecturerlvl, @lecturerexp, @affiliations, @educationmore, ") & _
("@wemail1, @wemail2, @wemail3, @wemail4, @wemail5)")
'Setup birthday
Dim birthdaystring As String = MonthBirth.SelectedValue.ToString & "/" & DayBirth.SelectedValue.ToString & "/" & YearBirth.SelectedValue.ToString
Dim birthday As DateTime = Convert.ToDateTime(birthdaystring)
Try
Dim x As New SqlCommand(s, c)
x.Parameters.AddWithValue("@subdate", DateTime.Now())
x.Parameters.AddWithValue("@surname", Surname.Text)
x.Parameters.AddWithValue("@name", Name.Text)
x.Parameters.AddWithValue("@dob", birthday)
x.Parameters.AddWithValue("@nationality", Nationality.Text)
x.Parameters.AddWithValue("@postaladdress", Postaladdress.Text)
x.Parameters.AddWithValue("@designation", Designation.SelectedItem.ToString)
'to control whether or not 'other' province is selected
If Province.SelectedValue = "Other" Then
x.Parameters.AddWithValue("@province", Otherprovince.Text)
Else
x.Parameters.AddWithValue("@province", Province.SelectedValue.ToString)
End If
x.Parameters.AddWithValue("@city", City.Text)
x.Parameters.AddWithValue("@postcode", Postcode.Text)
x.Parameters.AddWithValue("@worktelephone", Worktelephone.Text)
x.Parameters.AddWithValue("@hometelephone", Hometelephone.Text)
x.Parameters.AddWithValue("@mobile", Mobile.Text)
x.Parameters.AddWithValue("@email", Email.Text)
x.Parameters.AddWithValue("@fax", Fax.Text)
'Add education params to x command
x.Parameters.AddWithValue("@inst1", Institution1.Text)
x.Parameters.AddWithValue("@inst2", Institution2.Text)
x.Parameters.AddWithValue("@inst3", Institution3.Text)
x.Parameters.AddWithValue("@inst4", Institution4.Text)
x.Parameters.AddWithValue("@instdate1", Institutiondates1.Text)
x.Parameters.AddWithValue("@instdate2", Institutiondates2.Text)
x.Parameters.AddWithValue("@instdate3", Institutiondates3.Text)
x.Parameters.AddWithValue("@instdate4", Institutiondates4.Text)
x.Parameters.AddWithValue("@instquals1", Institution1quals.Text)
x.Parameters.AddWithValue("@instquals2", Institution2quals.Text)
x.Parameters.AddWithValue("@instquals3", Institution3quals.Text)
x.Parameters.AddWithValue("@instquals4", Institution4quals.Text)
'Add checkbox params to x command
Dim eli As ListItem
For Each eli In EnglishSkills.Items
If eli.Selected Then
english += eli.Text + " | "
End If
Next
x.Parameters.AddWithValue("@english", english)
For Each areasli In Expertiselist.Items
If areasli.Selected Then
areasexpertise += " ; " & areasli.Text
End If
Next
x.Parameters.AddWithValue("@areasofexpertise", areasexpertise)
If OtherLanguage.Checked.ToString Then
x.Parameters.AddWithValue("@otherlanguage", otherlanguagespecify.Text)
Else
x.Parameters.AddWithValue("@otherlanguage", DBNull.Value)
End If
'Add competencies params to x command
x.Parameters.AddWithValue("@assessor", AssessorTrue.Checked)
x.Parameters.AddWithValue("@coordinator", CoordinatorTrue.Checked)
x.Parameters.AddWithValue("@facilitator", FacilitatorTrue.Checked)
x.Parameters.AddWithValue("@moderator", ModeratorTrue.Checked)
x.Parameters.AddWithValue("@productdeveloper", ProductDeveloperTrue.Checked)
x.Parameters.AddWithValue("@projectmanager", ProjectManagerTrue.Checked)
x.Parameters.AddWithValue("@assessorexp", Assessorexp.Text)
x.Parameters.AddWithValue("@coordinatorexp", coordinatorexp.Text)
x.Parameters.AddWithValue("@facilitatorexp", facilitatorexp.Text)
x.Parameters.AddWithValue("@moderatorexp", moderatorexp.Text)
x.Parameters.AddWithValue("@productdeveloperexp", productdeveloperexp.Text)
x.Parameters.AddWithValue("@projectmanagerexp", projectmanagerexp.Text)
x.Parameters.AddWithValue("@assessorlvl", Assessorlevel.Text)
x.Parameters.AddWithValue("@coordinatorlvl", Coordinatorlevel.Text)
x.Parameters.AddWithValue("@facilitatorlvl", Facilitatorlevel.Text)
x.Parameters.AddWithValue("@moderatorlvl", Moderatorlevel.Text)
x.Parameters.AddWithValue("@productdeveloperlvl", Productdeveloperlevel.Text)
x.Parameters.AddWithValue("@projectmanagerlvl", Projectmanagerlevel.Text)
x.Parameters.AddWithValue("@assessorpref", AssessorPref.Text)
x.Parameters.AddWithValue("@coordinatorpref", CoordinatorPref.Checked)
x.Parameters.AddWithValue("@facilitatorpref", FacilitatorPref.Checked)
x.Parameters.AddWithValue("@moderatorpref", ModeratorPref.Checked)
x.Parameters.AddWithValue("@productdeveloperpref", ProductDeveloperPref.Checked)
x.Parameters.AddWithValue("@projectmanagerpref", ProjectManagerPref.Checked)
x.Parameters.AddWithValue("@professorpref", ProfessorPref.Checked)
x.Parameters.AddWithValue("@professorlvl", Professorlevel.Text)
x.Parameters.AddWithValue("@professor", ProfessorTrue.Checked)
x.Parameters.AddWithValue("@professorexp", professorexp.Text)
x.Parameters.AddWithValue("@lecturerpref", LecturerPref.Checked)
x.Parameters.AddWithValue("@lecturerlvl", Lecturerlevel.Text)
x.Parameters.AddWithValue("@lecturer", LecturerTrue.Checked)
x.Parameters.AddWithValue("@lecturerexp", lecturerexp.Text)
'Add professional experience params to x command
x.Parameters.AddWithValue("@profdates1", ProfDates1.Text)
x.Parameters.AddWithValue("@profdates2", ProfDates2.Text)
x.Parameters.AddWithValue("@profdates3", ProfDates3.Text)
x.Parameters.AddWithValue("@profdates4", ProfDates4.Text)
x.Parameters.AddWithValue("@profdates5", ProfDates5.Text)
x.Parameters.AddWithValue("@profdates6", ProfDates6.Text)
x.Parameters.AddWithValue("@profdates7", ProfDates7.Text)
x.Parameters.AddWithValue("@profloc1", ProfDates1.Text)
x.Parameters.AddWithValue("@profloc2", ProfDates2.Text)
x.Parameters.AddWithValue("@profloc3", ProfDates3.Text)
x.Parameters.AddWithValue("@profloc4", ProfDates4.Text)
x.Parameters.AddWithValue("@profloc5", ProfDates5.Text)
x.Parameters.AddWithValue("@profloc6", ProfDates6.Text)
x.Parameters.AddWithValue("@profloc7", ProfDates7.Text)
x.Parameters.AddWithValue("@profcomp1", ProfCompany1.Text)
x.Parameters.AddWithValue("@profcomp2", ProfCompany2.Text)
x.Parameters.AddWithValue("@profcomp3", ProfCompany3.Text)
x.Parameters.AddWithValue("@profcomp4", ProfCompany4.Text)
x.Parameters.AddWithValue("@profcomp5", ProfCompany5.Text)
x.Parameters.AddWithValue("@profcomp6", ProfCompany6.Text)
x.Parameters.AddWithValue("@profcomp7", ProfCompany7.Text)
x.Parameters.AddWithValue("@profpos1", Profpos1.Text)
x.Parameters.AddWithValue("@profpos2", Profpos2.Text)
x.Parameters.AddWithValue("@profpos3", Profpos3.Text)
x.Parameters.AddWithValue("@profpos4", Profpos4.Text)
x.Parameters.AddWithValue("@profpos5", Profpos5.Text)
x.Parameters.AddWithValue("@profpos6", Profpos6.Text)
x.Parameters.AddWithValue("@profpos7", Profpos7.Text)
x.Parameters.AddWithValue("@profdesc1", ProfDesc1.Text)
x.Parameters.AddWithValue("@profdesc2", ProfDesc2.Text)
x.Parameters.AddWithValue("@profdesc3", ProfDesc2.Text)
x.Parameters.AddWithValue("@profdesc4", ProfDesc4.Text)
x.Parameters.AddWithValue("@profdesc5", ProfDesc5.Text)
x.Parameters.AddWithValue("@profdesc6", ProfDesc6.Text)
x.Parameters.AddWithValue("@profdesc7", ProfDesc7.Text)
'Add references parameters to x command
x.Parameters.AddWithValue("@company1", company1.Text)
x.Parameters.AddWithValue("@company2", company2.Text)
x.Parameters.AddWithValue("@company3", company3.Text)
x.Parameters.AddWithValue("@company4", company4.Text)
x.Parameters.AddWithValue("@company5", company5.Text)
x.Parameters.AddWithValue("@nature1", natureofwork1.Text)
x.Parameters.AddWithValue("@nature2", natureofwork2.Text)
x.Parameters.AddWithValue("@nature3", natureofwork3.Text)
x.Parameters.AddWithValue("@nature4", natureofwork4.Text)
x.Parameters.AddWithValue("@nature5", natureofwork5.Text)
x.Parameters.AddWithValue("@workdate1", workdate1.Text)
x.Parameters.AddWithValue("@workdate2", workdate2.Text)
x.Parameters.AddWithValue("@workdate3", workdate3.Text)
x.Parameters.AddWithValue("@workdate4", workdate4.Text)
x.Parameters.AddWithValue("@workdate5", workdate5.Text)
x.Parameters.AddWithValue("@contactname1", ContactName1.Text)
x.Parameters.AddWithValue("@contactname2", ContactName2.Text)
x.Parameters.AddWithValue("@contactname3", ContactName3.Text)
x.Parameters.AddWithValue("@contactname4", ContactName4.Text)
x.Parameters.AddWithValue("@contactname5", ContactName5.Text)
x.Parameters.AddWithValue("@wtelephone1", Telephone1.Text)
x.Parameters.AddWithValue("@wtelephone2", Telephone2.Text)
x.Parameters.AddWithValue("@wtelephone3", Telephone3.Text)
x.Parameters.AddWithValue("@wtelephone4", Telephone4.Text)
x.Parameters.AddWithValue("@wtelephone5", Telephone5.Text)
x.Parameters.AddWithValue("@wemail1", Email1.Text)
x.Parameters.AddWithValue("@wemail2", Email2.Text)
x.Parameters.AddWithValue("@wemail3", Email3.Text)
x.Parameters.AddWithValue("@wemail4", Email4.Text)
x.Parameters.AddWithValue("@wemail5", Email5.Text)
'Add other areas of expertise parameter
x.Parameters.AddWithValue("@otherareasofexpertise", Otherareasofexpertise.Text)
'Add philosophy / pubs / affils comands to x command
x.Parameters.AddWithValue("@philosophy", learningphilosophy.Text)
x.Parameters.AddWithValue("@publications", publicationdetails.Text)
x.Parameters.AddWithValue("@affiliations", affiliations.Text)
x.Parameters.AddWithValue("@educationmore", educationmore.Text)
c.Open()
x.ExecuteNonQuery()
c.Close()
Catch ex As Exception
WriteError(ex.ToString)
End Try
'If everyone is happy, redirect to thank you page
If (Page.IsValid) Then
Response.Redirect("Thanks.aspx")
End If
End Sub
End Class