How to get the exact error from the VSS error code?

Hi folks,

I am writing the backup / restore application using VSS framework. Basically I would like to know how to problematically interpret the error codes which are thrown by the VSS framework.

For example, I am getting the error code 0x8007054f when I try to do the restore using SQL writer; I have seen the error is getting updated in Windows event viewer and I would like to know how to get those exact error strings from the error code (I am expecting something like GetLastError() in Win32).

Please let me know your valuable thoughts.

-Elango C

It’s not a standard NTSTATUS, that’s for sure… maybe it’s a unique value to the application?

(somebody wanna check WDFSTATUS.H, please? I don’t happen to have easy access to a copy where I am at present)

Peter
OSR

> Hi folks,

I am writing the backup / restore application using VSS framework.
Basically
I would like to know how to problematically interpret the error codes
which
are thrown by the VSS framework.

For example, I am getting the error code 0x8007054f when I try to do
the
restore using SQL writer; I have seen the error is getting updated in
Windows
event viewer and I would like to know how to get those exact error
strings
from the error code (I am expecting something like GetLastError() in
Win32).

Please let me know your valuable thoughts.

This is user mode not kernel mode right?

What routine is giving you the error code 0x8007054f? Is it an API call
or is it when you get the result of one of the async operation?

What OS? What bit width? VSS is one thing that doesn’t work if you run
it as a 32 bit application in a 64 bit OS, or at least that was the case
last time I did any VSS development.

What version of SQL? What writer? there are two I think, and you have to
explicitly enable the newer one, although maybe only one of them is
actually called “SQL Writer”

Most of the VSS error codes are pretty well documented and I can’t see
that one there.

James

This looks like a HRESULT error. Usually when a HRESULT starts with 0x8007
the lower 16 bits are a WIN32 error code. Look up 0x54f.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, September 17, 2010 8:22 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to get the exact error from the VSS error code?

Hi folks,

I am writing the backup / restore application using VSS framework.
Basically I would like to know how to problematically interpret the error
codes which are thrown by the VSS framework.

For example, I am getting the error code 0x8007054f when I try to do the
restore using SQL writer; I have seen the error is getting updated in
Windows event viewer and I would like to know how to get those exact error
strings from the error code (I am expecting something like GetLastError() in
Win32).

Please let me know your valuable thoughts.

-Elango C


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>

This looks like a HRESULT error. Usually when a HRESULT starts with
0x8007
the lower 16 bits are a WIN32 error code. Look up 0x54f.

INTERNAL ERROR. Nice.

:slight_smile:

James

I always keep err.exe in my path for these occasions:

C:\Dumps>err 0x8007054f

as an HRESULT: Severity: FAILURE (1), Facility: 0x7, Code 0x54f

for hex 0x54f / decimal 1359 :

ERROR_INTERNAL_ERROR winerror.h

An internal error occurred.

1 matches found for “0x8007054f”

http://www.microsoft.com/downloads/en/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&displaylang=en

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Bill Wandel” wrote in message
news:xxxxx@ntdev…
> This looks like a HRESULT error. Usually when a HRESULT starts with 0x8007
> the lower 16 bits are a WIN32 error code. Look up 0x54f.
>
> Bill Wandel
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Friday, September 17, 2010 8:22 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to get the exact error from the VSS error code?
>
> Hi folks,
>
> I am writing the backup / restore application using VSS framework.
> Basically I would like to know how to problematically interpret the error
> codes which are thrown by the VSS framework.
>
> For example, I am getting the error code 0x8007054f when I try to do the
> restore using SQL writer; I have seen the error is getting updated in
> Windows event viewer and I would like to know how to get those exact error
> strings from the error code (I am expecting something like GetLastError()
> in
> Win32).
>
> Please let me know your valuable thoughts.
>
> -Elango C
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>

+1

