Ok, I've spent quite some time investigating and researching, but with no
luck.

@Michael, the server logs are empty. There's simply no trace during the time
slot my installation runs and fails. Maybe, there's a "verbose" mode or
something?

@David, I tried using the profiler (although it is a third-party one since I
use Express edition of SQL), but it doesn't show anything. I enabled tracing
all events, it started tracing a lot of stuff, but nothing related to the
running installation, as far as I can see. Probably, the reason is the
installation fails during the "open connection" operation? I mean, it
doesn't get to the profiler at that point and fails earlier.

So, I tried narrowing it down and did the following:
   1) I've created a sample installation to test just this issue (I'll
include the sources to the end of this reply)
   2) I've found that the database you connect to (the one you put to the
SqlDatabase/@Database) doesn't matter! Even if I create a test database in
Management Studio, then put this database name to the @Database attribute,
it fails with the same error. The user I use for connection is sa.
   3) I've tried comparing the sa accounts of default and named SQL
instances, but those are identical as far as I can see.

I'm not a SQL expert, so if you have a guess what I should check
additionally, please let me know.

*As promised, the sources of the test package it is reproduced with in 100%
cases:*

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
     xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension";
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";>
 <Product Id="{42565B10-0796-4fe8-90AC-0135D6E109BA}" Name="SQLdatabase"
Language="1033" Version="1.0.0.0" Manufacturer="SQLdatabase"
UpgradeCode="{B85469C8-DF1B-4f6f-BB59-64E3C2A014ED}">
 <Package InstallerVersion="200" Compressed="yes" />

<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
 <Directory Id="INSTALLLOCATION" Name="SQLdatabase">
 <Component Id="ProductComponent"
Guid="{45F0B7D7-BE79-4286-A569-8B266E6011BD}">
                                                   <File Id="file"
Source="S:\test.zip" KeyPath="yes" />
                                                   <sql:SqlString Id="Query"
ContinueOnError="no" ExecuteOnInstall="yes" SQL="select @@version"
SqlDb="MasterDB"/>
 </Component>
</Directory>
</Directory>
 </Directory>

    <sql:SqlDatabase Id="MasterDB" Server="[SQLSERVER]" Database="[DB]"
User="SQLUser1" />
    <util:User Id="SQLUser1" Name="[USER]" Password="[PASSWORD]" />

<Feature Id="ProductFeature" Title="SQLdatabase" Level="1">
 <ComponentRef Id="ProductComponent" />
</Feature>
 </Product>
</Wix>

*I run it like this (referencing default SQL instance, throws an error):*

msiexec /i sqldatabase.msi SQLSERVER=. DB=test USER=sa PASSWORD=*******
LOGVERBOSE=1 /l*v install_default.log

*And this one installs fine (referencing named SQL instance):*

msiexec /i sqldatabase.msi SQLSERVER=.\SQLEXPRESS USER=sa PASSWORD=*******
LOGVERBOSE=1 /l*v install_named.log

Any ideas, people?

-- Yan

On Sat, Oct 8, 2011 at 12:05 AM, Michael Osmond <mosm...@baytech.com.au>wrote:

