Sitecore / Sitecore.Demo.Retail

Sitecore Commerce Demo
12 stars 15 forks source link

User „CSFndRuntimeUser“ can't connect MS SQL during install-commerce-server.ps1 runtime #79

Closed lanspeed closed 6 years ago

lanspeed commented 7 years ago

The created User „CSFndRuntimeUser“ for the Sitecore Commerce Installation has the locale Admin-Rights and all MS SQL Server rights, But the installation fails regarding database connection and rights (please see below).

Step 2: Create Database Logins Get-SqlLogin : Error: The following exception occurred while trying to enumerate the collection: "Failed to connect to server ..". - Line Number: 372 At C:\projects\Sitecore.Demo.Retail\Scripts\Commerce\ManageSqlServer.psm1:425 char:19

Invoke-Sqlcmd : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) At C:\projects\Sitecore.Demo.Retail\Scripts\Commerce\ManageSqlServer.psm1:428 char:13

Invoke-Sqlcmd : At C:\projects\Sitecore.Demo.Retail\Scripts\Commerce\ManageSqlServer.psm1:428 char:13

15:52:15 INFO] Loading XML file: C:\Projects\Sitecore.Demo.Retail\Install\csconfig.xml. [15:52:15 INFO] Beginning validation of feature Administration Database (Feature.MS.CS.Admin). [15:52:30 ERROR] Error occured during validation of feature Administration Database (Feature.MS.CS.Admin). [15:52:30 ERROR] Exception occured during feature validation: CommerceServer.Core.Internal.Config.ValidationException: Unable to connect to the specified database. Please make sure of the following settings: The server name is a computer running Microsoft SQL Server. The server is accessible from this computer. You have permissions to connect to the server and the database. If the database does not exist and you want to create it, you need 'System Administrator' privileges on the server.

Error Summary: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception: The system cannot find the file specified --- End of inner exception stack trace --- at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling) 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, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at CommerceServer.Core.Internal.Config.DBConfig.DatabaseExists(String connectionStringToMaster, String dbName) --- End of inner exception stack trace --- at CommerceServer.Core.Internal.Config.DBConfig.DatabaseExists(String connectionStringToMaster, String dbName) at CommerceServer.Core.Internal.Config.AdminConfig.Validate(Boolean interactive) at CommerceServer.Core.Internal.Config.ConfigurationDriver.Validate(FeatureConfig feature). [15:52:30 INFO] CSConfig Application exit - Exit Code 1.

jflsitecore commented 7 years ago

Have you modified any of the defaults in the config.json file? Install-commerce-server.ps1 should by default create a user called HabitatRuntimeUser and add it to the Administrators group.

Also ensure you're running the script with administrative privileges