[SOLVED] Access is denied: SD...SQL.NET11

Posts   
1  /  2
 
    
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 13:57:04   

PEriodically, i get this exception. It seems to happen when I make some code changes to my test web app.

Any Ideas ?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 24-Mar-2004 13:59:24   

Sink wrote:

PEriodically, i get this exception. It seems to happen when I make some code changes to my test web app.

Any Ideas ?

I assume you use VB.NET? (as it happens with VB.NET a lot) and you get this during compile?

If it is at runtime, do you reference the dll's from a network share?

Frans Bouma | Lead developer LLBLGen Pro
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 14:35:57   

Otis wrote:

Sink wrote:

PEriodically, i get this exception. It seems to happen when I make some code changes to my test web app.

Any Ideas ?

I assume you use VB.NET? (as it happens with VB.NET a lot) and you get this during compile?

If it is at runtime, do you reference the dll's from a network share?

No, I am using C#. It happens after I compile and try to run under debugger. The last time it happened it was followed by ASP.NET crashing and a restart of IIS after which it ran through fine.

No network share. I added refernences to the two SD assemblies and properties shows copy local = true. I put a copy of the license in the same (bin) directory in case that was it but no effect.

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 14:53:20   

This is driving me nuts. More info for you.

I am using impersonation thru to SQL server and am setting the access on each Table as appropriate.

I am using Intergrated Security.

Hope this helps..

Regards

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 15:00:21   

More info ..

I am running under a transaction which is now standing at 6 rows in different tables and will grow. The transaction is similar to the one in your documentation. I am not sure if you are using your own tp model or ADO's but it is not COM+.

Regards

P.S. Will try without debug after my next edit

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 15:26:47   

Without debug, same problem occurs..

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 24-Mar-2004 15:49:54   

OK, I thought you were refering to an error you got when you were compiling the code.

So you run the code and you get a security exception, could you please paste teh complete exception here, including the stacktrace? thanks.

Frans Bouma | Lead developer LLBLGen Pro
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 16:49:00   

Sorry took so long, this machine is isolated from my dev network.

Stack

testagres.dll!TestAgRes.WebForm1.Page_Load(System.Object sender = {ASP.WebForm1_aspx}, System.EventArgs e = {System.EventArgs}) Line 133 C# system.web.dll!System.Web.UI.Control.OnLoad(System.EventArgs e = {System.EventArgs}) + 0x53 bytes system.web.dll!System.Web.UI.Control.LoadRecursive() + 0x39 bytes system.web.dll!System.Web.UI.Page.ProcessRequestMain() + 0x1ab bytes system.web.dll!System.Web.UI.Page.ProcessRequest() + 0x92 bytes system.web.dll!System.Web.UI.Page.ProcessRequest( System.Web.HttpContext context = {System.Web.HttpContext}) + 0x1e bytes system.web.dll!CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() + 0xf9 bytes system.web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, bool completedSynchronously = true) + 0x86 bytes system.web.dll!System.Web.HttpApplication.ResumeSteps(System.Exception error = { }) + 0x148 bytes system.web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler. BeginProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}, System.AsyncCallback cb = {System.AsyncCallback}, System.Object extraData = {System.Web.HttpContext}) + 0xac bytes system.web.dll!System.Web.HttpRuntime.ProcessRequestInternal( System.Web.HttpWorkerRequest wr) + 0x1e7 bytes system.web.dll!System.Web.HttpRuntime.ProcessRequest( System.Web.HttpWorkerRequest wr) + 0xb0 bytes system.web.dll!System.Web.Hosting.ISAPIRuntime.ProcessRequest(int ecb, int iWRType) + 0x65 bytes

