View Issue Details

IDProjectCategoryView StatusLast Update
0000384bareos-coreGeneralpublic2019-12-18 15:25
Reporterlukasz.dudek Assigned Tomvwieringen  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version2008R2
Product Version14.2.2 
Fixed in Version14.2.7 
Summary0000384: mssqldvi prolem with connection to mssql not default instance
DescriptionWe have MSSQL instance named RLPLSOK_DEV.
I configured fileset as:

Fileset {
  Name = "mssql-rlpl04"
  Enable VSS = no
  Include {
    Options {
      Signature = MD5
    }
    Plugin = "mssqlvdi:instance=RLPLSOK_DEV:database=STS"
}

in time of backup I see in Event Viewer this error:
SQLVDI: Loc=IdentifySQLServer. Desc=MSSQLSERVER. ErrorCode=(1060)The specified service does not exist as an installed service.
. Process=5288. Thread=6428. Client. Instance=. VD=.

We haven't instance named MSSQLSERVER.

In backup serwer log I see messages like:
 24-Dec 11:59 vm-rlpl04-fd JobId 50: Fileset has no "File=" directives, ignoring FilesNotToBackup Registry key
24-Dec 11:59 vm-rlpl04-fd JobId 50: Cannot open "/@MSSQL/RLPLSOK_DEV/STS/db-full": ERR=Cannot create a file when that file already exists.

and backup ends "Backup OK -- with warnings" but data writen by sd are very small.

TagsNo tags attached.

Relationships

child of 0000625 closedmaik Release bareos-15.2.3 
child of 0000584 closedjoergs Release bareos-14.2.7 

Activities

lukasz.dudek

lukasz.dudek

2014-12-24 12:27

reporter  

rlpl04-fd.log (2,431 bytes)
mvwieringen

mvwieringen

2014-12-24 14:50

developer   ~0001164

Is this a clustered instance ?

If so then you need to specify the new serveraddress pluginoption
and specify the cluster address.

The above error on google leads to several hits including this one:

http://www.symantec.com/connect/forums/none-requested-files-were-backed-ms-sql

Which seems to indicate that its a problem at resolving the service inside
windows so has little to do with the plugin.

This is also more a thing for on the mailinglist then for in a bug database
as I wonder if its a bug at all.
mariusz.szewczyk

mariusz.szewczyk

2014-12-27 10:40

reporter   ~0001165

I am suffering the same issue. Both with MsSQL 2005 Standard (Win2008 x64) and MsSQL Express (Win2003 x86) as well with two different hosts (not clustered).
lukasz.dudek

lukasz.dudek

2014-12-29 09:40

reporter   ~0001166

It is standalone instance with several databases. Instance runs in "simple recovery mode", your manual says about "full recovery mode", but IMHO it is recommendation, not requirement. This is devel env, PTR its not so important.
version: "Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor) "

I tried option serveraddress before. I tried add alias for mssql instance named MSSQLSERVER too. With no success.
mvwieringen

mvwieringen

2014-12-29 13:35

developer   ~0001167

Try doing some proper debugging first.

It can be a ton of reasons that things don't work.

See

http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-27000025.2

That describes how to capture debug information on windows.
The plugin should write out the connect string it uses if you capture that
try using that with a external program to see if that connect string can
be processed on your system.
lukasz.dudek

lukasz.dudek

2014-12-29 15:21

reporter  

bareos-fd.trace (15,860 bytes)
mvwieringen

mvwieringen

2014-12-29 16:42

developer   ~0001168

Please increase the debug level to at least 150 as otherwise the plugin
itself doesn't log anything.
lukasz.dudek

lukasz.dudek

2014-12-30 09:10

reporter  

bareos-d2000-fd.trace (111,740 bytes)
lukasz.dudek

lukasz.dudek

2014-12-30 09:12

reporter   ~0001170

First trc file was dumped with 200 debug level, second with 2000 debug level.
lukasz.dudek

lukasz.dudek

2015-01-26 07:15

reporter   ~0001213

any clue?
jkimalane

jkimalane

2015-12-30 11:25

reporter   ~0002067

I can confirm that same symptoms appear with SQLVDI when MSSQL EXPRESS (2012 SP3) is the source for backup. No clues, what or why SQLVDI fails, appear in trace file when FD is running in trace/debug mode. SQL server itself states that SQLEXPRESS is the name of instance and it makes no difference if I use this exact name or if I used "default"

I wanted to add few lines of debug code to this plugins source and trace it bit more deeply but I failed to compile vanilla source with mingw64. This obviously is another story, but maybe I could use win SDK's debugger for this.

Maybe someone can recommend a tool for testing SQLVDI's config, there is a tool called SQL Backup Simulator but all links I could find are broken and download for this tool is nowhere to be found.
jkimalane

jkimalane

2016-01-04 08:08

reporter   ~0002069

I think I have found the cause of this issue. It's the way how the method IClientVirtualDeviceSet2::CreateEx is called. VDI documentation states that the first argument passed to this method must be the instance name or NULL if it's the default instance, I quote: "The instance name must identify the instance to which the Transact-SQL is issued. NULL identifies the default instance. No "machineName\" prefix is accepted"

So the code at the line 1432 in file mssqlvdi-fd.c:

hr = p_ctx->VDIDeviceSet->CreateEx(NULL, p_ctx->vdsname, &p_ctx->VDIConfig);

it should be something like this

if (bstrcasecmp(p_ctx->instance, DEFAULT_INSTANCE)) {
   hr = p_ctx->VDIDeviceSet->CreateEx(NULL, p_ctx->vdsname, &p_ctx->VDIConfig);
} else {
  hr = p_ctx->VDIDeviceSet->CreateEx(p_ctx->instance, p_ctx->vdsname, &p_ctx->VDIConfig);
}

According to VDI documentation host name can be omitted from the instance name so this fix should work.

PS. If I only had access to the Win32 build environment then I could test this theory :)
mvwieringen