On Sep 17, 2010 10:52 AM, “Scott Noone” wrote:
> I always keep err.exe in my path for these occasions:
>
> C:\Dumps>err 0x8007054f
> # as an HRESULT: Severity: FAILURE (1), Facility: 0x7, Code 0x54f
> # for hex 0x54f / decimal 1359 :
> ERROR_INTERNAL_ERROR winerror.h
> # An internal error occurred.
> # 1 matches found for “0x8007054f”
>
>
http://www.microsoft.com/downloads/en/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&displaylang=en
>
> -scott
>
> –
> Scott Noone
> Consulting Associate
> OSR Open Systems Resources, Inc.
> http://www.osronline.com
>
>
> “Bill Wandel” wrote in message
> news:xxxxx@ntdev…
>> This looks like a HRESULT error. Usually when a HRESULT starts with
0x8007
>> the lower 16 bits are a WIN32 error code. Look up 0x54f.
>>
>> Bill Wandel
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
>> Sent: Friday, September 17, 2010 8:22 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] How to get the exact error from the VSS error code?
>>
>> Hi folks,
>>
>> I am writing the backup / restore application using VSS framework.
>> Basically I would like to know how to problematically interpret the error
>> codes which are thrown by the VSS framework.
>>
>> For example, I am getting the error code 0x8007054f when I try to do the
>> restore using SQL writer; I have seen the error is getting updated in
>> Windows event viewer and I would like to know how to get those exact
error
>> strings from the error code (I am expecting something like GetLastError()

>> in
>> Win32).
>>
>> Please let me know your valuable thoughts.
>>
>> -Elango C
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> For example, I am getting the error code 0x8007054f when I try to do the restore using SQL writer

How can VSS aid in restore?

VSS is a) API to VolSnap.sys snapshots and its software/hardware analogs b) the framework to synchronize the database apps with the snapshot creation.

What is else in VSS? is this “else” working at all, or just returning “internal error”?

Is your backup app file-based or image-based?

If latter - then, as you can understand, you do not need anything from VSS to restore the sector wise volume image. Just go on writing sectors.

If former - then the same :slight_smile: just restore the SQL’s .mdf and .ldf files.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>What OS? What bit width? VSS is one thing that doesn’t work if you run

it as a 32 bit application in a 64 bit OS, or at least that was the case
last time I did any VSS development.

Well, this is the most wrong statement that I saw for months on this forum. Sorry, James.

Not only 32bit clients of IVssBackupComponents run OK on 64bit OS, but 32bit _VSS provider services (LocalService .exe) run OK on 64bit OS with x64 VSS service, SWPRV and VolSnap.

Well, on pre-Win7 the latter required some minor patches to ProxyStubCLSID registry COM, but this a minor effort.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>INTERNAL ERROR. Nice.

With VSS, App event log can help (sometimes).


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>

> For example, I am getting the error code 0x8007054f when I try to do
the
restore using SQL writer

How can VSS aid in restore?

VSS is a) API to VolSnap.sys snapshots and its software/hardware
analogs b)
the framework to synchronize the database apps with the snapshot
creation.

What is else in VSS? is this “else” working at all, or just returning
“internal error”?

Is your backup app file-based or image-based?

If latter - then, as you can understand, you do not need anything from
VSS to
restore the sector wise volume image. Just go on writing sectors.

If former - then the same :slight_smile: just restore the SQL’s .mdf and .ldf
files.

VSS takes care of bringing the databases back on line on restore in the
case of restoring a database to a running system (and applying the
latest differential backup too I think but not completely sure about
that). On a baremetal restore it is probably sufficient to just dump the
database files in but you’ll still need extra work to apply the latest
differential backup.

And for a baremetal restore the ASR writer actually does a heap of stuff
(partitioning disks etc). VSS isn’t just for backup.

James

>

>What OS? What bit width? VSS is one thing that doesn’t work if you
run
>it as a 32 bit application in a 64 bit OS, or at least that was the
case
>last time I did any VSS development.

Well, this is the most wrong statement that I saw for months on this
forum.
Sorry, James.

Not only 32bit clients of IVssBackupComponents run OK on 64bit OS, but
32bit
_VSS provider services (LocalService .exe) run OK on 64bit OS with x64
VSS
service, SWPRV and VolSnap.

Are you sure?

Quoting http://msdn.microsoft.com/en-us/library/aa384627(VS.85).aspx
(although full of contradictions)

“All 32-bit VSS applications (requesters, providers, and writers) must
run as native 32-bit or 64-bit applications. Running them under WOW64 is
not supported.”

“Windows Server 2003 and Windows XP: Running 32-bit VSS requesters
under WOW64 is supported, but not for system-state backups. Running
32-bit VSS providers and writers under WOW64 is not supported. Support
for running 32- bit requesters under WOW64 was removed in Windows Vista
and subsequent versions.”

