Problem Description:
Customer is utilizing the SoftwarePackageManagementService ASDK page, CreatePackage method to create a software package and associate it to a software release.
Steps to Reproduce:
In addition, you can use the method to create a new package while still using the ACC. This only seems to happen when you use a software resource GUID to associate the software release to the software package.
Failed to construct DatabaseContext object. Connection to database failed. ( Unhandled exception. Type=Altiris.NS.Exceptions.DatabaseNotReadyException Msg=Failed to construct DatabaseContext object. Connection to database failed. Src=Altiris.NS
StackTrace=
at Altiris.NS.ContextManagement.AdminDatabaseContext.ThrowDatabaseNotReadyException(String exceptionDetails, Exception innerException)
at Altiris.Database.DatabaseContext`1.Initialize(Boolean beginTransaction, IsolationLevel isolationLevel)
at Altiris.Database.DatabaseContext`1.GetContext(ContextTransactionMode tmode, Nullable`1 isolationLevel, Boolean independentContext)
at Altiris.Resource.ResourceAssociations.LoadBulk(Guid resourceGuid, Boolean isParent, ICollection`1 resourceAssociationTypes, ItemLoadFlags resourceDataItemsLoadFlags)
at Altiris.Resource.ResourceData.InitialiseParentResourceAssociations()
at Altiris.Resource.ResourceData.get_ParentResourceAssociations()
at Altiris.SoftwareManagement.Resources.SoftwarePackageResource.get_SoftwareInstallationFiles()
at Altiris.SoftwareManagement.SoftwareManagementHelper.GenerateComponentKeys(Guid packageGuid, SoftwareComponentResource& SoftwareComponent)
at Altiris.SoftwareManagement.Resources.SoftwarePackageResource.PostCreatePackage(Guid guidPackage, SoftwareComponentResource& softwareResource, Boolean bGenerateCmdLines, Boolean bSoftwareResourceReadOnly)
at Altiris.SoftwareManagement.Resources.SoftwarePackageResource.PostCreatePackage(Guid guidPackage, Guid guidSoftwareResource, Boolean bGenerateCmdLines, Boolean bSoftwareResourceReadOnly)
at Altiris.ASDK.SMF.SoftwarePackageManagementLib.CreatePackage(String Name, String Description, Guid SoftwareResourceGuid, Int32 PackageSourceType, String PackageLocation, String PackageFolder, String InstallationFile, Boolean AutoGenerateCommandLines)
Inner exception. Type=Altiris.NS.Exceptions.AeXException Msg=Failed to open database connection. Current user is <ACC user name>. Error: Login failed for user '<ACC user name>'. Src=Altiris.NS StackTrace= at Altiris.NS.Utilities.DbUtils.OpenConnection(SqlConnection dbConn)
at Altiris.NS.Utilities.DbUtils.CreateConnection(String server, String catalog, String user, String password)
at Altiris.NS.ContextManagement.AdminDatabaseContext.OpenDbConnection()
at Altiris.Database.DatabaseContext`1.Initialize(Boolean beginTransaction, IsolationLevel isolationLevel)
Inner exception. Type=System.Data.SqlClient.SqlException Msg=Login failed for user 'MS\stg_altacc1'. Src=.Net SqlClient Data Provider StackTrace= at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Altiris.NS.Utilities.DbUtils.OpenConnection(SqlConnection dbConn) )
**CEDUrlStart** :http://entced.symantec.com/entt?product=SMP&version=7.6.1383.0&language=en&module=66+T9+RCgs2Jzf6H1yCL/ajzdk7JdnsWkuADfqwM9mmNRrQza4rDRSOcA70HCBvW&error=-1591251261&build=**CEDUrlEnd**
-----------------------------------------------------------------------------------------------------
Date: 10/28/2015 4:08:19 PM, Tick Count: 890824755 (10.07:27:04.7550000), Host Name: xxxxxxx, Size: 6.69 KB
Process: w3wp (11904), Thread ID: 439, Module: w3wp.exe
Priority: 1, Source: Altiris.ASDK.SMF.Web.SoftwarePackageManagementService.CreatePackage
File: E:\Program Files\Altiris\Notification Server\Logs\a.log
Unknown
We have specific user who has rights to access package source locations (especially UNC), but in this case user has no rights to modify NS items.
Fixed by moving impersonation block to affect only file system operations,
None at this time..
This has been referred to our Developers for review
Fixed in:
ETrack 3877145 - 7.6 HF7
ETrack 3879514 - 7.6 no HF
ETrack 3877284 - 8.0