Unable to install TFS2018 with Sql Server 2016 SP1 - sql-server

I am setting up my development environment for TFS2018 with SQL Server 2016 , i have already installed the following :-
sql server 2016 sp1. [ServerDB]
ServerDB\MSSQLTFS2017 ===>>> Exting Instance for TFS2017
ServerDB\MSSQLTFS2018 ===>>> New Instanct for TFS2018
ServerDB\Administrator for install DB
TFS2018 [ServerApp]
ServerApp\Administrator for install TFS (connect to ServerDB\MSSQLTFS2018)
But during my TFS2018 installation i am getting the following errors:-
TF255507: The security identifier (SID) for the following SQL Server login conflicts with a specified domain or workgroup account: ServerDB\Administrator. The domain or workgroup account is: SIAM-TFD-03\Administrator. The server selected to host the databases for Team Foundation Server is: SIAM-DBS-06\MSSQLTFS2018.
You can resolve this issue by renaming the conflicting login. To do so, open a command prompt on the computer that is running SQL Server and execute the following command:
sqlcmd -E -S "ServerDB\MSSQLTFS2018" -Q "ALTER LOGIN [ServerDB\Administrator] WITH NAME = [ServerApp\Administrator]"
Result after exceute cmd above:
Msg 15401, Level 16, State 1, Server ServerDB\MSSQLTFS2018, Line 1
Windows NT user or group 'ServerApp\Administrator' not found. Check the name again.

You could login SSMS to check whether the account ServerApp\Administrator has been added to instance ServerDB\MSSQLTFS2018. Add it manually if it is not there:
Also, you could check the solutions in this blog to see whether it helps you:
https://stepbistep.net/2013/03/04/tf255507-the-security-identifier-sid-for-the-following-sql-server-login-conflicts-with-a-specified-domain-or-workgroup-account/

I try this way and it work.
On [ServerDB]
- I create user domain\tfsuser on MSSQL
On [ServerApp]
- I login with user domain\tfsuser and Reinstall TFS with user domain\tfsuser
Installation completed.

Related

Clickonce installer installing SQL Server 2016 Express fails with errorcode -2061893613, what does error code -2061893613 mean?

ClickOnce install with integrated SQL Server Express install fails with error code -2061893613 and the following in the log:
Result of checks for command 'SqlExpress2016\BOOTSTRAP.EXE' is 'Install'
'SQL Server 2016 Express - xxxxxx' RunCheck result: Install Needed
Verifying file integrity of C:\Users\xxxxx\AppData\Local\Temp\VSD7E54.tmp\SqlExpress2016\BOOTSTRAP.EXE
Verifying file hash
Installing using command 'C:\Users\xxxxxxx\AppData\Local\Temp\VSD7E54.tmp\SqlExpress2016\BOOTSTRAP.EXE' and parameters '/ACTION=Install ........'
Process exited with code -2061893613
Status of package 'SQL Server 2016 Express - xxxxx' after install is 'InstallFailed'
I had this issue on a SQL 2014. Challenge was that the SQL install was a prerequisite of an application that had a hard coded sa password that could not be easily changed.
The work around was to do a manual install of SQL and give sa a password that matched the policy. Once installed I could go into SSMS and change the properties on the sa account so it would not enforce password policy (open security folder, logins and right click on sa and select properties) by unchecking the box. Then change the password to the one the application install uses.
Yes, the next version of the application will not only use a stronger password, but will also be using an up to date version of SQL.
;TLDR, company had a policy with password strength requirements that weren't met with the default SA password used in the installation script.
Got the log files from "C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log" on the failing machine and it was a dead giveaway in Summary.txt:
Overall summary:
Final result: Failed: see details below
Exit code (Decimal): -2061893613
Exit facility code: 1306
Exit error code: 19
Exit message: The specified sa password does not meet strong password requirements. For more information about strong password requirements, see "Database Engine Configuration - Account Provisioning" in Setup Help or in %SQL_PRODUCT_SHORT_NAME% Books Online.

TF400711: Error occurred while executing servicing step 'Ensure initial catalog data exists' for component InstallFrameworkApplication during Install

