Jump to content

Database locked


dogtoe23

Recommended Posts

I am trying to clear the list of collected SSIDs, but it says 'database locked'. Any ideas? What database is the MarkVII using and where is it located? Should I just factory reset the device? If so, is there a way to do so without downloading/installing new firmware, since the device functions otherwise? I have had to do that process twice in six months and it is getting old, lol. Any ideas welcome, thanks.
Link to comment
Share on other sites

Not sure in which situation you get the "database locked" message, but the ESSIDs are stored in /etc/pineapple/pineapple.db which is a SQLite/SQLite3 database. If not using the web UI to delete ESSIDs, then the "official" way of doing it via CLI/terminal is to use the pineap command. More specifically:
del_ssid [ssid]
and/or
del_ssid_file [file with list of ssids]

Another way (probably unsupported) is to edit the pineapple.db file directly. Either copy the file to a PC and use the "DB Browser for SQLite" software (at least on Linux) or use Python (either directly on the Pineapple or on some PC) and edit the db file. I've never tried it on the Pineapple itself (just on PCs), but if you want to try then you probably need to install python3-sqlite3.

opkg update
opkg install python3-sqlite3

Doing the "hacker version" (the non official one) of editing the db file, make sure that any interaction with the db file from the web UI is disabled (such as actively collecting ESSIDs to the pool).

This is some sample Python code to read the stored ESSIDs from the db file.

#!/usr/bin/python3

import sqlite3

conn = sqlite3.connect('/etc/pineapple/pineapple.db')

cursor = conn.execute("SELECT ssid FROM ssids")

for row in cursor:
    print(row[0])
    
conn.close()

 

Since you want to remove ESSIDs, you should probably use DELETE and VACUUM.

Or, use a combination; a) read out the contents using Python as per above to a file and b) use pineap to delete it all by supplying the created file as an option along with the "del_ssid_file" parameter.

Link to comment
Share on other sites

Thanks for your reply. I am getting the 'database locked' error when trying to clear the SSID pool via the GUI. I thought there may be a way to clear the database via terminal, but I am not familiar with the backend of the pineapple and couldn't find documentation. I will try your solutions.
Is there documentation of the back-end/software components of the pineapple to use for troubleshooting?
Also, can you confirm the only way to complete a factory reset is to reinstall the firmware? Thanks for your help.
Link to comment
Share on other sites

The factory reset procedure is described in the docs, that's the proper way the Pineapple should be factory reset.

https://docs.hak5.org/wifi-pineapple/faq/factory-reset-and-recovery

The only documentation that I know of that relates to the CLI for the Pineapple is the one covering pineap. The link below is for the previous generation of the Pineapple, but still valid.

https://docs.hak5.org/wifi-pineapple-6th-gen-nano-tetra/console-access/working-with-pineap-from-the-cli

Other than that, the Pineapple is based on OpenWrt, so studying the documentation on the OpenWrt web site covers a lot that's needed to know about what happens behind the web UI.

https://openwrt.org/docs/start

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...