Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

sqlite database locking

Hello!

I've been working on utilizing Powershell Universal Dashboard to create a web interface for PDQ for my IT department to use, but I've been running into some issues with the sql database locking. I've modeled my code after something like this: https://www.pdq.com/blog/export-custom-fields-pdq-inventory-using-powershell-sqlite/

Unfortunately, seemingly at random the code will fail with an error saying that the database is locked. If I'm running the script on my machine, there's a process called "SQLite is an in-process library that implements..." that I cannot end and I usually have to restart the computer, or the PDQ Inventory/Deploy service on the server.

My query looks like this: ActivePackages = (sqlite3.exe "\\(PDQ Server)\C\ProgramData\Admin Arsenal\PDQ Deploy\Database.db" "SELECT DeploymentID, PackageName, Status FROM Deployments WHERE Status <> 'Finished';")

Should I be formatting this in a different way, or is there a setting I can change to eliminate these random database locks?

0

Comments

1 comment
Date Votes
  • I believe I have now fixed the issue by changing the code to: sqlite3.exe -cmd ".bail ON" "\(PDQ Server)\C$\ProgramData\Admin Arsenal\PDQ Deploy\Database.db" "SELECT DeploymentID, PackageName, Status FROM Deployments WHERE Status <> 'Finished';"

    0