KnugiHK / WhatsApp-Chat-Exporter

A customizable Android and iOS/iPadOS WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14, Crypt15, and new schema supported.
https://wts.knugi.dev/
MIT License
517 stars 76 forks source link

sqlite3.DatabaseError: authorization denied #59

Closed pimduin closed 11 months ago

pimduin commented 11 months ago

Running the exporter returns the following error:

Traceback (most recent call last):
  File "/Users/p/Library/Python/3.9/bin/wtsexporter", line 8, in <module>
    sys.exit(main())
  File "/Users/p/Library/Python/3.9/lib/python/site-packages/Whatsapp_Chat_Exporter/__main__.py", line 271, in main
    extract_iphone_media.extract_media(args.backup)
  File "/Users/p/Library/Python/3.9/lib/python/site-packages/Whatsapp_Chat_Exporter/extract_iphone_media.py", line 65, in extract_media
    if is_encrypted(base_dir):
  File "/Users/p/Library/Python/3.9/lib/python/site-packages/Whatsapp_Chat_Exporter/extract_iphone_media.py", line 50, in is_encrypted
    with sqlite3.connect(os.path.join(base_dir, "Manifest.db")) as f:
sqlite3.DatabaseError: authorization denied

It's an unencrypted backup, on MacOS.

Trying to opening the Manifest.db using the sqlite3 command does not seem to work. I suspect that may be the cause of the problem (?)

sudo sqlite3 Manifest.db
Password:
Error: unable to open database "Manifest.db": unable to open database file

I have tried deleting the backup, running the backup again, but I seem to get the same errors every time.

KnugiHK commented 11 months ago

Seems to be something related to the security mechanism of macOS. Try to see if access to the directory or file is blocked.

pimduin commented 11 months ago

Thanks! Copying the backup directory to a subfolder of my home folder did the trick. Not sure what was stopping the export from working, but I guess that's a problem on my side rather than a bug in the WhatsApp-Chat-Exporter.