You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jens Restemeier <je...@playtonicgames.com> on 2019/08/12 11:19:22 UTC

sqlite[s11]: database disk image malformed

Thanks to a power cut last week while updating I’ve got a few corrupted
workspaces:

Error: sqlite[S11]: database disk image is malformed  
Error: Additional errors:  
Error: sqlite[S11]: database disk image is malformed  

I'm currently trying to repair them from a fresh checkout, but I was
wondering:
- sqlite3 supposedly does journaling, shouldn't it be possible to repair the
database from the journal? Is there a "svn cleanup" option? (The only thing
online I found was to dump to sql and reimport into a new database, which
failed after quite some time...)
- would it be possible for "svn cleanup" to rebuild the database by auditing
the files in the workspace?
- would it be possible for "svn checkout" to only download the metadata from
the server, and keep the workspace files unchanged?

I am using Windows 10 with:
TortoiseSVN 1.11.1, Build 28492 - 64 Bit , 2019/01/08 21:40:39
ipv6 enabled
Subversion 1.11.1, -release
apr 1.6.5
apr-util 1.6.1
serf 1.3.9
OpenSSL 1.1.0j  20 Nov 2018
zlib 1.2.11
SQLite 3.23.1

Cheers,
Jens


Re: sqlite[s11]: database disk image malformed

Posted by Mark Phippard <ma...@gmail.com>.
On Mon, Aug 12, 2019 at 12:44 PM Jens Restemeier <je...@playtonicgames.com>
wrote:

> I just tried this in a workspace I don’t need to work in. It looks like
> the –force option in checkout does exactly that, though it still downloads
> everything from the server. Copying the .svn workspace from another
> workspace seems to be a lot faster.
>
> What I had in mind was an option that re-uses the workspace and the
> existing pristine copies in the .svn folder, so only properties and
> metadata needs to be downloaded from the server.
>

It will do this today ... but it is dependent upon the protocol and
configuration.  For example, when using HTTPS, the default behavior is to
issue a REPORT command and the streams all of the content in one response.
But you can configure your client and server to issue separate GET request
for each file.  When you are using this mode then the client does not
request any of the pristines that is already has.

http://subversion.apache.org/docs/release-notes/1.8.html#neon-deleted

Specifically try setting this option in your client "servers" file:
 http-bulk-updates=no

I am not as familiar with svn:// and file:// protocols. I suspect they just
support this behavior by default though.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

RE: sqlite[s11]: database disk image malformed

Posted by Jens Restemeier <je...@playtonicgames.com>.
I just tried this in a workspace I don’t need to work in. It looks like the –force option in checkout does exactly that, though it still downloads everything from the server. Copying the .svn workspace from another workspace seems to be a lot faster.

What I had in mind was an option that re-uses the workspace and the existing pristine copies in the .svn folder, so only properties and metadata needs to be downloaded from the server.

 

From: Nathan Hartman <ha...@gmail.com> 
Sent: 12 August 2019 13:17
To: Jens Restemeier <je...@playtonicgames.com>
Cc: users@subversion.apache.org
Subject: Re: sqlite[s11]: database disk image malformed

 

On Mon, Aug 12, 2019 at 7:19 AM Jens Restemeier <jens@playtonicgames.com <ma...@playtonicgames.com> > wrote:

- would it be possible for "svn checkout" to only download the metadata from
the server, and keep the workspace files unchanged?

 

"svn checkout" can actually check out into a directory that already exists and contains files. When a file already in the directory has the same name as an incoming file, it is said to be "obstructing" and isn't changed, instead marking it as a conflict (I think). I don't remember the exact details. All I know is that I've done it before, it worked, and afterwards I had to do a "svn revert -R ." in the working copy to un-mark everything and then it was fine. I'm away from my computer so I can't copy and paste the exact explanation but the output of "svn help checkout" (and most likely the svn-book) should tell you about this.

 


Re: sqlite[s11]: database disk image malformed

Posted by Nathan Hartman <ha...@gmail.com>.
On Mon, Aug 12, 2019 at 7:19 AM Jens Restemeier <je...@playtonicgames.com>
wrote:

> - would it be possible for "svn checkout" to only download the metadata
> from
> the server, and keep the workspace files unchanged?


