Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




System.Security.SecurityException

web-app

 What is the required "trust"'s for gemini, I've been researching this all afternoon but have not been successful getting this to work...

Is it "FULL" trust or "Medium" Trust

 

Thanks in advance

Ray ---------------------------------------------------------------------------------

Server Error in '/Gemini' Application.

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 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 for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +59
   System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +288
   System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +47
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer.CreateDynamicMethod(Type returnType, Type[] argumentTypes) +103
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateGetPropertyValuesMethod(IGetter[] getters) +253
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) +127
   NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) +55
   NHibernate.Type.ComponentType..ctor(Type componentClass, String[] propertyNames, IGetter[] propertyGetters, ISetter[] propertySetters, Boolean foundCustomAcessor, IType[] propertyTypes, Boolean[] nullabilities, FetchMode[] joinedFetch, CascadeStyle[] cascade, String parentProperty) +569
   NHibernate.Cfg.HbmBinder.BindComponent(XmlNode node, Component model, Type reflectedClass, String className, String path, Boolean isNullable, Mappings mappings) +4209
   NHibernate.Cfg.HbmBinder.BindRootClass(XmlNode node, RootClass model, Mappings mappings) +2066
   NHibernate.Cfg.HbmBinder.BindRoot(XmlDocument doc, Mappings mappings) +514
   NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name) +94

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

azwief
· 1
azwief
Replies (16)
helpful
0
not helpful

It should be medium. When do you get this error?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

I get the same error when I attempt to launch Gemini.  I have a new install of 2.1.1.  I di the automated install after making a GEMINI and GEMINIPROFILE SQL db on a remote SQL Server.  Is there a fix for this issue?


mmoline
· 1
mmoline
helpful
0
not helpful

We do not have a fix for this at the moment. The only workaround is to give full trust for Gemini.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Where do I do this?  The Machine.config file on the server currently has :

 <location allowOverride="true">
        <system.web>
            <securityPolicy>
                <trustLevel name="Full" policyFile="internal" />
                <trustLevel name="High" policyFile="webhightrust.config" />
                <trustLevel name="Medium" policyFile="web
mediumtrust.config" />
                <trustLevel name="Low"  policyFile="weblowtrust.config" />
                <trustLevel name="Minimal" policyFile="web
minimaltrust.config" />
            </securityPolicy>

            <!--  level="[Full|High|Medium|Low|Minimal]" -->
            <trust level="Full" originUrl="" />

        </system.web>
    </location>

The asp.net tab for Gemini on IIS is set to 2.0.5727.  Does this need to change to 1.1?  If no, what else might be the issue?

Thanks


mmoline
· 1
mmoline
helpful
0
not helpful

Please see http://support.microsoft.com/kb/555466, you might need an application pool for Gemini.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Here's an excerpt from my Machine.log file

    <!--
        Using a location directive with a missing path attribute
        scopes the configuration to the entire machine.  If used in
        conjunction with allowOverride="false", it can be used to
        prevent configuration from being altered on the machine

        Administrators that want to restrict permissions granted to
        web applications should change the default Trust level and ensure
        that overrides are not allowed
    -->
<location path="Gemini" allowOverride="true">
   <system.web>
     <trust level="Full" originUrl=""/>
   </system.web>
</location>

    <location allowOverride="true">
        <system.web>
            <securityPolicy>
                <trustLevel name="Full" policyFile="internal" />
                <trustLevel name="High" policyFile="webhightrust.config" />
                <trustLevel name="Medium" policyFile="web
mediumtrust.config" />
                <trustLevel name="Low"  policyFile="weblowtrust.config" />
                <trustLevel name="Minimal" policyFile="web
minimaltrust.config" />
            </securityPolicy>

            <!--  level="[Full|High|Medium|Low|Minimal]" -->
            <trust level="Full" originUrl="" />

        </system.web>
    </location>

    <system.web>

Gemini is setup as an Application Pool already.  Also, Gemini is setup under the Default Web Server.

Thanks


mmoline
· 1
mmoline
helpful
0
not helpful

I think you need the first part to look like:

<location path="Gemini" allowOverride="false">
   <system.web>
     <trust level="Full" originUrl=http://yourserver/Gemini/>
   </system.web>
</location>


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

I had my hosting compnay move this applicaiton to a server that allowed "FULL" trust support, it's now working great, please update the user manual so other folks don't have to battle this issue.

 

Thanks


azwief
· 1
azwief
helpful
0
not helpful

This is hosted on an internal server.  I just thought I'd hop on this topic too keep similar issues in one place.  I edited the Machine config file to reflect the post above.  I'm still getting the same thing:

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

        <b> Exception Details: </b>System.Security.SecurityException:

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Sharepoint is on this server, but I configured an exception for the path in the beginning.  Any other suggestions?


mmoline
· 1
mmoline
helpful
0
not helpful

Did you see this post: http://community.countersoft.com/forums/thread/4016.aspx (2nd from bottom)?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Nothing seems to be working here, so I gave up and installed this on an entirely new machine.  This comes complete with a whole host of new error messages.  So I tried a manual install.  No luck.  I think I'm done.


mmoline
· 1
mmoline
helpful
0
not helpful

What are the errors this time?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

I took the weekend off from this project and I'm ready to tackle it again.  I'm attempting to put Gemini on a server that's only role is as a backup.  Here's what I've done so far this morning:

1.  Uninstall Gemini, Delete SQL databases, Delete IIS Application Pool and confirm Site is gone.
2.  Confirm Program Files Directory is deleted
3.  Server info:  Windows Server 2003 SP1, IIS version 6.0, SQL Server 2000 SP4
4.  Run CounterSoftGeminiv211.exe
5.  Install to C:\Program Files\CounterSoft\Gemini Project Issue Tracking.  23 GB Free Space
6.  Chose "Default Web Site" for IIS Website.  "Gemini" for Virtual Folder
7.  Program folder is CounterSoft\Gemini Project Issue Tracking
8.  SQL Server instance name is 127.0.0.1  Database Name is Gemini, Profile DB is GEMINIASPNETDB.  Default settings of Windows Authentication, Populate New Gemini Database, Run Scripts left alone.
9.  Created 2 new SQL databases (GEMINI and GEMINI
ASPNETDB) under Enterprise Manager on this server
10.  Connection Test was successful message
11.  INstall throws no errors.  Click Finish.
12.  Accessing http://cansql01/gemini on local and remote systems throws error.  I reconfigure web.config file in C:\Program Files\CounterSoft\Gemini Project Issue Tracking to turn customErrors Off
13.  http://cansql01/gemini throws the following error:
The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.

14.  I give Network Service write access to that directory.
15.  New error:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

16.  I give the Network Service Full rights to both Gemini DBs.  User shows up under both DBs in Enterprise Manager.
17.  Same error message.  At this point, I'm stuck.

Thanks for all of the assistance so far!


mmoline
· 1
mmoline
helpful
0
not helpful

Here's my connection info from Web.Config in the Gemini directory:

  <nhibernate>
      <!-- The SQL Server dialect (Gemini supports "MsSql2005Dialect" or "MsSql2000Dialect" or "MsSql7Dialect") -->
      <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
      <!-- The SQL Server database connection string -->
      <add key="hibernate.connection.connectionstring" value="data source=localhost;initial

catalog=GEMINI;Trusted
Connection=true"/>
      <!-- Misc -->
      <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
      <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
  </nhibernate>


mmoline
· 1
mmoline
helpful
0
not helpful

Please reboot the web app, the error should be gone.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Issue resolved with the service reboot.  Tomorrow, I will attempt to move it to another front-end server with the same back end


mmoline
· 1
mmoline