1

I have a small application that uses SQL Server 2005 Express with CLR stored procedures. It has been successfully installed and runs on many computers running XP and Vista.

To create the assembly the following SQL is executed (names changed to protect the innocent):

CREATE ASSEMBLY myAssemblyName FROM 'C:\PathToAssembly\myAssembly.dll

On one computer (a test machine that reflects other computers targeted for installation) that is running Vista and has some very aggressive security policy restrictions, I receive the following error:

Msg 6218, Level 16, State 2, Server domain\servername, Line 2
CREATE ASSEMBLY for assembly 'myAssembly' failed because assembly 'myAssembly' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message

[ : myProcSupport.Axis::Proc1][mdToken=0x6000004] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc2][mdToken=0x6000005] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc3][mdToken=0x6000006] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::.ctor][mdToken=0x600000a] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc4][mdToken=0x6000001] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc5][mdToken=0x6000002] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc6][mdToken=0x6000007] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc7][mdToken=0x6000008] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc8][mdToken=0x6000009] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc8][mdToken=0x600000b] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation.

[ : myProcSupport.Axis::Proc9][mdToken=0x600000c] [HRESULT 0x8007000E] - Not enough storage is available to complete this operation....

The C# DLL is defined as SAFE as it only uses data contained in the database. The DLL is not normally signed, but I provided a signed version to test and received the same results.

The installation is being done by someone else, and I don’t have access to the box, but they are executing scripts that I provided and work on other computers.

I have tried to find information about this error beyond what the results of the script provide, but I haven’t found anything helpful.

The person executing the script to create the assembly is logged in with an Admin account, is running CMD as admin, is connecting to the DB via Windows Authentication, has been added to the dbo_owner role, and added to the server role SysAdmin with the hopes that it is a permissions issue. This hasn't changed anything.

Do I need to configure SQL Server 2005 Express differently for this environment?

Is this error logged anywhere other than just the output from SQLCMD? What could cause this error? Could Vista security policies cause this?

I don’t have access to the computer (the customer is doing the testing) so I can’t examine the box myself.

TIA

Solomon Rutzky
  • 46,688
  • 9
  • 128
  • 171
  • 1
    `Not enough storage is available to complete this operation.` Is your SQL Server low on disk space by any chance?? – marc_s Jun 03 '10 at 16:24
  • No, it is a newly imaged machine with many gigs of available hard drive space. The first thing installed is SQL Server 2005 Express. When the database is created two gigs are pre-allocated for growth. The assembly that fails to install is 52KB. My sense was that the 'not enough storage space' was a residual error from the 'failed verification'. – turnip_cyberveggie Jun 03 '10 at 20:40
  • All those references to "myProcSupport", is that the actual reference or were you protecting more innocents? How much memory does the server have, and is SQL perhaps configured to not use it all? – Philip Kelley Jun 07 '12 at 14:02
  • Have you tried: `WITH permission_set = UNSAFE` – Joshua Drake Sep 11 '13 at 20:07
  • Hey, did you ever get this solved? I realize that being 5 years old a lot has probably changed and this client might not be a client anymore, but I figured even if this is not an issue anymore, others might run into this and so it might be helpful to still try to solve it :-). Also, @marc_s , the message about "storage" is referring to memory and not disk space. – Solomon Rutzky Aug 16 '15 at 22:11

1 Answers1

1

If this code works as SAFE on the other servers, then I would first check to make sure that .NET is installed to the correct version (including updates). It could also be that there is a problem with one of the .NET DLLs and it needs to be repaired.

Regarding the following error message:

Not enough storage is available to complete this operation.

that is actually an "out of memory" error (code = ERROR_OUTOFMEMORY): either not having enough OR not having permission (somehow) to use it, or no available file handles, etc.

Other mentions of this error:

So if this problem is really memory related, then it would likely be related to:

  • How much physical memory is in the server
  • What version of SQL Server (changes were made starting in SQL Server 2012). This question regarded SQL Server 2005, but others might encounter this who are on a different version. In 32-bit SQL Server 2005, SQL CLR AppDomains are managed in the "MemToLeave" area, which is not huge (please see link below)
  • Is this 32-bit or 64-bit SQL Server? If 32-bit SQL Server, is it running on 32-bit or 64-bit Windows?
  • If 32-bit SQL Server on 32-bit, is the /3GB switch being used?
  • Here are some resources to learn more about SQL Server and memory:

If the configuration of the server with the error is the same as machines that are not getting the error:

  • same amount of memory
  • same 32-bit vs 64-bit OS
  • same 32-bit vs 64-bit SQL Server
  • same memory settings for SQL Server
  • same non-SQL Server programs running on the OS
  • same amount of disk free space that can be used for virtual memory, etc)
  • etc....

then if the security setup of the machine that is not working is different, you need to check the "Log On As" account for the SQL Server NT Service. Is it a local system account? Is it a local login? Is it a domain login? If the issue is related to the security setup, then this is where I would start looking. If the service is using a local system account, try using a local or domain login (which is a better practice anyway). If the login is already a local or domain user, then check how the security policies affect both that user and any Windows Groups that the login is a member of.

Solomon Rutzky
  • 46,688
  • 9
  • 128
  • 171
  • Thanks srutzky... this procedure isn't used anymore. I don't remember what the resolution was. I'll check my notes (email) and see if I can figure out what became of this issue. My guess is that the computer that was having the problem was replaced with one that didn't and the real cause was never found. – turnip_cyberveggie Aug 26 '15 at 00:33
  • @turnip_cyberveggie Yeah, I figured that after 5 years it would be difficult to confirm one way or the other, but if you are able to find anything in your notes that would be quite helpful to others that might come across this. In either case, I at least was able to add some info to the issue to point in a direction that should help anyone else (i.e. that this is a memory, not disk, issue, though that might not be the root cause). – Solomon Rutzky Aug 26 '15 at 00:52