• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Error during table cpzone1 creation. Error message: database is locked

Scheduled Pinned Locked Moved Captive Portal
27 Posts 3 Posters 4.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    amitaussie
    last edited by Dec 24, 2015, 10:50 AM Dec 24, 2015, 10:32 AM

    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.15

    But after making changes in /var/run database error is certainly not appearing and everything is working ok.

    Regards

    1 Reply Last reply Reply Quote 0
    • A
      amitaussie
      last edited by Jan 7, 2016, 2:33 PM

      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

      1 Reply Last reply Reply Quote 0
      • G
        Gertjan
        last edited by Jan 7, 2016, 4:03 PM

        @amitaussie:

        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  ;)).

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • C
          cmb
          last edited by Jan 7, 2016, 7:36 PM

          @amitaussie:

          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.

          1 Reply Last reply Reply Quote 0
          • G
            Gertjan
            last edited by Jan 8, 2016, 8:15 AM Jan 8, 2016, 8:01 AM

            @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.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • C
              cmb
              last edited by Jan 9, 2016, 12:46 AM

              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.

              1 Reply Last reply Reply Quote 0
              • A
                amitaussie
                last edited by Jan 11, 2016, 5:34 AM Jan 9, 2016, 5:03 AM

                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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received