Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / CLR / August 2008

Tip: Looking for answers? Try searching our database.

TRUSTWORTHY bit randomly being switched off

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jesse Hersch - 28 Jun 2008 19:19 GMT
we run a distributed system involving many database servers. On each server,
we have a database called Meta which has no tables, only some helper
functions and procs that other procs in other databases call.

In this Meta database, there is an UNSAFE CLR assembly which some of these
helpers use. It's unsafe because it needs to read from the registry for
certain stuff. For this reason, Meta has its TRUSTWORTHY bit set to on.

So here's the problem. Every couple of months, the trustworthy bit in Meta
on one or another server seems to be getting switched off. This causes
errors because the CLR assembly can no longer be loaded.

our ops team thinks this switching may be correlated with creating new
databases, but it's not consistent. usually you can create a new database
and it's no problem, but every so often you create a new one and the
trustworthy bit in Meta gets flipped. Sounds crazy to me but that's what
they say.

When the error does happen, the only foolproof method ops has found to fix
it is to drop and recreate Meta. when they do that, everything is good
again.

It's virtually impossible to debug because it almost always works
correctly - very difficult to debug something with a two month failure
cycle...

Here's the error we see when it happens:

"An error occurred in the Microsoft .NET Framework while trying to load
assembly id 65537. The server may be running out of resources, or the
assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE.
Run the query again, or check documentation to see how to solve the assembly
trust issues."

Has anyone seen anything like this before? Anyone know what might indirectly
be causing the trustworthy bit to flip back off after it's be set on?

Signature

http://elsasoft.org

Adam Machanic - 30 Jun 2008 15:32 GMT
I don't know what to tell you about why the TRUSTWORTHY setting is getting
turned off -- I haven't seen that before.  But there is no reason that you
need TRUSTWORTHY to run an UNSAFE assembly.  Have you looked at the options
around signing the assembly with a certificate?  This eliminates the need
for the TRUSTWORTHY setting and is a much more secure option...

I wrote an article that touches on this topic (in addition to a couple of
related issues), which you can find here:

http://www.code-magazine.com/Article.aspx?quickid=0705051

> we run a distributed system involving many database servers. On each
> server, we have a database called Meta which has no tables, only some
[quoted text clipped - 33 lines]
> indirectly be causing the trustworthy bit to flip back off after it's be
> set on?
Ravi Patel - 14 Aug 2008 00:50 GMT
Hi,
Have you found any resolution to this issue? I am getting similar problem.
The error is same. However, in my case TRUSTWORTHY flag is true even though I
am getting this error.

I created assembly on my dev machine. I restored my database on a different
machine. That seems to be causing this error. I checked the .NET Framework
version. They are same in dev and test machines.

Do you have any clues?
thanks
ravi

> we run a distributed system involving many database servers. On each server,
> we have a database called Meta which has no tables, only some helper
[quoted text clipped - 32 lines]
> Has anyone seen anything like this before? Anyone know what might indirectly
> be causing the trustworthy bit to flip back off after it's be set on?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.