logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SQLite file format error?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Sat Aug 29, 2009 23:36    Post subject: SQLite file format error? Reply with quote

A very strange bug, but a critical once since it could in theory corrupt my entire database.

Basically, at some point when running the server, no matter what I did (and even the same thing with aps_demo), it could not talk to the database at all. The database log showed:

o Got request: SELECT player FROM pwdata WHERE player='Chris_Waher' AND tag='Monk' AND name='demoName'
! SQL Error: unsupported file format
o Sent response (0 bytes):

When I deleted the database file, everything worked again. However everything only worked when I completely deleted the database, which is so very bad that it's hard to put into words. Using sqlitecc.exe everything was still available and looked good.

Any idea how to make sure this does not repeat in the future? How to recover from such a bug?
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Aug 30, 2009 1:19    Post subject: Re: SQLite file format error? Reply with quote

Waher wrote:
A very strange bug, but a critical once since it could in theory corrupt my entire database.

Basically, at some point when running the server, no matter what I did (and even the same thing with aps_demo), it could not talk to the database at all. The database log showed:

o Got request: SELECT player FROM pwdata WHERE player='Chris_Waher' AND tag='Monk' AND name='demoName'
! SQL Error: unsupported file format
o Sent response (0 bytes):

When I deleted the database file, everything worked again. However everything only worked when I completely deleted the database, which is so very bad that it's hard to put into words. Using sqlitecc.exe everything was still available and looked good.

Any idea how to make sure this does not repeat in the future? How to recover from such a bug?


