chucknorris / roundhouse

RoundhousE is a Database Migration Utility for .NET using sql files and versioning based on source control
http://projectroundhouse.org
916 stars 249 forks source link

TeamCity error : roundhouse.databases.sqlserver.SqlServerDatabase with provider System.Data.SqlClient does not provide a facility for creating a database at this time. #387

Closed jgrandydev closed 4 years ago

jgrandydev commented 4 years ago

.NET Core 2.2.0

No problems running locally. However in TeamCity when run postBuild.cmd receive error :

[14:03:38]
[Step 2/11] Creating MY_DATABASE database on localhost server if it doesn't exist.
[14:03:52]
[Step 2/11] roundhouse.databases.sqlserver.SqlServerDatabase with provider System.Data.SqlClient does not provide a facility for creating a database at this time.

TeamCity Build Agent Service Account has been permissioned SA on the target SQL Server.

erikbra commented 4 years ago

Are you running against SQL Azure, by any chance? I don't think RoundhousE can create a database in SQL Azure automatically (I'm not sure why, haven't looked into it).

jgrandydev commented 4 years ago

No this is not SQL Azure. This is SQL Server 2012 and SQL Server 2016 installed on standalone servers.

jgrandydev commented 4 years ago

Now I am seeing this same error in my local builds. Apparently RoundhousE is unable to create database if it does not exist. What are some possible reasons ?

  Creating MyDatabase database on localhost server if it doesn't exist.
1>  roundhouse.databases.sqlserver.SqlServerDatabase with provider System.Data.SqlClient does not provide a facility for creating a database at this time.
1>  System.Data.SqlClient.SqlException (0x80131904): 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 (0x80004005): The system cannot find the file specified
1> 
chakalakonda commented 4 years ago

Is the SQL Server instance running? Is the Named Pipes Protocol enabled in the SQL Server configuration?

erikbra commented 4 years ago

This looks like an error with your local environment, check that the connection string is correct. Re the error message:

System.Data.SqlClient.SqlException (0x80131904): 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 (0x80004005): The system cannot find the file specified