Exception

  • ex {"Exception caught during save. See the contents of the InnerException property for details about this exception." } System.Exception
  • [System.ApplicationException] {"Exception caught during save. See the contents of the InnerException property for details about this exception." } System.ApplicationException System.Object {System.ApplicationException} System.Object _className null string _COMPlusExceptionCode -532459699 int _exceptionMethod <undefined value> System.Reflection.MethodBase _exceptionMethodString null string _helpURL null string _HResult -2146232832 int
  • _innerException {"Access is denied: 'SD.LLBLGen.Pro.DQE.SqlServer.NET11'." } System.Exception _message "Exception caught during save. See the contents of the InnerException property for details about this exception." string _remoteStackIndex 0 int _remoteStackTraceString null string _source null string
  • _stackTrace {System.Array} System.Object _stackTraceString null string _xcode -532459699 int _xptrs 0 int HelpLink null string HResult -2146232832 int
  • InnerException {"Access is denied: 'SD.LLBLGen.Pro.DQE.SqlServer.NET11'." } System.Exception Message "Exception caught during save. See the contents of the InnerException property for details about this exception." string Source "SD.LLBLGen.Pro.ORMSupportClasses.NET11" string StackTrace " at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save(IPredicate updateRestriction, Boolean recurse)\r\n at AgRes.EntityClasses.ACCOUNTEntityBase.Save(IPredicate updateRestriction, Boolean recurse) in C:\\Development\\AgRes1\\EntityBaseClasses\\ACCOUNTEntityBase.cs:line 240\r\n at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save()\r\n at TestAgRes.WebForm1.Page_Load(Object sender, EventArgs e) in c:\\inetpub\\wwwroot\\testagres\\webform1.aspx.cs:line 42" string
  • TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase
  • transactionManager {AgRes.HelperClasses.Transaction} AgRes.HelperClasses.Transaction

I am afraid doesn't show much. If there is something else I can do to help diagnose just ask.

More info:

OS: Windows 2003 Server (Application Server config - fully patched) ASP.NET 1.1 IIS 6.0

Regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 24-Mar-2004 16:59:06   

InnerException {"Access is denied: 'SD.LLBLGen.Pro.DQE.SqlServer.NET11'." } System.Exception Message "Exception caught during save. See the contents of the InnerException property for details about this exception." string Source "SD.LLBLGen.Pro.ORMSupportClasses.NET11" string StackTrace " at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save(IPredicate updateRestriction, Boolean recurse)\r\n at AgRes.EntityClasses.ACCOUNTEntityBase.Save(IPredicate updateRestriction, Boolean recurse) in C:\\Development\\AgRes1\\EntityBaseClasses\\ACCOUNTEntityBase.cs:line 240\r\n at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save()\r\n at TestAgRes.WebForm1.Page_Load(Object sender, EventArgs e) in c:\\inetpub\\wwwroot\\testagres\\webform1.aspx.cs:line 42" string + TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase + transactionManager {AgRes.HelperClasses.Transaction} AgRes.HelperClasses.Transaction

This tells me the save action tries to update a table but the current user (probably the ASPNET user) is not allowed to update / insert a row in the table ACCOUNT.

Could you check for that for me, please? simple_smile

(btw, you can fix the casing of the entities by setting the CorrectNameCasing preference in the preferences to true (before a project is created) or if you have already a project, change it in the project properties and the entities added after that will be properly cased (and f.e. without '_')

Frans Bouma | Lead developer LLBLGen Pro
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 17:28:39   

The public user has the rights needed to do this and the ASP.NET user has been assigned the public role.I did check the database itself and granted some privileges to the public user, specifically create table, view, sp, ... I will check and see if this makes any difference.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 24-Mar-2004 17:30:58   

For testing, could you please add the ASPNET user to the db_owner role and see if it works then.

Frans Bouma | Lead developer LLBLGen Pro
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 17:33:10   

It made no difference, it worked fine, I made a change to the code, recompiled and error is back. The ACCOUNTEntity is the first row saved and I believe that is why the error occurs there. I can change the code around and verify.

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 17:36:14   

Our messages crossed. I added the ASP.NET user to the db_owner role and the same error occurs.

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 17:40:28   

What is consistent is that on the first time thru after a build, the error occurs. On the second time thru, no problem ...

Beginning to hear a little Twilight zone music here ...

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 17:41:39   

By the way, thanks for the attention. This is impressive ..

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 24-Mar-2004 17:53:56   

Sink wrote:

What is consistent is that on the first time thru after a build, the error occurs. On the second time thru, no problem ...

Beginning to hear a little Twilight zone music here ...

Hmmm... Really weird. What I previously said about the actual query rights is not correct, it seems the SqlServer DQE dll isn't accessable and that throws an exception. Has the ASPNET user read-rights on that dll in the bin dir? (I'm guessing here, but with this kind of errors, everything is possible wink )

Frans Bouma | Lead developer LLBLGen Pro
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 18:06:27   

Yes, the rights are read and execute. The default NETWORK_SERVICE account did not have execute so I gave it, but no effect. The rights on the internet user are fine.

Unfortunately, I have to go, but will be back later.

Thanks again for the hep.

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 24-Mar-2004 22:33:38   

