Difference between revisions of "User:Allan Smith/sandbox"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(Undo revision 8709 by Allan Smith (Talk))
(cleaning up the sandbox starting fresh again)
Line 1: Line 1:
[[Image:unable to connect to database.png|right]]
+
Note:If you were looking here for unable to connect issues, I have moved it all out of my sandbox into a real page located at [[Unable to connect to the database]]
When the toolset throws this error, it indicates that there was some kind of problem when attempting to connect to the SQL Server Express 2005 database. Unfortunately, this is common, but unpredictable. When the toolset starts up, it attempts to connect to the database.  If the database does not respond, it simply returns this error. The toolset has no ability to diagnose why 
+
  
This error is kind of like the "Service Engine" light on your vehicle.  When the service engine light starts flashing, it means something is wrong, but it is a very general warning that does not give you much information on what is wrong, just that something is wrong.  The cause of it could be anything from a loose gas cap to a failed spark plug to some bad sensor.
 
  
__NOTOC__
+
==Big Hammer Approach==
{| cellspacing = "5" cellpadding = "2" align="center" class="toc"
+
Manual database installation works almost every time. If it does not, it at least should give you clues as to why it is failing.  If this error is frustrating you and you want to just make it work, it is your best bet:
|- align="center"
+
| style="border:solid 1px" | [[#Did the database get restored?|Did the database get restored?]]
+
| No<br/>&rarr;
+
| style="border:solid 1px" | [[#Did SQL Server Install?|Did MSSQL Express install?]]
+
| No<br/>&rarr;
+
| style="border:solid 1px" align="left" | Possible solutions:
+
# Permissions issues: run installer as administrator
+
# Path length
+
# Compressed drive
+
|- align="center"
+
| Yes<br/> &darr;
+
|
+
| Yes<br/> &darr;
+
|- align="center"
+
| style="border:solid 1px" | [[#Is the Database Service Running|Is the database service running?]]
+
|
+
| style="border:solid 1px" | [[Database backup and restore|Restore database and re-run toolset]]
+
|- align="center"
+
|
+
{| cellspacing = "5" cellpadding = "2" align="center" style="background-color:transparent"
+
|- align="center"
+
| Yes<br/>&darr;
+
| No<br/>&darr;
+
|- align="center"
+
| style="border:solid 1px" | [[#Are the Registry Settings correct|Are the Registry Settings correct?]]
+
| style="border:solid 1px" | Start service and re-run toolset
+
|}
+
|
+
|
+
|}
+
  
==Diagnosing the Problem==
+
Do a toolset install with "Install MS SQL Express 2005 SP3" unchecked, as well as "Restore the default database. Existing DA toolset databases will be overwritten" unchecked, as shown here:
When it comes to the cannot connect error, it can range from the long file path issue to interference from UAC, to permissions issues, to a conflict with an existing installation of SQL Server, to registry entries, to the location of the installation file on your computer. The list is long. Here is a troubleshooting guide to try and help you diagnose what particular problem is vexing you and how to repair it.
+
  
===Is the Database Service Running===
+
[[Image:Toolset setup screen.png]]
 +
This will just install the toolset files not install, restore or configure a database at all.  Of course, since SQL Server is not installed, you will still get the "Unable to to connect to the database" error.
  
If the service is running, it is an indication that SQL Server has installed correctly and the database is available for use by the toolset.
+
Now, manually install SQL Server and restore the database.  It is not as hard as it may sound, and is documented [[manual database installation|here]].  Basically, when you do this, you are taking the last two big steps away from the toolset installer, and doing them on your own. The reason that this is effective is that this way you can babysit the installation process.  Running the SQL installer this way will throw more explicit errors at you when it is having problems, making it easier to diagnose
  
You can check to see if the Database Service is running by navigating to your the Services application.  Depending on your operating system, the path may be a bit different, but it should be along the lines of <code>Start>>Control Panel>>Administrative Tools>>Services<\code>(alternately type "services.msc" (excluding quotes) into a run window)
 
  
Scroll down through the list and look for a service named "SQL Server (BWDATOOLSET)".  Check the Status of the service.  If the status is anything other than "Started" right click on it and select "Start".  If it then starts successfully the status will change to "Started"
+
Background:
 
+
The toolset needs a database engine to runThe installer has a copy of SQL Server 2005 embedded in it.  When the toolset has finished doing its business (essentially unpacking some files and setting up some permissions for and creating necessary registry entries) it then runs the SQL Server 2005 (3rd party software)in "silent" mode, where it just tries to install with its own set of default settingsThe toolset installer is "blind" to what goes on during the SQL install, it just gets a message when the SQL installer says "I'm done", regardless of what kind of "done" that is. It could be "I just failed horribly, but I'm done failing now" or it could be "Whew, everything went as planned, I'm done". Once the toolset installer gets that message, it says "SQL is done, so I guess I'm done now too".
If the Service refuses to Start or does not exist, more troubleshooting is needed some kind of installation issue with SQL ServerWe need to look at the properties on the service and figure out where to go from here.  One thing I have seen is that it is left over from some manual file deletions,  the .mdf and .ldf files no longer exist, but the service is still there.  Path to executable field may hold some clues. here.
+
 
+
* Ensure SQL Server (BWDATOOLSET): Open the '''SQL Server Configuration Manager''' (by default <code>Start | Microsoft SQL Server 2005 | Configuration Tools | SQL Server Configuration Manager</code>) and in the object tree in the left hand panel click on the '''SQL Server 2005 Services''' entry. Ensure entry for '''SQL Server (BWDATOOLSET)''' appearing in the right hand panel has a '''State''' of '''Running'''.  If not select it and start it (either using the button on the toolbar or the option in the context menu).
+
 
+
[[#top|&uarr; Return to top]]
+
 
+
===Did SQL Server Install?===
+
Check your Start menu and see if it installed at allGo to Start>>Program Files>>Microsoft SQL Server 2005.  If nothing exists here then there are two basic explanations:
+
# When you ran the installer, you may have unchecked the option to Install MSSQL Express 2005 SP3.  If this is the case.  Try running the toolset installer a second time, make sure that you leave that option checked so that the installer will attempt to install SQL Server 2005.
+
# Something went wrong with the SQL Server installation and it failed to install at all.  You can try installing the toolset again.  If this is unsuccessful, you can try downloading and installing it [[Manual database installation|manually]].
+
 
+
[[#top|&uarr; Return to top]]
+
 
+
===Did the database get restored?===
+
Check the toolset installation directory for the restored database files.  Depending on where you installed the Game and Toolset, they will be in a location similar to
+
C:\Program Files\Dragon Age\tools\toolssql\Data\
+
Browse to this location and look for the existence of the following two files:
+
bw_dragonage_content.ldf
+
  and
+
bw_dragonage_content.mdf
+
 
+
If these files exist, it indicates that the SQL Server was installed, and that the actual Dragon Age toolset database was restored.  If they are not present, the restore function failed for some reason.  If the files exist, continue on to the next step of the troubleshooter.
+
 
+
If the files do not exist, you can attempt to restore them in a number of ways:
+
# Running the restore operation through a command line.You can enter the following command to try restoring the database manually (Change the paths to <code>bw_dragonage_content.bak</code> and your Dragon Age folder as appropriate): <code>"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\"sqlcmd -S .\BWDATOOLSET -E -Q "RESTORE DATABASE bw_dragonage_content FROM DISK = 'C:\Program Files\Dragon Age\tools\dbbak\bw_dragonage_content.bak' WITH MOVE 'bw_dragonage_content' TO 'C:\Program Files\Dragon Age\tools\toolssql\Data\bw_dragonage_content.mdf', MOVE 'bw_dragonage_content_Log' TO 'C:\Program Files\Dragon Age\tools\toolssql\Data\bw_dragonage_content.ldf'"</code>
+
# Use SQL Management Studio to create the database and restore the content databaseThis is covered in the [[Manual database installation|manual database installation]] article.  Since the SQL Server is installed, you should be able to skip the first step, and start from the heading "Installing SQL Server Management Studio Express"
+
#Use the [[Database backup and restore|database restore]] batch file to attempt to restore the database.  These batch files are functional, but stumble on filepaths with spaces in their current incarnation.
+
 
+
[[#top|&uarr; Return to top]]
+
 
+
===Are the Registry Settings correct===
+
need to put the proper text in here still, need to dig it up
+
 
+
*Its been observed that for some builds that the Toolset is not looking at the correct registry keys perhaps due to permission restrictions. 
+
*#First use the ConfigureToolset to set the correct string.
+
*#:If you don't use the default settings you can copy the string from from the ConfigureToolset tool otherwise use one of the following command line queries to get the connection string.
+
*#:''Win32:'' <code>reg query "HKLM\SOFTWARE\BioWare\Dragon Age\Toolset\Environment" /v DefaultDatabaseConnection</code>
+
*#:''Win64:'' <code>reg query "HKLM\SOFTWARE\Wow6432Node\BioWare\Dragon Age\Toolset\Environment" /v DefaultDatabaseConnection</code>
+
*#Now run the following command line (substituting your connection string for the final value)
+
*#:<code>reg add "HKCU\Software\BioWare\Dragon Age\Toolset\Environment" /v DefaultDatabaseConnection /t REG_SZ /d "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bw_dragonage_content;Data Source=.\BWDATOOLSET"</code>
+
:Double check your entry, a single incorrect character will cause the same "Unable to Connect" error.
+
 
+
[[#top|&uarr; Return to top]]
+
 
+
==Additional ideas==
+
 
+
=== MSSQL Server cannot install to compressed or encrypted folders ===
+
SQL Server Setup cannot install files.
+
 
+
Product: Microsoft SQL Server 2005 -- Error 28062. SQL Server Setup cannot install files to the compressed or encrypted folder: X:\. To continue, make sure that your installation directories are not compressed or encrypted, or specify a different directory, and then run SQL Server Setup again.
+
 
+
Cause.
+
SQL Server 2005 program files and data files cannot be installed on a file system that uses compression.
+
 
+
Solution.
+
You need to uncompressed the drives or folders where the SQL Server 2005 program files and data files will be placed. Please follow the steps below:
+
# From your Windows Explorer, navigate to the path where the SQL Server program files and data files will be placed
+
# Make a right click on the drive or folder and select Properties
+
# If you are seeing the properties of a folder click the Advanced button
+
# Click to clear the "Compress drive to save disk space" or "Compress contents to save disk space" check box
+
# Return to setup and continue installation.
+
 
+
[[#top|&uarr; Return to top]]
+
 
+
=== Permissions issues ===
+
 
+
* Sometimes disabling UAC (User Account Control) and reinstalling the toolset will allow the database to install properly.
+
 
+
* SQL Server needs permission to read from the directory that the you have put the installation files, if it does not have permissions, it may be unable to import resources into the database. To correct this change the administrative privileges for the directory you're installing the toolset from.
+
 
+
*On Vista systems the toolset may need administrator privileges to read the database where it's installed but fail to prompt you for them. Try right-clicking the toolset's shortcut and selecting "Run as Administrator" from the dropdown menu.
+
 
+
[[#top|&uarr; Return to top]]
+
 
+
==Misc Other Stuff to Clean up and Sort==
+
 
+
* You can try setting up your database separately from the toolset installer. See [[Manual database installation]] for the steps needed to install MSSQL Express 2005 and configure it for use with the toolset manually.  Users have been successful by setting up the toolset this way.
+
 
+
* One User has reported that this sequence of events works:
+
::*Uninstall SQL server and the Toolset from PC.
+
::*Delete C:\Program Files\Microsoft SQL Server
+
::*In Regedit, delete the following:
+
:::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSSQLServer
+
:::HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server
+
::*Reboot
+
::*Install Toolset with the SQL.
+
 
+
*If you already have MSSQLServer Express installed as part of a different program, the toolset may not get the correct configuration to use it. Run the toolset configuration program (configuretoolset.exe, in the same directory as the toolset itself) and then click "next" through the configuration wizard until you get to the "Content Database" field. It should read: "<code>Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bw_dragonage_content;Data Source=MSSQLDEV</code>"
+
 
+
*Some users report that the installer fails to create the SQL database (e.g. your <code>Dragon Age\toolssql\data</code> folder is empty). You can enter the following command to try restoring the database manually (Change the paths to <code>bw_dragonage_content.bak</code> and your Dragon Age folder as appropriate): <code>"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\"sqlcmd -S .\BWDATOOLSET -E -Q "RESTORE DATABASE bw_dragonage_content FROM DISK = 'C:\Program Files\Dragon Age\tools\dbbak\bw_dragonage_content.bak' WITH MOVE 'bw_dragonage_content' TO 'C:\Program Files\Dragon Age\tools\toolssql\Data\bw_dragonage_content.mdf', MOVE 'bw_dragonage_content_Log' TO 'C:\Program Files\Dragon Age\tools\toolssql\Data\bw_dragonage_content.ldf'"</code>
+
 
+
You need to allow Users to Modify the DATA folder, before you can execute this command.
+
 
+
*Some users have been successful simply installing from a more direct path (eg place the installer in C:\DAInstall and then run the exe file from that location rather than from My Documents or a similar long path).
+
 
+
[[#top|&uarr; Return to top]]
+

Revision as of 22:16, 11 December 2009

Note:If you were looking here for unable to connect issues, I have moved it all out of my sandbox into a real page located at Unable to connect to the database


Big Hammer Approach

Manual database installation works almost every time. If it does not, it at least should give you clues as to why it is failing. If this error is frustrating you and you want to just make it work, it is your best bet:

Do a toolset install with "Install MS SQL Express 2005 SP3" unchecked, as well as "Restore the default database. Existing DA toolset databases will be overwritten" unchecked, as shown here:

Toolset setup screen.png This will just install the toolset files not install, restore or configure a database at all. Of course, since SQL Server is not installed, you will still get the "Unable to to connect to the database" error.

Now, manually install SQL Server and restore the database. It is not as hard as it may sound, and is documented here. Basically, when you do this, you are taking the last two big steps away from the toolset installer, and doing them on your own. The reason that this is effective is that this way you can babysit the installation process. Running the SQL installer this way will throw more explicit errors at you when it is having problems, making it easier to diagnose


Background: The toolset needs a database engine to run. The installer has a copy of SQL Server 2005 embedded in it. When the toolset has finished doing its business (essentially unpacking some files and setting up some permissions for and creating necessary registry entries) it then runs the SQL Server 2005 (3rd party software)in "silent" mode, where it just tries to install with its own set of default settings. The toolset installer is "blind" to what goes on during the SQL install, it just gets a message when the SQL installer says "I'm done", regardless of what kind of "done" that is. It could be "I just failed horribly, but I'm done failing now" or it could be "Whew, everything went as planned, I'm done". Once the toolset installer gets that message, it says "SQL is done, so I guess I'm done now too".