> Yan,
>
> You will find the Server Log in Management Studio - Under Management -> SQL
> Server Logs.
>
> Sorry on the delay, I went home before I got your reply.
>
> Michael
>
> -----Original Message-----
> From: Yan Sklyarenko [mailto:yansklyarenko+...@gmail.com]
> Sent: Friday, 7 October 2011 6:00 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] ExecuteSqlStrings fails with the Error 0x80004005:
> failed to connect to database: 'master'
>
> Thanks for the suggestion, Michael!
>
> >> To determine the true reason for the failure, the administrator can look
> in the server's error log where a corresponding entry will be written.
> Could you please point out where I can find this "server's error log"
> referenced here?
>
> -- Yan
>
>
> On Fri, Oct 7, 2011 at 10:12 AM, Michael Osmond <mosm...@baytech.com.au
> >wrote:
>
> > Hi
> >
> > Looks like an Access Denied to me.
> >
> > Try the following to work out what is going on;
> >
> > This is from an MS Blog
> >
> > If the server encounters an error that prevents a login from succeeding,
> > the client will display the following error mesage.
> >
> >  Msg 18456, Level 14, State 1, Server <server name>, Line 1
> >  Login failed for user '<user name>'
> >
> > Note that the message is kept fairly nondescript to prevent information
> > disclosure to unauthenticated clients. In particular, the 'State' will
> > always be shown to be '1' regardless of the nature of the problem. To
> > determine the true reason for the failure, the administrator can look in
> the
> > server's error log where a corresponding entry will be written.
> >
> > An example of an entry is:
> >
> > 2006-02-27 00:02:00.34 Logon     Error: 18456, Severity: 14, State: 8.
> > 2006-02-27 00:02:00.34 Logon     Login failed for user '<user name>'.
> > [CLIENT: <ip address>]
> > The key to the message is the 'State' which the server will accurately
> set
> > to reflect the source of the problem. In the example above, State 8
> > indicates that the authentication failed because the user provided an
> > incorrect password. The common error states and their descriptions are
> > provided in the following table:
> >
> > ERROR STATE     ERROR DESCRIPTION
> > 2 and 5        Invalid userid
> > 6              Attempt to use a Windows login name with SQL
> Authentication
> > 7              Login disabled and password mismatch
> > 8               Password mismatch
> > 9               Invalid password
> > 11 and 12      Valid login but server access failure
> > 13             SQL Server service paused
> > 18             Change password required
> >
> > State 16 = Does not have access to database.
> >
> > Regards
> >
> > Michael
> >
> >
> > -----Original Message-----
> > From: Yan Sklyarenko [mailto:yansklyarenko+...@gmail.com]
> > Sent: Friday, 7 October 2011 5:06 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: [WiX-users] ExecuteSqlStrings fails with the Error 0x80004005:
> > failed to connect to database: 'master'
> >
> > Hello WiX Community,
> >
> > I have the following problem.
> >
> > I have a number of SqlString elements which run "CREATE DATABASE ... FOR
> > ATTACH" kind of queries. It fails to run on SQL 2008 (I tested on R2, but
> > it
> > seems that pure 2008 is also affected), DEFAULT INSTANCE ONLY. I mean, if
> I
> > specify any named instance (like .\SQ:EXPRESS) it works perfectly fine.
> > This
> > is the excerpt from the log file:
> > ...
> > MSI (s) (50:AC) [20:36:07:604]: Executing op:
> > ActionStart(Name=ExecuteSqlStrings,Description=Executing SQL Strings...,)
> > Action 20:36:07: ExecuteSqlStrings. Executing SQL Strings...
> > MSI (s) (50:AC) [20:36:07:604]: Executing op:
> >
> >
> CustomActionSchedule(Action=ExecuteSqlStrings,ActionType=25601,Source=BinaryData,Target=**********,CustomActionData=**********)
> > MSI (s) (50:80) [20:36:07:604]: Invoking remote custom action. DLL:
> > C:\Windows\Installer\MSI7A5C.tmp, Entrypoint: ExecuteSqlStrings
> > ExecuteSqlStrings: Entering ExecuteSqlStrings in
> > C:\Windows\Installer\MSI7A5C.tmp, version 3.6.2005.0
> > ExecuteSqlStrings: Error 0x80004005: failed to connect to database:
> > 'master'
> > Error 26203. Failed to connect to SQL database. (-2147467259 master )
> > MSI (s) (50!C4) [20:36:26:646]: Product: MyProduct 2.0 - trunkdefaultsql
> --
> > Error 26203. Failed to connect to SQL database. (-2147467259 master )
> > CustomAction ExecuteSqlStrings returned actual error code 1603 (note this
> > may not be 100% accurate if translation happened inside sandbox)
> > Action ended 20:36:26: InstallFinalize. Return value 3.
> > ...
> >
> > I tested on both WiX 3.5 (release build) and WiX 3.6 (latest available,
> > 2201).
> >
> > Has anyone seen this before? What could be the reason? I tried reporting
> > this as an issue, but developers responded that it doesn't sound like a
> WiX
> > issue...
> >
> > Thanks in advance,
> >
> > -- Yan
> >
> >
> ------------------------------------------------------------------------------
> > All of the data generated in your IT infrastructure is seriously
> valuable.
> > Why? It contains a definitive record of application performance, security
> > threats, fraudulent activity, and more. Splunk takes this data and makes
> > sense of it. IT sense. And common sense.
> > http://p.sf.net/sfu/splunk-d2dcopy2
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to