CREATE ASSEMBLY failed verification: Not enough storage is available to complete this operation
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.
[ : myProcSupp开发者_StackOverflow社区ort.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
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:
- Microsoft's confusing "Not enough..." error messages
- OCR SDK Knowledge Base
- Symantec Enterprise Vault forum
- MATLAB Newsgroup
- Not enough storage is available to complete this operation Error in Visual Studio 2008
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:
- Basics of SQL Server Memory Architecture (SQL Server 2005, 2008, and 2008 R2)
- SQL Server 2012 Memory (SQL Server 2012 and newer)
- Understanding the VAS Reservation (aka MemToLeave) in SQL Server
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.
精彩评论