<p>Use Microsoft's <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/handle" rel="nofollow noreferrer">Handle</a> tool to see what files are open, and add the details to your question (You can limit the output to a specific folder or keyword such as 'bitcoin' by running the tool like this:</p>
<pre class="lang-shell prettyprint-override"><code>handle.exe E:\bitcoin
</code></pre>
<p>That will tell you all the files existing in <code>E:\bitcoin</code> that are open, and which process has them open.  That should allow you to narrow down what process is causing bitcoin-qt to report that error.</p>
<p>If <code>handle</code> shows no open files, then perhaps you have a permissions issue - i.e. maybe bitcoin-qt can't open the wallet.dat due to limited permissions.  Use <code>icacls.exe e:\bitcoin</code> to check permissions.</p>

CC BY-SA 4.0
2023-10-30T18:01:32.523Z
2023-10-30T18:01:32.523Z
Hannah Vernon
<p>I have LND v.16.2 running under Windows 10 with Bitcoin Core 23.0 on same machine.</p>
<p>When I need to reboot, I gracefully stop my LND node and close bitcoin-qt from the GUI, waiting until it has completely shut down. Then, when I try to restart bitcoin-qt after rebooting, it claims that the db is locked. Bitcoin-Qt is not running already, it is not in the autostart.</p>
<p>I have found that deleting the <code>wallet.dat</code> and creating a new one enables me to proceed. I am not worried about a financial loss, since the Bitcoin wallet contains no BTC, but it’s a yellow flag.</p>
<p>Can anyone explain why this might be happening and how I can prevent it?</p>
<p>.conf files below.</p>
<hr />
<pre><code>bitcoin.conf

server=1
listen=1
daemon=1
rpcuser=xxxxx
rpcpassword=yyyyyyyyyyyyyyy
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333 
txindex=1
</code></pre>
<hr />
<pre><code>lnd.conf

debuglevel=info
listen=0.0.0.0:9735
externalip=x.x.x.x   (my external fixed IP)
rpclisten=0.0.0.0:10009
restlisten=0.0.0.0:10010
tlsextraip=x.x.x.x    (my external fixed IP)
alias=nodenodealias
color=#ffdc00
maxpendingchannels=10
bitcoin.mainnet=1
bitcoin.active=1
bitcoin.node=bitcoind
bitcoind.rpcuser=xxxxxxx
bitcoind.rpcpass=yyyyyyyyyy
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
</code></pre>
<p>The base directory for bitcoin is e:/bitcoin that contains the node's data, logs, configuration file, etc. That is reflected in the windows registry and lnd seems to find it with no problem.</p>
<pre><code>bitcoind.dir=E:/bitcoin
</code></pre>
<p>LND files, on the other hand, are in Appdata/local/lnd.</p>

<bitcoin-core><lightning-network><wallet.dat><lightning-network-daemon><windows>
Why might my db be locked on starting bitcoin-qt after a clean shutdown and reboot?
ondawoad
# Why might my db be locked on starting bitcoin-qt after a clean shutdown and reboot?

(Asked by: username_0 on 2023-08-28)

I have LND v.16.2 running under Windows 10 with Bitcoin Core 23.0 on same machine.

When I need to reboot, I gracefully stop my LND node and close bitcoin-qt from the GUI, waiting until it has completely shut down. Then, when I try to restart bitcoin-qt after rebooting, it claims that the db is locked. Bitcoin-Qt is not running already, it is not in the autostart.

I have found that deleting the `wallet.dat` and creating a new one enables me to proceed. I am not worried about a financial loss, since the Bitcoin wallet contains no BTC, but it’s a yellow flag.

Can anyone explain why this might be happening and how I can prevent it?

.conf files below.

---

```
bitcoin.conf

server=1
listen=1
daemon=1
rpcuser=xxxxx
rpcpassword=yyyyyyyyyyyyyyy
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333 
txindex=1

```

---

```
lnd.conf

debuglevel=info
listen=0.0.0.0:9735
externalip=x.x.x.x   (my external fixed IP)
rpclisten=0.0.0.0:10009
restlisten=0.0.0.0:10010
tlsextraip=x.x.x.x    (my external fixed IP)
alias=nodenodealias
color=#ffdc00
maxpendingchannels=10
bitcoin.mainnet=1
bitcoin.active=1
bitcoin.node=bitcoind
bitcoind.rpcuser=xxxxxxx
bitcoind.rpcpass=yyyyyyyyyy
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333

```

The base directory for bitcoin is e:/bitcoin that contains the node's data, logs, configuration file, etc. That is reflected in the windows registry and lnd seems to find it with no problem.

```
bitcoind.dir=E:/bitcoin

```

LND files, on the other hand, are in Appdata/local/lnd.

**Tags:** bitcoin-core, lightning-network, wallet.dat, lightning-network-daemon, windows


---

## 1 answers

### Answer by username_1 on 2023-10-30. Score: 1

Use Microsoft's [Handle](https://learn.microsoft.com/en-us/sysinternals/downloads/handle) tool to see what files are open, and add the details to your question (You can limit the output to a specific folder or keyword such as 'bitcoin' by running the tool like this:

```shell
handle.exe E:\bitcoin

```

That will tell you all the files existing in `E:\bitcoin` that are open, and which process has them open. That should allow you to narrow down what process is causing bitcoin-qt to report that error.

If `handle` shows no open files, then perhaps you have a permissions issue - i.e. maybe bitcoin-qt can't open the wallet.dat due to limited permissions. Use `icacls.exe e:\bitcoin` to check permissions.


---