"svn checkout" can actually check out into a directory that already exists
and contains files. When a file already in the directory has the same name
as an incoming file, it is said to be "obstructing" and isn't changed,
instead marking it as a conflict (I think). I don't remember the exact
details. All I know is that I've done it before, it worked, and afterwards
I had to do a "svn revert -R ." in the working copy to un-mark everything
and then it was fine. I'm away from my computer so I can't copy and paste
the exact explanation but the output of "svn help checkout" (and most
likely the svn-book) should tell you about this.

Re: sqlite[s11]: database disk image malformed

Posted by Jens Restemeier <je...@playtonicgames.com>.
Option one would be to offer this from svn cleanup:
https://forums.meteor.com/t/how-to-fix-sqlite-corrupt-so-meteor-cli-is-broken/6863/6

cd ~/.meteor/package-metadata/v2.0.1
sqlite3 packages.data.db .dump > backup
mv packages.data.db packages.data.db.bustedX
sqlite3 packages.data.db < backup
rm backup

I am not sure what the API equivalent of this is. Obviously this can fail if the dump fails, but that is better than nothing at all.

Option two would be to add an option “—repair" to “svn checkout —force” to ignore the existing database but keep the .svn directory including the pristine files.

> On 12 Aug 2019, at 19:00, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> 
> Jens Restemeier wrote on Mon, 12 Aug 2019 14:14 +00:00:
>> That is a good point, though I was hoping that implementation details 
>> like the database library can be handled internally,
> 
> What would you have us do when an SQLite API call returns SQLITE_CORRUPT
> (that's the error code you got)?
> 
>> and admin tasks wrapped within the svn frontend.


Re: sqlite[s11]: database disk image malformed

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Jens Restemeier wrote on Mon, 12 Aug 2019 14:14 +00:00:
> That is a good point, though I was hoping that implementation details 
> like the database library can be handled internally,

What would you have us do when an SQLite API call returns SQLITE_CORRUPT
(that's the error code you got)?

> and admin tasks wrapped within the svn frontend.

RE: sqlite[s11]: database disk image malformed

Posted by Jens Restemeier <je...@playtonicgames.com>.
That is a good point, though I was hoping that implementation details like the database library can be handled internally, and admin tasks wrapped within the svn frontend.

-----Original Message-----
From: Daniel Shahaf <d....@daniel.shahaf.name> 
Sent: 12 August 2019 14:41
To: Jens Christian Restemeier <je...@playtonicgames.com>; users@subversion.apache.org
Subject: Re: sqlite[s11]: database disk image malformed

Jens Restemeier wrote on Mon, 12 Aug 2019 11:19 +00:00:
> Thanks to a power cut last week while updating I’ve got a few 
> corrupted
> workspaces:
> 
> Error: sqlite[S11]: database disk image is malformed
> Error: Additional errors:  
> Error: sqlite[S11]: database disk image is malformed
> 
> I'm currently trying to repair them from a fresh checkout, but I was
> wondering:
> - sqlite3 supposedly does journaling, shouldn't it be possible to 
> repair the database from the journal? Is there a "svn cleanup" option? 
> (The only thing online I found was to dump to sql and reimport into a 
> new database, which failed after quite some time...)

Note that that error message is reported by SQLite; Subversion simply relays it.  You might want to ask this question on the SQLite mailing list.

Cheers,

Daniel


Re: sqlite[s11]: database disk image malformed

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Jens Restemeier wrote on Mon, 12 Aug 2019 11:19 +00:00:
> Thanks to a power cut last week while updating I’ve got a few corrupted
> workspaces:
> 
> Error: sqlite[S11]: database disk image is malformed  
> Error: Additional errors:  
> Error: sqlite[S11]: database disk image is malformed  
> 
> I'm currently trying to repair them from a fresh checkout, but I was
> wondering:
> - sqlite3 supposedly does journaling, shouldn't it be possible to repair the
> database from the journal? Is there a "svn cleanup" option? (The only thing
> online I found was to dump to sql and reimport into a new database, which
> failed after quite some time...)

Note that that error message is reported by SQLite; Subversion
simply relays it.  You might want to ask this question on the SQLite
mailing list.

Cheers,

Daniel