Database error FailDBReader when move folder

If you are having a problem using Vault, post a message here.
Post Reply
JanBrzozowski
Posts: 8
Joined: Thu Sep 18, 2014 2:20 am

Database error FailDBReader when move folder

Post by JanBrzozowski » Tue May 08, 2018 2:38 am

You do not have the required permissions to view the files attached to this post.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Database error FailDBReader when move folder

Post by jclausius » Tue May 08, 2018 7:13 am

Are there shared folders in your repository that may have had the path moved or renamed?

Do you have access to SQL Server Management Studio? If so, we can do a scan of your repository's objects and paths to see what it shows. You'll need to first determine the repository's ID ( SELECT repid, name FROM sgvault.dbo.tblrepositories; ) and then use the repid in the outlined query below.

Code: Select all

USE sgvault
GO

DECLARE @repid [int], @lasttxid [bigint];

SELECT @repid = _REPID_GOES_HERE_;

SELECT @lasttxid = currenttxid
FROM tblrepositories
WHERE repid = @repid

CREATE TABLE #t
(
   treelevel int not null,
   pph binary(16) not null,
   objverid bigint not null,
   objid bigint not null,
   objversion bigint not null,
   name nvarchar(256) not null,
   objprops smallint not null,
   pinnedfromobjverid bigint not null,
   fph binary(16) not null,
   fullpath nvarchar(1024) null,
   primary key (treelevel, pph, fph, objid)
)

INSERT INTO #t
   (treelevel, pph, objverid, objid, objversion, name, objprops, pinnedfromobjverid, fph)
   SELECT treelevel, parentpathhash, objverid, objid, objversion, LOWER(name), objprops, pinnedfromobjverid, fullpathhash
   FROM sgvault.dbo.ufngettreestructure(@repid, @lasttxid, default)

DECLARE @@treelevel int, @@rowsaffected int

SET @@treelevel = 0

UPDATE #t
SET fullpath = name
WHERE treelevel = @@treelevel

SET @@rowsaffected = @@ROWCOUNT

WHILE ( @@rowsaffected > 0 )
BEGIN

   UPDATE t
   SET t.fullpath = prev.fullpath + N'/' + t.name, t.pinnedfromobjverid = CASE WHEN (t.pinnedfromobjverid = 0) THEN prev.pinnedfromobjverid ELSE t.pinnedfromobjverid END
   FROM #t t
      INNER JOIN #t prev ON (prev.treelevel = @@treelevel) AND (prev.fph = t.pph)
   WHERE (t.treelevel = (@@treelevel + 1))

   SELECT @@rowsaffected = @@ROWCOUNT, @@treelevel = @@treelevel + 1

END -- WHILE

SELECT * FROM #t ORDER BY treelevel, pph, name;
Send the query results and the sgvault.log file from the Vault Server (By default in %windir%\temp\sgvault) to us a support AT sourcegear DOT com, and please place a reference to this forum post in your subject line.
Jeff Clausius
SourceGear

Post Reply