Check the SQLite forums...
There have been know issues where assessing the 'data' using a more recent version of the engine, can corrupt data files. (or rather it updates the format when you don't want it to). The only way to get back is to restore a backup of your data.

Can someone confirm the SQLite version used?

Cheers
Gryphyn
Back to top
View user's profile Send private message
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Sun Aug 30, 2009 9:59    Post subject: Reply with quote

That's also the only thing I found, however I have only accessed the database either through nwnx_odbc or sqlitecc.exe. Neither caused problems the dozens of times I used them before, until this error appeared.

One of the solutions is, of course, to export everything from the file format that can't be accessed and then import it again to a clean database, but once databases become really large, that's quite a hassle to do.

The thing that worries me most is that I don't know what exactly causes it, so I don't exactly know how to prevent it next time.
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Fri Sep 18, 2009 22:29    Post subject: Reply with quote

It seems I found the thing that causes it. Using sqlitecc and executing vacuum command on database table will make it unreadable, entirely, by NWN.

Anything that can be done against that?

EDIT: Seems not to be the case, whatever SQL files I create with sqlitecc end up corrupted at some point, this is really bad..
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Sat Sep 19, 2009 10:45    Post subject: Reply with quote

I am desperate here, now both the SQLite tool links in NWNX documentation are broken and I've tried downloading various tools, most of which corrupt the database and have NWNX say errors like 'encrypted or not a database' or 'unsupported file format'.

Could someone please link to me a working tool that they use with NWN and NWNX for SQLite databases that has no problems?
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Sat Sep 19, 2009 12:31    Post subject: Reply with quote

Can they at least open the DB and view the data? At this point I'd recommend migrating to MySQL if that's at all an option.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Sat Sep 19, 2009 20:27    Post subject: Reply with quote

Zebranky wrote:
Can they at least open the DB and view the data? At this point I'd recommend migrating to MySQL if that's at all an option.


Yeah I can open the data with the program itself so it's not a big drama -yet-. That is, until the database becomes too large to easily recreate. Anyways I've started using another program and so far I've not had problems with it, we'll see.

Thanks.
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mithreas



Joined: 09 May 2008
Posts: 24

PostPosted: Sat Sep 19, 2009 20:33    Post subject: Reply with quote

Chris, I'd strongly recommend switching to MySQL. For one thing, we're using it for pretty much everything on Arelith so it's been stress tested, and we find it really easy to manage. The other day, for example, I had to do a selective restore of one table from a backup a few hours old, without affecting any other data, and the whole process took me a handful of minutes.

My experience of SQLite has been less positive: I found it a lot more of a hassle to work with.
_________________
Admin team, Arelith PW
Hakless world that relies heavily on the great work done by the NWNX team.
Back to top
View user's profile Send private message
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Mon Sep 21, 2009 11:24    Post subject: Reply with quote

Mithreas wrote:
Chris, I'd strongly recommend switching to MySQL. For one thing, we're using it for pretty much everything on Arelith so it's been stress tested, and we find it really easy to manage. The other day, for example, I had to do a selective restore of one table from a backup a few hours old, without affecting any other data, and the whole process took me a handful of minutes.

My experience of SQLite has been less positive: I found it a lot more of a hassle to work with.


Cheers Mith! Smile

Yes, I am MySQL native myself, having worked on MySQL databases for better part of my developers career.

I've started using another program for management now, and that one seems far more intelligent, feature rich, and has not yet corrupted my fragile database, this keeps SQLite in my sights.

I have to do actual comparison tests to be sure which way to go, but if the two end up equal then I'll go to MySQL, simply because it is far more feature rich and already runs in my veins.

I started with SQLite first mainly because the nwnx_odbc documentation recommended to do so and is, essentially, more 'light'. Also, at first sight, I don't need to access the data elsewhere nor share it with other servers, though I might go to MySQL just to keep the door open for that reason.

Performance tests outside NWN show that SQLite works much faster under similar conditions to NWN, as long as you are willing to work with its limitations (such as access and various additional functionality that is missing). SQLite has faster queries, but loses out on very large databases compared to well optimized MySQL database. Persistent World server however is very small in database size compared to the systems I work with daily, so I am not too worried.

The thing here is though that NWN will require as simple queries as possible, so MySQL's main benefits over SQLite are of little value to me. So far the database architecture is built from the get go to be as direct access and simple as possible, with no heavy queries.

In short, at the moment I am in-between, but might make a switch and add neat web based DM'ing utility to the whole server.
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mithreas



Joined: 09 May 2008
Posts: 24

PostPosted: Tue Sep 22, 2009 23:26    Post subject: Reply with quote

Gotcha.

I'm not a database expert, but from a server admin perspective I'd strongly urge you to go with whatever is easiest for you to maintain. Server admining is a lot of work and the last thing you want to do is to impose a bunch of additional routine manual work on yourself when you don't have to. In that light, it's not simply a technical choice between the two - now that you're running your own place you will want to start thinking of technical solutions in terms of 'how does this reduce work for me and my DMs'. This mindset is one of the secrets of Arelith's longevity - there's nothing that will suffer if all the admin team are unavailable for a week or two.

-Mith
_________________
Admin team, Arelith PW
Hakless world that relies heavily on the great work done by the NWNX team.
Back to top
View user's profile Send private message
Waher



Joined: 28 Aug 2009
Posts: 13
Location: Tallinn, EST

PostPosted: Wed Sep 23, 2009 10:09    Post subject: Reply with quote

Mithreas wrote:
Gotcha.

I'm not a database expert, but from a server admin perspective I'd strongly urge you to go with whatever is easiest for you to maintain. Server admining is a lot of work and the last thing you want to do is to impose a bunch of additional routine manual work on yourself when you don't have to. In that light, it's not simply a technical choice between the two - now that you're running your own place you will want to start thinking of technical solutions in terms of 'how does this reduce work for me and my DMs'. This mindset is one of the secrets of Arelith's longevity - there's nothing that will suffer if all the admin team are unavailable for a week or two.

-Mith


Agreed, which is why making a web client for administrating databases and making changes to the game world is such a lovely concept I'd want to pull off with MySQL. Time will tell Smile
_________________
Kristo Vaher
Developer of Teramyre PW
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group