I'm trying to upgrade/install TFS 2017 over TFS 2015 update4. I've got SQL server 2016 installed.
TFS 2017 installed successfully and while trying to Create Team Project collection through TFS Administration console, i got the error as below
TF400711: Error occurred while executing servicing step 'Ensure
initial catalog data exists' for component InstallFrameworkApplication
during Install
TF30040: The database is not correctly configured. Contact your Team
Foundation Server administrator.. For more information, see the
configuration log.
Note: I've deleted the previous exiting TFS database and re-tried, still the error exits. Please suggest a solution
First, suggest you to check the Event Eview on TFS server, if there are some more error info for troubleshooting.
If your process of upgrading to Team Foundation Server (TFS) 2017 has been succeed( Double check this blog, if you have any thing missed). The error occurs during the usage of Team Project Collection Creation through Administration Console.
You could try to use below solution: add yourself as a sysadmin by starting SQL Server in single user mode follow below steps:
1. Open the Configuration Manager tool from the "SQL Server 2016| Configuration" menu
2. Stop the SQL Server Instance you need to recover
3. Navigate to the “Advanced” tab, and in the Properties text box add “;–m” to the end of the list in the “Startup parameters” option
4. Click the “OK” button and restart the SQL Server Instance
NOTE: make sure there is no space between “;” and “-m”, the registry parameter parser is sensitive to such typos. You should see
an entry in the SQL Server ERRORLOG file that says “SQL Server started
in single-user mode.”
5. After the SQL Server Instance starts in single-user mode, the Windows Administrator account is able to connect to SQL Server using
the sqlcmd utility using Windows authentication. You can use
Transact-SQL commands such as "sp_addsrvrolemember" to add an existing
login (or a newly created one) to the sysadmin server role. The
following example adds the account "Buck" in the "CONTOSO" domain to
the SQL Server "sysadmin" role:
EXEC sp_addsrvrolemember 'CONTOSO\Buck', 'sysadmin'; GO
6. Once the sysadmin access has been recovered, remove the “;-m” from the startup parameters using the Configuration Manager and
restart the SQL Server Instance
More details please refer this answer of a similar issue.

How to recreate SQL Server MSSQLServer windows user for a SQL Server 2014 SP1 installation

I had a new machine which windows crashed and I had to do a Windows reset which reinstalled Windows. Afterwards I deleted the old app user accounts in the C:\Users folder since the reinstall didn't delete it, these included SQL Server MSSQLServer and .net accounts because I was going to install all the apps from scratch I decided to clear it up and delete it.
I then ran SQL Server 2014 SP1 setup selecting database engine, client connectivity and Management Studio on default instance MSSQLServer
using mixed mode authentication and added my own sa password and my current windows user.
At the end of my installation I notice the installer takes a very long time at the following step
SqlEngineDBStartConfigAction_install_configrc_Cpu64
I then get an error
The following error occurred:
Could not find the Database Engine startup handle.
Logs
Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A0019
Error description: Could not find the Database Engine startup handle.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.4100.1&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4025&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4025
I open SQL Server configuration manager Services and noticed my MSSQLServer doesn't start up because it runs as NT Service\MSSQLSERVER user. I change that to local system account and start the service and the service runs.
However when I open SQL Server Management Studio and try to connect to the database engine I can't connect with neither my windows user I added during the SQL Server setup nor the sa user with password I specified.
Cannot connect to PCName. Login failed for user PCName\User. Microsoft SQL Server Error 18456
When I uninstall SQL Server and reinstall it I get the same issue. Even when I delete the program files directory C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER
How do I get it to work?
Why does a new SQL Server 2014 SP1 installation not create the MSSQLServer user?
How to I create the MSSQLServer user manually and what permissions and groups do I assign to it?
I tried everything to resolve it. Delete all the SQL Server folders. Remove registry entries as mentioned in other stackoverlow answers. Installed SQL Server 2014 SP1 again and the problem still occurs.
Even when I installed SQL Server 2012 SP1 on the default instance I would still get the error.
The only workaround I could get it to work was to install SQL Server as a separate instance and not the default instance.
This made me thinking if the issue is only related to the default instance.
I looked at my C:\Users folder and the default instance MSSQL user folder was not there meaning the installer never created it. The problem must have occurred that I previously deleted the User folder to clean up the machine where I should have deleted the windows users from Control Panel Admin Tools instead.
Solution: Use regedit.exe
The problem entry should be the corresponding S Folder in.
HKEY_LOCAL_MACHINE - SOFTWARE - Microsoft -Windows NT -CurrentVersion -ProfileList
Delete this user
Reinstall and verify in the C:\Users if the MSSQL user gets created.
I tried to be safe and deleted all references to the MSSQL user in the registry user after uninstalling all SQL Server references in Add/Remove Programs and clearing up the Program Files folders the one registry item is probably the cause.
This solution helped me to fix the issue.
I had deleted MSSQLServer and SQLAgent account while cleanup of SQLServer2016, but then MSSQLServer 2016 installer wasn't getting re-installed, reason being it could not create the service account, and my application is limited to support "only default SQL instance"
I have followed this and deleted the REG entries and this helped me to reinstall SQL Server smoothly.
Thank you so much .
Solution: Use regedit.exe
The problem entry should be the corresponding S Folder in.
HKEY_LOCAL_MACHINE - SOFTWARE - Microsoft -Windows NT -CurrentVersion -ProfileList