This is too weird. Three time ASP.net has crashed, loads of warnings in the System logs about application pools being killed.

I am going to uninstall IIS, ASP.NET and reisntall and see what happens

Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 25-Mar-2004 00:45:35   

Re-installed IIS and ASP.NET, rebuilt the LLBLGen project, rebuilt the test program and the problem has not re-occurred since, 10 tries.

No changes to SQL Server, accounts or tables.

Have not got a clue why this worked.

The ASP.NET crashes turned out to be the Application Pool rapid-fail-check shut down the pool after 5 failures in five minutes. There was only one pool defined. A debug session seems to count as a failure. I reset these values to more realistic values and none of the problems occur any more.

Sorry to have wasted your time, but thanks for the effort, I hope this is over?

Regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 25-Mar-2004 09:32:12   

Weird issue... I hope this is indeed gone now simple_smile If you run into it again, let me know simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Paul
User
Posts: 28
Joined: 26-Feb-2004
# Posted on: 25-Mar-2004 15:49:12   

Frans,

I'm lucky enough to be experiencing the same problem. I have a runtime error that I'm trying to debug and it's throwing an exception.

When I first run my application in debug mode I am prompted to enter user cradentials to initiate a debug session. The app then runs along happily until it crashes.

The next time I run the application I'm not prompted to enter user cradentials for the debug session. I assume that these persist until you exit .NET or log off. Don't know which.

The error I'm seeing ("Unable to load reference library" and "Access is denied") leads me to think that the sd.llblgen.pro.ormsupportclasses.net11.dll isn't being released after the crash. The debug session still has control.

I can start and stop the application as many times as I want, recompile, change code, it doesn't matter.

In my case, if I shut down the .NET Dev Environment, open it again, and then reopen the solution I'm able to run the application, to its crashing point, one more time before the "Access is Denied" error re-occurs.

I don't know if this is a .NET debugging issue or an issue with the DLL's?

As with Sink, I'm using impersonation. However, this application is the first "impersonation" type web application that I've been prompted to enter user cradentials to debug. I believe If I can figure out how to eliminate that, the problem will go away.

Sinks solution seems to buy time but I don't think it answers why the dll isn't being freed after the crash.

The real question is why doesn't the debug session release the dll? or what is the proper way to close a debug session when a fatal error occurs?

What are your thoughts?

Paul

ERROR TO FOLLOW:

Server Error in '/EDC' Application.

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC31011: Unable to load referenced library 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\ f608dc5e\00e4bcda_190ec401\sd.llblgen.pro.ormsupportclasses.net11.dll': Access is denied.

Source Error:

[No relevant source lines]

Source File: vbc : Line: 0

Show Detailed Compiler Output:

C:\Windows\system32> "c:\windows\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\98d4ca8e\c1e14a0e_7112c401\dp.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\0f1dc74a\98178113_7112c401\dal.dll" /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\windows\assembly\gac\system.enterpriseservices\ 1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\f608dc5e\ 00e4bcda_190ec401\sd.llblgen.pro.ormsupportclasses.net11.dll" /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\windows\assembly\gac\system.web.services\ 1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\44d82700\5a1c0cc4_7212c401\edc.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\301dc5c1\ 00e4bcda_190ec401\sd.llblgen.pro.dqe.sqlserver.net11.dll" /out:"C:\Windows\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\edc\b132c426\d3f51767\i_bn3awl.dll" /Dsmile EBUG=1 /debug+ "C:\Windows\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\edc\b132c426\d3f51767\i_bn3awl.0.vb"

Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4 for Microsoft (R) .NET Framework version 1.1.4322.573 Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

vbc : error BC31011: Unable to load referenced library 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\f608dc5e\ 00e4bcda_190ec401\sd.llblgen.pro.ormsupportclasses.net11.dll': Access is denied. c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\f608dc5e\ 00e4bcda_190ec401\sd.llblgen.pro.ormsupportclasses.net11.dll : error BC31011: Unable to load referenced library 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\f608dc5e\ 00e4bcda_190ec401\sd.llblgen.pro.ormsupportclasses.net11.dll': Access is denied. vbc : error BC30142: Unable to generate a reference to file 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\edc\b132c426\d3f51767\assembly\dl2\f608dc5e \00e4bcda_190ec401\sd.llblgen.pro.ormsupportclasses.net11.dll' (use TLBIMP utility to reference COM DLLs): Access is denied.

Show Complete Compilation Source:

Line 1: '------------------------------------------------------------------------------ Line 2: ' <autogenerated> Line 3: ' This code was generated by a tool. Line 4: ' Runtime Version: 1.1.4322.573 Line 5: ' Line 6: ' Changes to this file may cause incorrect behavior and will be lost if Line 7: ' the code is regenerated. Line 8: ' </autogenerated> Line 9: '------------------------------------------------------------------------------ Line 10:
Line 11: Option Strict Off Line 12: Option Explicit On Line 13:
Line 14: Imports Microsoft.VisualBasic Line 15: Imports System Line 16: Imports System.Collections Line 17: Imports System.Collections.Specialized Line 18: Imports System.Configuration Line 19: Imports System.Text Line 20: Imports System.Text.RegularExpressions Line 21: Imports System.Web Line 22: Imports System.Web.Caching Line 23: Imports System.Web.Security Line 24: Imports System.Web.SessionState Line 25: Imports System.Web.UI Line 26: Imports System.Web.UI.HtmlControls Line 27: Imports System.Web.UI.WebControls Line 28:
Line 29: Namespace ASP Line 30: Line 31: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _ Line 32: Public Class Global_asax Line 33: Inherits XXXXXX.Manufacturing.EDC.Global Line 34: Line 35: Private Shared __initialized As Boolean = false Line 36: Line 37: Public Sub New() Line 38: MyBase.New Line 39: If (ASP.Global_asax.__initialized = false) Then Line 40: ASP.Global_asax.__initialized = true Line 41: End If Line 42: End Sub Line 43: End Class Line 44: End Namespace Line 45:


Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 25-Mar-2004 16:15:42   

I could find a lot of people on Google groups with the same error. It's not related to the dll's but to ASP.NET

1 (one) Microsoft employee tried to help in all those threads (and if amount of support is this low from them, you know there is a bug in the framework somewhere). He pointed to: http://support.microsoft.com/?id=324519

A weird article, as it says that signed assemblies are not supported in the bin directory. Huh? simple_smile This site has them in the bin directory, never had a problem.

Apparently the dll's are locked by a process. This might be the asp.net worker process, I don't know. What you could do is download process viewer from www.sysinternals.com, and check, AFTER you've received this error, which process holds the dll which can't be loaded.

I'm not sure how you start debugging processes in ASP.NET, just by hitting F5 I guess. If the debugger crashes or breaks, stop the debugger from the IDE, and wait till the debug process is completely stopped in the IDE before restarting. But I don't have a clear answer to this other than that it's not something inside the dll's.

Frans Bouma | Lead developer LLBLGen Pro
Paul
User
Posts: 28
Joined: 26-Feb-2004
# Posted on: 25-Mar-2004 16:47:45   

Sure pass it off on the other guy! wink Now we are getting the kind of support we are used to! cry

Thanks for the information and tips.

bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 25-Mar-2004 17:29:27   

Otis wrote:

A weird article, as it says that signed assemblies are not supported in the bin directory. Huh? simple_smile This site has them in the bin directory, never had a problem.

I have never had an issues either... thats crazy jeez..

MS = "Strong assemblies are good, sign your stuff, but o yeah you can put them in the BIN directory"

thats crap

anyhow

I had some issues a few months ago with some web apps. Don't know if they are related but figured I would throw it out there. Every once in a while I will get access denied messages. After much research (sorry cant find the links) I did the following and I haven't had any issues since

  1. I had antivirus running on the web server, I excluded the c:\WINNT\microsoft.net\ directory,the bin directory and the root of the web site (web.config)

  2. Made sure authenticated users had Read Write and list folder contents to the c:\WINNT\microsoft.net\ directory and below

I think what was happening was that the antivirus would touch something in the web directory that would cause the application to restart. IF a user that hit the website after the restart didn't have permission to the c:\WINNT\microsoft.net\ directory an error would be thrown. I am running using windows authentication but in your case I would make sure what ever process that is running the web service has access to the c:\WINNT\microsoft.net directory hope this helps Bert

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 25-Mar-2004 17:42:01   

Good tips, Bert simple_smile That can be an issue as well indeed.

Paul: simple_smile I'm sorry simple_smile But! because you're a Microsoft customer, you could try calling PSS and ask them to fix this. You'll never know if there is already a 'hotfix' for this (and you all are not alone in this, the error is common, so perhaps another one has mailed/called them already)

Frans Bouma | Lead developer LLBLGen Pro
1  /  2