mvwieringen

2016-01-04 10:36

developer   ~0002070

Ok sound plausible, problem is that we cannot ship the Windows headers for
VDI and VSS as they are Microsoft proprietary. So you need to get those yourself
or do some clever googling as it seems some people do publish them although they
probably are not allowed to.

I added the patch to a test branch so things should start to compile soon and
I will attach the created mssqlvdi-fd.dll here or make it available via other means.
mvwieringen

mvwieringen

2016-01-05 11:17

developer   ~0002071

A windows installer is made available under

http://download.bareos.org/bareos/people/mvw/bug384/

This is the current master code with a somewhat modified version of your
patch to make it compile as the argument is wide char and our instance name
is normally stored as normal UTF8 string.
jkimalane

jkimalane

2016-01-05 16:14

reporter   ~0002072

I confirm that this patch fixed this particular issue. MSSQL VDI plugin correctly handles databases which do not run as the default instance. It looks very promising, I'll do few additional tests to verify correct behaviour of this plugin. Inc, Diff and Full backups of named MSSQL instances are working!

Related Changesets

bareos: master 5389d0d1

2016-01-04 11:04

Jyri Palis


Committer: mvwieringen

Ported: N/A

Details Diff
mssqlvdi: Fix IClientVirtualDeviceSet2::CreateEx call.

Seems we need to call IClientVirtualDeviceSet2::CreateEx with as first
argument the instance name when connecting to the an non default
instance.

Fixes 0000383: mssqldvi problem with connection to mssql not default
instance
Affected Issues
0000384
mod - AUTHORS Diff File
mod - src/win32/plugins/filed/mssqlvdi-fd.c Diff File

Issue History

Date Modified Username Field Change
2014-12-24 12:27 lukasz.dudek New Issue
2014-12-24 12:27 lukasz.dudek File Added: rlpl04-fd.log
2014-12-24 14:50 mvwieringen Note Added: 0001164
2014-12-27 10:40 mariusz.szewczyk Note Added: 0001165
2014-12-29 09:40 lukasz.dudek Note Added: 0001166
2014-12-29 13:35 mvwieringen Note Added: 0001167
2014-12-29 13:35 mvwieringen Assigned To => mvwieringen
2014-12-29 13:35 mvwieringen Status new => feedback
2014-12-29 15:21 lukasz.dudek File Added: bareos-fd.trace
2014-12-29 16:42 mvwieringen Note Added: 0001168
2014-12-29 16:48 mvwieringen Assigned To mvwieringen =>
2014-12-30 09:10 lukasz.dudek File Added: bareos-d2000-fd.trace
2014-12-30 09:12 lukasz.dudek Note Added: 0001170
2014-12-30 09:12 lukasz.dudek Status feedback => new
2015-01-15 15:57 pstorz Assigned To => pstorz
2015-01-15 15:57 pstorz Status new => feedback
2015-01-26 07:15 lukasz.dudek Note Added: 0001213
2015-01-26 07:15 lukasz.dudek Status feedback => assigned
2015-03-31 14:54 pstorz Assigned To pstorz =>
2015-03-31 14:54 pstorz Status assigned => confirmed
2015-12-30 11:25 jkimalane Note Added: 0002067
2016-01-04 08:08 jkimalane Note Added: 0002069
2016-01-04 10:36 mvwieringen Note Added: 0002070
2016-01-05 11:17 mvwieringen Note Added: 0002071
2016-01-05 16:14 jkimalane Note Added: 0002072
2016-01-07 19:46 mvwieringen Changeset attached => bareos master 5389d0d1
2016-01-07 19:48 mvwieringen Status confirmed => resolved
2016-01-07 19:48 mvwieringen Fixed in Version => 14.2.7
2016-01-07 19:48 mvwieringen Resolution open => fixed
2016-01-07 19:48 mvwieringen Assigned To => mvwieringen
2016-02-25 17:02 maik Relationship added child of 0000625
2016-07-05 11:53 joergs Relationship added child of 0000584
2019-12-18 15:25 arogge Status resolved => closed