Herp Security Exception aspx

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Herp Security Exception aspx

Post by sbslavonac » Mon 01 Mar 2010 18:30

Hi,
I've recently upgraded to build 5.55.97 dotConnect for Oracle and upgraded aspx web site.
As usual it works localy but when deployed I got error :

Exception Details: System.Security.SecurityException: Request failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SecurityException: Request failed.]
Devart.Common.DbConnectionInternal.EnlistToDistributedTransaction(Transaction transaction) +0
Devart.Common.DbConnectionInternal.c() +33
Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0) +181
Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection) +129
Devart.Common.DbConnectionBase.Open() +149
Devart.Data.Oracle.OracleConnection.Open() +237
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
Devart.Data.Oracle.OracleDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +202
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297
Devart.Common.Web.DbSqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +18
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
DevExpress.Web.ASPxClasses.Internal.DataHelper.PerformSelect() +149
DevExpress.Web.ASPxClasses.Internal.DataContainer.PerformSelect() +103
DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.DataBindCore() +15
DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.DataBind() +104
DevExpress.Web.ASPxClasses.Internal.DataHelperBase.EnsureDataBound(Boolean ensureChildControls) +89
DevExpress.Web.ASPxClasses.Internal.DataContainer.EnsureDataBound() +111
DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.OnPreRender(EventArgs e) +22
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
System.Web.UI.Page.ProcessRequest() +80
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

I haven't changed anything, just recompiled and deployed.
(deployed also new dll, checked and double checked).
I believe I've seend this kind of exception before but can't remember what I've done to avoid it. So any help would be much appreciated.

Best regards
Boris

sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Post by sbslavonac » Mon 01 Mar 2010 18:31

forgor to mention : VS 2008,
Oracle mode direct

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 02 Mar 2010 17:23

The medium trust plus SocketPermission are required by dotConnect for Oracle in the Direct mode as partially trusted code. For more information about the medium trust level, please refer to http://msdn.microsoft.com/en-us/library/ms998341.aspx . The similar problem was also discussed in this thread at our forum. Try setting a higher trust level in the web.config file of your application (e.g., "Full") or contact your hosting provider.

sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Post by sbslavonac » Wed 03 Mar 2010 17:55

Hi,
Ive checked, and medium trust plus SocketPermission is enabled on site.
You can check at : www.speranza-online.com
I have reverted the build to 5.20.33.0 version and created test (it's online)page. If you press the button it will fill the dropdown.
If I compile the same page with latest build I got the error I've desribed in previous post.
During the installation of bild 5.55.97 I've got error, thisi is a copy from install.log
--- Custom action error: HelpReg
Date: 24.2.2010 12:49:10
Environment
Operating System: Microsoft Windows NT 6.1.7600.0
.NET Framework: 2.0.50727.4927
Assembly: HelpReg, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Exception
Message: [Ñàmespäcê not spécïfíèd: ms-help://MS.VSCC.V80.||||||||||||||||||||||||]
Type: System.Runtime.InteropServices.COMException
StackTrace: at MSHelpServices.IHxSession.Initialize(String NameSpace, Int32 options)
at Devart.Common.Setup.InnovaHxReg.UpdateHelp(String helpCollection).
For now I'll use the older build, but it would be nice to fid out what's wrong.
Anything I could check?
Best regards.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 05 Mar 2010 12:27

1. We will investigate the possible reason of SecurityException. Probably, it requires the full trust level. Are there any differences in your web applications when you deployed them with 5.20.33.0 and 5.55.97?

2. The error from Install.log says that merging the Devart documentation with the Microsoft help collection of Visual Studio 2005 failed. Do you have Visual Studio 2005 installed on your machine?

sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Post by sbslavonac » Fri 05 Mar 2010 13:10

1. Just added another page.
To check that error has not been created by that change, I've created test app with just button and :
protected void Button1_Click(object sender, EventArgs e)
{
errLabel.Text ="Click ";


using (OracleConnection connection = new OracleConnection(ConfigurationManager.ConnectionStrings["Turizam"].ConnectionString))
{
try
{
connection.Open();
errLabel.Text += connection.State.ToString();

OracleCommand shime = new OracleCommand("Select * from web_hotel", connection);

OracleDataReader myReader = shime.ExecuteReader();
using (OracleDataTable dt = new OracleDataTable())
{
dt.Load(myReader);

errLabel.Text += " Read ";
myReader.Close();
DropDownList1.DataSource = dt;
}
DropDownList1.DataTextField = "HOTEL";
DropDownList1.DataValueField = "ID";

DropDownList1.DataBind();
errLabel.Text += " Bind ";



}
catch (Exception exception)
{
errLabel.Text += exception.Message;
//throw new InvalidOperationException(exception.Message+" "+errLabel.Text);

}
finally
{
errLabel.Text += "Close";
connection.Close();

}
}
}
With old build everything works as expected, new build throws
"Request failed" error on button click.
("Click Request failed.Close" is the output)

If I bind the grid in designer directly to datasource, on opening default page error is as in my first post.
I can zip test app if needed.

2. Nope, VS 2008, I've oppened another post witth installation issue.
Best regards
Boris

sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Post by sbslavonac » Fri 05 Mar 2010 15:35

I will try to install new version on second machine which has clean installation of VS2008 and check if I have issues with VS 2008. On that computer is "old" build which works normally.

Will post results.
Best regards
Boris

sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Post by sbslavonac » Mon 08 Mar 2010 14:00

Hi,
Small update, definetly last working version is
dcoracle520pro.
All others are not working.
Best regards
Boris

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 09 Mar 2010 13:12

We are investigating the issue at the moment and will notify you about the results as soon as possible.

As a temporary solution, you can identify the necessary permissions yourself. I have created a small web site basing on the code you have posted, restored my %windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG\web_mediumtrust.config to its default settings and set trust level to "Medium" explicitly in web.config of my web site to create an environment that is similar to the hosting's one. In my case, I added the following permissions to my web_mediumtrust.config to make this site work (the needed permission you can get from the error message, and the way to set it can be retrieved from the web_hightrust.config file):
1) as stated in our documentation, added SocketPermission (Unrestricted="true");
2) added RegistryPermission (Unrestricted="true");
3) changed EnvironmentPermission - set Unrestricted="true" instead of Read="TEMP;TMP;USERNAME;OS;COMPUTERNAME".

BTW, in the case of 5.20.33 I had to set the permissions mentioned above plus FileIOPermission (Unrestricted="true").

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 10 Mar 2010 14:38

We have implemented changes in our sources. Hope, this will exclude the possibility of calling methods which require the FullTrust permission set. Actually, we didn't reproduce the error with the same call stack mentioned in your first post in this thread. Looking forward to the next build of dotConnect for Oracle. I will post here when it is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 01 Apr 2010 07:56

dotConnect for Oracle 5.60 is released!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=17514 .

sbslavonac
Posts: 35
Joined: Mon 02 Apr 2007 09:14

Post by sbslavonac » Wed 07 Apr 2010 08:17

I've installed new version but unfortunatelly I got the same error as in first post.
I've talked to provider and luckilly they set up site in full trust mode, and now it's working.
Best regards
Boris

Post Reply