Why can't I connect to a SQL Server 2012 LocalDB shared instance?

I'm trying to set up a SQL Server 2012 LocalDB (RTM, x64) shared instance on my Windows 7 x64 machine and I can't seem to connect to the shared instance. I'm using an Administrator command prompt for all of the setup. Here's how I'm creating the instance:
sqllocaldb create MyInstance
Which yields the response:
LocalDB instance "MyInstance" created with version 11.0.
So far so good. Now I share the instance:
sqllocaldb share "MyInstance" "MySharedInstance"
Which results in:
Private LocalDB instance "MyInstance" shared with the shared name: "MySharedInstance".
Still looking good. At this point, I the info command yields:
.\MySharedInstance
MyInstance
v11.0
Connecting to the instance from the owner account (which is an admin) using both an admin or non-admin command prompt seems to work fine. Things come off the tracks, though, when I log in as a regular user (not a windows admin) and try to connect:
sqlcmd -S (localdb)\.\MySharedInstance
results in:
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [2]. .
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
Increasing the login timeout using the "-l" switch does not help. I can connect to the default v11.0 instance, which is not shared. The info command for the non-admin user yields the same as above except withouth "MyInstance" since it's a named instance owned by the admin user. The following command (which works for the admin user/instance owner):
sqllocaldb info ".\MySharedInstance"
also results in an error:
Windows API call "FileTimeToSystemTime" returned error code: -2147024809.
So the question is why can't my non-admin user connect to my shared instance? This seems to defeat the whole purpose of shared instances. And what's with the "sqllocaldb info" command throwing an error when I try to query about the shared instance?
ANOTHER EDIT
Cory, if you have previous versions of SQL Server installed (e.g. 2008), that is the version of sqlcmd you are using. In order to connect to LocalDb you need to be using the SQL Server 2012 version of sqlcmd. So your instructions to your users must ensure that they use the SQL Server 2012 version by running:
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd -S "(localdb)\.\InstanceName"
This worked for me. What I haven't verified is whether this path and version of sqlcmd is available to users who have only installed the sqllocaldb.msi. Sorry but I don't have any naked machines without SQL Server 2012 installed (or with only previous versions installed) to try this out thoroughly. But please let me know if explicitly calling the 110 version of sqlcmd does the trick.
I think you may also be able to instruct users to alter their system variables so that the 110 versions come first (which IMHO should be the case automatically).
The FileTimeToSystemTime has been confirmed as a bug by one of Krzysztof's co-workers. So there is still no fix that I know of for non-owners to connect via sqllocaldb. But I've shown that both SSMS and sqlcmd can be made to work, so I hope that gets you closer to running.
EDIT
You need to add any non-owner users to the instance, e.g. CREATE LOGIN [MyDomain\OtherUser] FROM WINDOWS; and any appropriate permissions as well. In my test login was failing and generating the wrong error message (the "FileTimeToSystemTime" error message is a bug). You also need to GRANT CONNECT. Once you do this, you will be able to connect from the second user using Management Studio with this connection (the only one I tried):
(localdb)\.\MySharedInstance
But from sqlcmd, I still I get an error no matter how I try to connect:
sqlcmd -S "(localdb)\.\MySharedInstance"
sqlcmd -S ".\MySharedInstance"
sqlcmd -S "(localdb)\MySharedInstance"
sqlcmd -S "GREENHORNET\MySharedInstance"
sqlcmd -S ".\LOCALDB#SH04FF8A"
sqlcmd -S "GREENHORNET\LOCALDB#SH04FF8A"
All yield:
HResult 0xFFFFFFFF, Level 16, State 1 SQL Server Network Interfaces:
Error Locating Server/Instance Specified [xFFFFFFFF].
Sqlcmd: Error:
Microsoft SQL Server Native Client 10.0 : A network-related or
instance-specific error has occurred while establishing a connection
to SQL Server. Server is not found or not accessible. Check if
instance name is correct and if SQL Server is configured to allow
remote connections. For more information see SQL Server Books Online..
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout
expired.
Though I have verified that the instance is set to accept remote connections. So there is some other hoop that sqlcmd must be going through.
And regarding the sqllocaldb exe, how does this follow any logic? I can see the instance is there via info, I get a proper error message when I try to stop it, I get a message that it is [already] started when I try to start it, but I can't connect to it?
So unless you need sqlcmd access, in the short term I would have the secondary users do their thing with SSMS (once you've granted adequate permissions) and hopefully Krzysztof will have more info on the other items.
Regarding the 4.0.2 update, from http://connect.microsoft.com/SQLServer/feedback/details/723737/smo-cant-connect-to-localdb-instances:
We made an explicit decision not to include .NET Framework 4.0.2 in
LocalDB installer. Installing the .NET Framework update would increase
the size of the LocalDB installer and cause a likely reboot. Since
LocalDB is built to be independent of the .NET, we didn’t think we
should take this cost for every LocalDB installation. Future .NET
versions (including .NET 4.5, now in CTP) will support LocalDB out of
the box. Some developers may also want to opt in for ODBC, PHP
Driver/PDO, and probably JDBC in the future. Those developers will not
be interested in updating .NET.
As the original post suggested, this wasn't as straight forward as anticipated, but I was eventually able to connect via the named pipe.
THIS ANSWER ASSUMES DELETING THE INSTANCE IS OK.
ie: all your data will be gone and that is okay.
I was having the same problem, after upgrading my SSMS.
sqllocaldb i
.\MyCustomInstance
sqllocaldb d
LocalDb instance ".\MyCustomInstance" does not exist!
sqllocaldb i .\MyCustomInstance
Windows API call "FileTimeToSystemTime" returned error code: -2147024809.
In order to get rid of the offending instance I had to create another MyCustomInstance which I guess will overwrite what's already there, and now you can delete it
sqllocaldb c MyCustomInstance
LocalDB instance "MyCustomInstance" created with version 11.0.
sqllocaldb d .\MyCustomInstance
LocalDB instance ".\Octopus" deleted.
Then, start the instance and share it.
Imperative you start the instance first.
sqllocaldb s MyCustomInstance
LocalDB instance "MyCustomInstance" started.
sqllocaldb h MyCustomInstance MyCustomInstance
Private LocalDB instance "MyCustomInstance" shared with the shared name: "MyCustomInstance".
Now, when you need to connect, you connect with (localdb)\.\MyCustomInstance
Install the full .NET framework 4.5.2 or later, then reboot, you should then be able to connect using:
sqlcmd -S (localdb)\.\MySharedInstance
I have found that named pipes generate a new hash when the machine is rebooted, the named shared instance will persist after reboots.
Important to note it won't work until after a reboot.
The problem is you need to quote the db name:
sqlcmd -S "(localdb)\.\MySharedInstance"

How can I reset username and password for SQL Server 2008

Shortly after I installed MS SQL Server 2008 on my machine, I forgot the password AND username that I chose. How can I reset them?
This question seems promising, but it didn't work for me.
When I tried exec sp_password #new='changeme', #loginame='sa' as a query, I received:
Msg 15151, Level 16, State 1, Line 1
Cannot alter the login 'sa', because it does not exist or you do not have permission.
Try following the instructions from this blog post entitled Disaster Recovery: What to do when the SA account password is lost in SQL Server 2005. It applies to SQL Server 2005, but should probably work with SQL Server 2008 as well.
You need to start SQL Server in single user mode using the -m command line switch. When SQL Server has started, a Windows administrator can connect to SQL Server using Windows authentication. You can then reset the password of the sa user. Make sure to restart SQL Server without the -m command line parameter afterwards.
Login as a Local or Domain Admins and just try to connect using "Windows Authentication".
If you don't have other SysAdmin privilege login - you have nothing but reinstall it.
Otherwise use it to change password.

Resources