A Trappable Error C0000005 Occurred in an External Object The Script Cannot Continue Running

How can I get my application pool to stop crashing on me?

Background

All was working well for many years, until I updated Windows 10 Pro to the suggested update Windows Feature Experience Pack.

enter image description here

Current System:

Edition Windows 10 Pro
Version 21H2
Installed on ‎8/‎24/‎2020
OS build 19044.1415
Experience Windows Feature Experience Pack 120.2212.3920.0

This must have probably changed some user permissions and the way IIS was working; and to the point where I lost my website. I had to reinstall everything.

Error (C0000005)

It has been four weeks now since I've updated from MariaDB 10.1 to MariaDB 10.6 and with that, I changed from using MySQL ODBC 5.1 Driver to MariaDB Connector/ODBC 3.1 (Version 3.01.15.00) which is part of the "current stable release series."

These not very helpful errors are missing line number information where the error is. They read:

File /home.asp Unexpected error. A trappable error (C0000005) occurred in an external object. The script cannot continue running.

And look like this:

error (C0000005)


What I did:

I checked my code for left open connections to the database as suggested in this post Classic ASP C0000005 Error but I am still getting these errors. These random (C0000005) ASP errors keep bringing the application pool down and are very much behaving as described in this thread where some memory leak may be to blame for.

Now I am considering using a different driver.

The answers in this thread What are ASP 0115 and C0000005 Errors suggests using ODBC connector version 5.1.6 (mysql-connector-odbc-5.1.6-winx64.msi) which is from 2009. This MySQL Connector/ODBC 8.0.27 (mysql-connector-odbc-8.0.27-winx64.msi) looks more up to date. And I should give it a try.

First thing I've noticed it is much much faster. Now I am just hoping that these C0000005 Errors will end.


Update A: Errors are still returning, but much sooner as anticipated.

I tried the 32-bit driver as well mysql-connector-odbc-8.0.27-win32.msi to see if that would work but could not even get the page to load. I guess I would need to use a 32-bit application pool for it to work. (Have not tried that.)


Update B: I am now back using 64-bit MySQL Connector/ODBC 8.0.27 driver.

Could it be the way I configure the driver that brings my application pool down?

This is my connection string:

          Conn_STRING = "dsn=___;" & _    "TCPIP=1;" & _    "SERVER=127.0.0.1;" & _    "UID=___;" & _    "PWD=___;" & _    "DATABASE=___;" & _    "PORT=3306;" & _    "CONN_TIMEOUT=30;" & _    "CHARSET=utf8mb4;" & _    "READ_TIMEOUT=20;" & _    "WRITE_TIMEOUT=10;" & _    "Option=3"                  

I set the connection parameters as such:

connection

metadata

cursor/results

debug

ssl

misc

I noticed that somehow the application pool somehow keeps running despite these loged Erross:

          - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System>   <Provider Name="Active Server Pages" />    <EventID Qualifiers="49152">5</EventID>    <Version>0</Version>    <Level>2</Level>    <Task>0</Task>    <Opcode>0</Opcode>    <Keywords>0x80000000000000</Keywords>    <TimeCreated SystemTime="2021-12-23T21:41:37.9772561Z" />    <EventRecordID>2212200</EventRecordID>    <Correlation />    <Execution ProcessID="0" ThreadID="0" />    <Channel>Application</Channel>    <Computer>vm-white</Computer>    <Security />    </System> - <EventData>   <Data>File /blog.asp Unexpected error. A trappable error (C0000005) occurred in an external object. The script cannot continue running.</Data>    </EventData>   </Event>                  

I am also seeing a new Warning in the System Log.

A process serving application pool 'myPool' suffered a fatal  communication error with the Windows Process Activation Service. The  process id was '1124'. The data field contains the error number.


UPDATE

I tired many different ODBC drivers. MariaDB ODBC and MySQL ODBC drivers. None keeps the application pool from crashing. Before crashing lots of C0000005 errors get logged. The MySQL ODBC 8.0 driver turned out to be much faster and more forgiving, but something is still bring the application pool down. I am now using MySQL ODBC 8.0 Unicode driver.

MariaDB ODBC has a bug?

Furthermore, I now changed the way I am setting objects. Instead of setting them like this

          SET rs = Server.CreateObject("ADODB.Recordset") SET wshell = Server.CreateObject("WScript.Shell") SET message = Server.CreateObject("CDO.Message")                  

I'm now just doing

          SET rs = CreateObject("ADODB.Recordset") SET wshell = CreateObject("WScript.Shell") SET message = CreateObject("CDO.Message")                  

It is staring to look more promising. Some errors have now sometimes line numbers.

I contacted Microsoft to help me interpret my DebugDiag Analysis Report of these crashes. I also noticed a new pattern that started to show in the error logs. First a Active Server Pages followed by Application Error:

error pattern

Active Server Pages Error:

Error: File /blog.asp Unexpected error. A trappable error (C0000005) occurred in an external object. The script cannot continue running..

Application Error:

Faulting application name: w3wp.exe, version: 10.0.19041.1, time stamp: 0x58c67bf3
Faulting module name: ntdll.dll, version: 10.0.19041.1288, time stamp: 0xa280d1d6
Exception code: 0xc0000409
Fault offset: 0x00000000000a2070
Faulting process id: 0x3144
Faulting application start time: 0x01d7fd9d0686ef42
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: cda5aa10-492d-4e5c-ae17-ac4f9dbf70ab
Faulting package full name: Faulting package-relative application ID:


As suggested here at mysql.com I now changed my DSN connector setting for use with ASP. I checked to box Return matched rows instead of effected rows.

I had Option=3 in my connection string and found based on this blog that I should probably declare it as FLAG_FIELD_LENGTH (1) + FLAG_FOUND_ROWS (2).

Any suggestions are most welcome.

shellmanmagaraind.blogspot.com

Source: https://serverfault.com/questions/1088102/error-file-home-asp-unexpected-error-a-trappable-error-c0000005-occurred-in

0 Response to "A Trappable Error C0000005 Occurred in an External Object The Script Cannot Continue Running"

Publicar un comentario

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel