SQL Server database tries to restore itself automatically (and gets stuck)
I have a feeling that what you really  have is &quot;recovery pending&quot; and not &quot;restore pending&quot;. If you look at the documentation for sys.databases, the state column, you will see that there isn't a state called &quot;restore pending&quot;. So, I will assume it is indeed &quot;recovery pending&quot; below. If it is anything else, please let us know, show is what it look like in SSMS Object Explorer as well as the state column from sys.databases.
Recovery pending means that SQL server couldn't do recovery at startup of the database. Note that start of the database can happen outside startup of SQL Server. Having the autoclose database option set to true is one such case.
Anyhow, whenever recovery isn't doable, the database goes into recovery pending. But SQL server will document why, in the errorlog file. So your task is to hunt down these error messages and act on them. My guess is that any of the database files are used by some other process (anti-virus, snapshot thingie, etc). But at a later time, the files are accessible to SQL Server.