Error during table cpzone1 creation. Error message: database is locked
-
Hi,
Gertjan!
My captiveportal.inc is different as I am using a file which is patched for manual logout as mentioned in this post of yours
https://forum.pfsense.org/index.php?topic=77143.15But after making changes in /var/run database error is certainly not appearing and everything is working ok.
Regards
-
Hi
Gertjan!
I am not able to find changes you suggested for /var/run.
Can you please re-send the changes as these were helping.
Regards -
I am not able to find changes you suggested for /var/run.
Can you please re-send the changes as these were helping.
They should be on the forum - I didn't remove anything.
It was a question of changing the the 2 places where the data base was created.But, be careful : read this https://forum.pfsense.org/index.php?topic=103707.msg580857#msg580857 (post above).
I don't know why it is a bad idea, but if cmb says so, I will not discus that (although I do want to the the 'why' part ;)). -
Hi
Gertjan!
I am not able to find changes you suggested for /var/run.
I removed them because they weren't related to the root issue and weren't a good idea. Just upgrade to 2.2.6, that will properly fix the root issue.
-
@cmb:
I removed them because ….....
That's what I figured out.
@amitaussie : I advise you to use a clean "2.2.6" version (undo ALL changes in /etc/inc/captiveportal.inc).
If you still see the same issues ("database locked") then I really start to think that your hardware isn't simply fast enough ….edit : @cmb : I wasn't looking for solving a programming error, but using a RAM disk instead of ordinary disk so treatment would speed up.
From what I made of it, database locking and waiting for it wasn't optimal, so their was a chance an execution path (user logging in) could fall into the attempt of another user logging in at the same time. The database would be locked at the same, the last attempts bails out.
Now, if locking, updating and unlocking takes time, and enough attempt are made, the locking issue start to pop up (race condition).
That's why I was thing of borrowing temporarily some RAM space.Of course, when pfSense is rebooted, this RAM based database file will be gone which produces new unpredictable results.
When the (very small) RAM disk fills up, new, totally unpredictable results will pop up.
Etc ....The test existed in the fist place to see if "time" could be an issue. It clearly was.
-
Indeed because the RAM disk would be much faster than the hard drive, the locked operations would complete faster, which would lessen the chance of hitting the lock contention. It was a fine suggestion for something to try at the time, when we hadn't identified the root cause or fixed it yet. But once the lock issue was fixed, making those kinds of changes aren't desirable, which is why I removed it after the root problem was fixed. Otherwise what we've seen in similar situations in the past is people making changes that were intended to address an issue that no longer exists and just causing problems in the process (then reporting problems, not mentioning the changes they made, and we chase our tails wasting time trying to figure out what the issue is, when it was actually user modification induced).
If anyone's still seeing any locking issues, please make sure you're on a stock 2.2.6 release (no modifications), and start a new thread describing what's happening. The issue in this thread was resolved, so something different is happening if you're still seeing that.
-
Hi
Gertjan & CMB
Thanks for your valuable inputs.
As suggested I have made a clean install of 2.2.6 and no more database locked errors are found.
Then I changed 2.2.6 captiveportal.inc & index.php for manual logout page as mentioned in https://forum.pfsense.org/index.php?topic=77143.0
Everything is working fine now with manual logout page.
Earlier when i upgraded to 2.2.6, I used to copy modified captiveportal.inc & index.php from version 2.2.4 to get manual logout page. I didnt modify 2.2.6 version captiveportal.inc & index.php for manual logout page. So that's why I was getting database error after upgrading to 2.2.6.
Sorry, it was my fault, I should have made changes to 2.2.6 version captiveportal.inc & index.php files to get logout page.
Thanks & regards