And http://support.microsoft.com/kb/896492 (referring to Windows 2003
and XP)

“Data loss and system corruption may occur if a 32-bit backup
application is used to back up and restore data on a computer that is
running a 64-bit version of Windows.”

“You should only use 64-bit versions of backup applications when your
computer is running on a 64-bit version of Windows. Many backup software
vendors have already developed 64-bit versions of their backup
applications.”

“Backup applications that only work with 32-bit versions of Windows will
not correctly back up user data, system files, and system settings.
During a restore operation, these applications may cause irreversible
data loss and system corruption.”

Well, on pre-Win7 the latter required some minor patches to
ProxyStubCLSID
registry COM, but this a minor effort.

I’ve been involved in Bacula (http://www.bacula.org/) development on and
off for quite a while, and I can assure you that when the VSS code was
written then at the time of XP and 2003, it certainly didn’t work at all
no matter how much minor patching you did. I’m not positive but I’m
pretty sure that the hard word from Microsoft was “compile your app for
64 bits”.

Maybe it’s been fixed since Windows 2003 but if you have to build a 64
bit app for Windows 2003, why would you not just build it for all 64 bit
platforms?

James

>(although full of contradictions)

Surely.

“All 32-bit VSS applications (requesters, providers, and writers) must
run as native 32-bit or 64-bit applications. Running them under WOW64 is
not supported.”

Works for requesters, works for providers after a small registry patch (on Vista/2008, Win7/R2 do not require even this), don’t know on writers.

"Windows Server 2003 and Windows XP: Running 32-bit VSS requesters
under WOW64 is supported, but not for system-state backups.

I don’t know what is “system state backup”, I only know what is “sector-wise volume image”. :slight_smile:

Support for running 32- bit requesters under WOW64 was removed in Windows Vista
and subsequent versions."

This contradicts the reality.

“Data loss and system corruption may occur if a 32-bit backup
application is used to back up and restore data on a computer that is
running a 64-bit version of Windows.”

And what are the details?

off for quite a while, and I can assure you that when the VSS code was
written then at the time of XP and 2003, it certainly didn’t work at all
no matter how much minor patching you did.

What “VSS code”? requester? or provider? requesters based on VSHADOW sample (nothing fancy) just plain work, even across 32/64 boundary. Provider requires ProxyStubClsid patch to cross 32/64 boundary.

pretty sure that the hard word from Microsoft was “compile your app for
64 bits”.

Compiling the tiny requester DLL to x64 is not an issue at all, but what about rather huge EXE which is calling it?

I wrote the OA-based code to transfer the VSS operations from 32bit to 64bit context, so that the VSS requester will be a 64bit shim. Later testing have shown that this effort of mine was 100% redundant.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>VSS takes care of bringing the databases back on line on restore in the

case of restoring a database to a running system

What do you mean under “running”? OS is running? or services like store.exe or sqlservr.exe are running?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>

>VSS takes care of bringing the databases back on line on restore in
the
>case of restoring a database to a running system

What do you mean under “running”? OS is running? or services like
store.exe or
sqlservr.exe are running?

Yes, running OS + services. Restoring individual bits and pieces of a
sharepoint cluster is something that I wouldn’t like to do from a sector
based backup. Or restoring a single file (eg complusregdb) for that
matter.

Sector backups are great for restoring from a total loss situation to
exactly the same hardware, but outside of that their usage is limited.

James

Thanks a lot folks for your advices.

On Sun, Sep 19, 2010 at 7:54 PM, James Harper > wrote:

> >
> > >VSS takes care of bringing the databases back on line on restore in
> the
> > >case of restoring a database to a running system
> >
> > What do you mean under “running”? OS is running? or services like
> store.exe or
> > sqlservr.exe are running?
> >
>
> Yes, running OS + services. Restoring individual bits and pieces of a
> sharepoint cluster is something that I wouldn’t like to do from a sector
> based backup. Or restoring a single file (eg complusregdb) for that
> matter.
>
> Sector backups are great for restoring from a total loss situation to
> exactly the same hardware, but outside of that their usage is limited.
>
> James
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Elango C (இளங்கோ சொக்கலிங்கம்)
Chennai, India.
website:http://celango.blogspot.com

“Obstacles are those frightful things you see
when you take your eyes off your goal.”