Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   "attempt to write a readonly database" (https://forums.graalonline.com/forums/showthread.php?t=134265693)

xXziroXx 02-04-2012 04:26 PM

"attempt to write a readonly database"
 
I just repurchased my playerworld after it had been offline for a few weeks, and now RC is spammed with the error "attempt to write a readonly database" whenever I try to work with the SQLite Database.

Help please!

xXziroXx 02-04-2012 05:54 PM

I also can't seem to download main.db from file browser.

PHP Code:

Welcome to the FileBrowser for account_xXziroXx
No read rights 
for main.db
Download of main
.db failed 


cbk1994 02-04-2012 09:47 PM

If you change the database definitions in server ops are you able to use a different database file?

e.g. add database=default,main-new

xXziroXx 02-04-2012 10:31 PM

Quote:

Originally Posted by cbk1994 (Post 1683632)
If you change the database definitions in server ops are you able to use a different database file?

Yes, I can manipulate other databases, just not the default one (where the vast majority of my data is).

xXziroXx 02-06-2012 09:55 PM

Bump. Come on Stefan, two days of browsing the forum and no help? This is pretty important :(

Admins 02-09-2012 04:26 AM

Sorry for not answering earlier.
The file wasn't writable by the npcserver because of missing rights. It must have been caused by the fact that I was restoring it from a backup sometime in December, it wasn't writable back then either though? Anyway it should work better now. It's still quite huge (123 MByte) so it might be good to clean some stuff or put data in separate databases to avoid problems like back then when the file was corrupted.

ffcmike 02-09-2012 04:45 AM

Might it be possible for there to be a way to clean up databases where there is excess file size by result of previous data that has been deleted?

Something I've done before with 0 players online + staff only is temporarily set default database to a different name in server options, clean up main.db offline with SQlite browser software, reupload main.db and set it back to default in server options.

Admins 02-09-2012 01:47 PM

Hmmm tried the "vacuum" command? (make a backup first) I've heard it should help but have never tried.

ffcmike 02-12-2012 11:15 AM

Quote:

Originally Posted by Stefan (Post 1684109)
Hmmm tried the "vacuum" command? (make a backup first) I've heard it should help but have never tried.

It's not a problem as my database is only 1.5 MB, but I tried this anyway and received this error:

Quote:

too many attached databases - max 0
On a related note, at various times over the past week there's been some very abnormal serverside lag, where a Database NPC would be listed as 5 - 10% in RC /stats, which seems to be caused by SQLite queries immediately following eachother.

An example of an executed query happening in these instances:

PHP Code:

temp.query "UPDATE tablename SET examplevalue = examplevalue + " float(temp.amtstring) @ " WHERE examplevalue2 = '" temp.item.escape() @ "'"

What's surprising is that this simple query is affecting a table which contains only 2 rows, 4 columns, with the necessary value being indexed. I have other SQLite tables with thousands of entries where queries are executing quickly and not causing bizarre lag spikes.

cbk1994 02-12-2012 07:52 PM

Quote:

Originally Posted by ffcmike (Post 1684350)
On a related note, at various times over the past week there's been some very abnormal serverside lag, where a Database NPC would be listed as 5 - 10% in RC /stats, which seems to be caused by SQLite queries immediately following eachother.

From experience I don't think this is caused by the SQL but rather by the server locking up (backups? other servers using too much memory?). On Era we often see scripts hit 10+% CPU when the server is lagging, even if the scripts aren't doing anything that should cause problems (e.g. doing damage to a player by changing their HP; no SQL or file I/O involved). Scripts using SQLite often are at the top of the CPU list at this time, but not always.

I'd like to see Stefan look into this and find the real problem, though. It's been around for years and affects big servers like Era and even small UC servers I've worked on with few scripts and one or two players online.


All times are GMT +2. The time now is 05:49 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.