error: Cannot obtain a lock on data directory #11038

issue midas717 opened this issue on August 13, 2017
  1. midas717 commented at 4:38 AM on August 13, 2017: none

    <!--- Remove sections that do not apply -->

    This issue tracker is only for technical issues related to bitcoin-core.

    General bitcoin questions and/or support requests and are best directed to the Bitcoin StackExchange.

    For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/.

    Describe the issue

    Downloaded Bitcoin Core today. I told the program to use an extra hard drive on my computer that I rarely use but works (old laptop hard drive). It was taking forever to sync (est. time 20+ hours), so I shut it down for a bit to resume later.

    When I tried to start the program again, I get the error "cannot obtain a lock on data directory L:\Bitcoin. Bitcoin Core is probably already running. Access is denied.."

    So I restarted my computer and tried to start the program again and got the same error.

    Can you reliably reproduce the issue?

    If so, please list the steps to reproduce below:

    1. Click start menu -> Click Bitcoin Core shortcut

    Expected behaviour

    open program

    Actual behaviour

    error on startup loading screen

    What version of bitcoin-core are you using?

    0.14.2

    Machine specs:

    • OS: Windows 7
    • CPU: Intel i5-4670k
    • RAM: DDR3 2x8gb
    • Disk size: 232 gb
    • Disk Type (HD/SDD): Laptop HD connected into a desktop
  2. fanquake added the label Windows on Aug 13, 2017
  3. achow101 commented at 5:15 AM on August 13, 2017: member

    Check that you don't already have Bitcoin Core already running. Look in task manager and see if you see any processes named bitcoin-qt or bitcoind.

  4. midas717 commented at 12:20 PM on August 13, 2017: none

    It wasn't running. In my post I wrote that I restarted my computer before trying again.

  5. janmande commented at 2:33 PM on August 18, 2017: none

    Bitcoin Core uses a file named ".lock" in the data directory to make sure only one instance is accessing it at the time. Your error message indicates that the Bitcoin Core is denied acces to this file which usually only happens if another instance is running.

    If you are absolutley sure that no other Bitcoin Core process is running you could try to delete the .lock file before starting Bitcoin Core again. I assume you have backed up your wallet if it contains any coins before attempting this.

  6. fanquake closed this on Oct 7, 2017

  7. Mentors4EDU commented at 11:43 PM on March 9, 2018: none

    Deleting the lock file can fix it, and sometimes just running as sudo also will fix it if nothing else false. Same applies to SmartCash or other cryptos having that problem

  8. fortesp commented at 2:03 PM on March 14, 2020: none

    With me this happens when i try to put the ledger in a remote directory via SMB share. Even after deleting .lock file, every startup the same error displays. #Linux

  9. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me