Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contact database not found - potential fix in description #76

Open
achalddave opened this issue Nov 26, 2023 · 9 comments
Open

contact database not found - potential fix in description #76

achalddave opened this issue Nov 26, 2023 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@achalddave
Copy link

Thanks for this great tool! I received the following error when using this with the latest version of WhatsApp: "Contact database not found." I think the uuid(?) for the contacts db in whatsapp may have changed.

Changing this line:

CONTACT = "b8548dc30aa1030df0ce18ef08b882cf7ab5212f"

from

    CONTACT = "b8548dc30aa1030df0ce18ef08b882cf7ab5212f"

to

    CONTACT = "016df2e52e5bfaa000f98a1dbe5c40cd6dc7f657"

fixed the issue for me. I'm not sure if this is a general fix, so I'm not submitting a PR, but opening this issue in case anyone else runs into it.

@achalddave achalddave reopened this Nov 26, 2023
@achalddave achalddave changed the title contact database not found contact database not found - potential fix in description Nov 26, 2023
@KnugiHK
Copy link
Owner

KnugiHK commented Nov 27, 2023

I currently don't have access to the latest iOS WhatsApp. Once it has been confirmed, I will make changes to the code. Thanks for your report and the potential fix anyway!

@KnugiHK KnugiHK added the enhancement New feature or request label Dec 3, 2023
@KnugiHK KnugiHK self-assigned this Dec 3, 2023
@SvenHerr
Copy link

@achalddave how did you know that this is the new db ? i cant find 016df2e52e5bfaa000f98a1dbe5c40cd6dc7f657 with the version 17.2.1

@achalddave
Copy link
Author

I'm sure there's a better way, but I went to the path to my Manifest.db, which was in a path like: ~/Library/Application Support/MobileSync/Backup/<numbers>/Manifest.db, and then ran:

~ sqlite3 Manifest.db
SQLite version 3.39.5 2022-10-14 20:58:05
Enter ".help" for usage hints.
sqlite> select * from files;

This printed a bunch of tables, and I looked for one which said ContactsV2.sqlite, and copied the hash at the start of that line.

@KnugiHK
Copy link
Owner

KnugiHK commented Jan 2, 2024

I'm sure there's a better way, but I went to the path to my Manifest.db, which was in a path like: ~/Library/Application Support/MobileSync/Backup/<numbers>/Manifest.db, and then ran:

~ sqlite3 Manifest.db
SQLite version 3.39.5 2022-10-14 20:58:05
Enter ".help" for usage hints.
sqlite> select * from files;

This printed a bunch of tables, and I looked for one which said ContactsV2.sqlite, and copied the hash at the start of that line.

This is the correct way to find a file inside an iOS backup.

@SvenHerr
Copy link

SvenHerr commented Jan 3, 2024

thank you for your reply. I just looked throu all files with .sqlite and i cant find any db with contacts.

@Rerebla
Copy link

Rerebla commented Jan 9, 2024

I get the same error "Contact database not found". Running the program with the default or the suggested fix results in the same error. I couldn't find any ContactsV2 or anything containing 'contacts' related to WhatsApp (just blockedContacts.dat).

@angelbanderasudg
Copy link

@Rerebla The file with blockedContacts.dat was the only one that appeared, but it used it and worked.

After following the steps of searching it with sqlite3, the complete line is this:
4c6a43645ed0557e7ea2ebb662ef8a2c81b505b8|AppDomain-net.whatsapp.WhatsApp|Documents/blockedcontacts.dat|1|bplist00?

You only need the first part: 4c6a43645ed0557e7ea2ebb662ef8a2c81b505b8

The file to modify, like I have the installation of python in the default directory, the path is: /Users/your_username/Library/Python/3.9/lib/python/site-packages/Whatsapp_Chat_Exporter/utility.py

My WhatsApp version is 23.23.79

@roisec
Copy link

roisec commented Feb 27, 2024

@angelbanderasudg it's solved the issue but after I have another issue
Unexpected contact format: broadcast

  File "/Users//repos/iphone/lib/python3.11/site-packages/Whatsapp_Chat_Exporter/__main__.py", line 425, in main
    create_html(
  File "/Users//repos/iphone/lib/python3.11/site-packages/Whatsapp_Chat_Exporter/android_handler.py", line 753, in create_html
    safe_file_name, name = get_file_name(contact, chat)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users//repos/iphone/lib/python3.11/site-packages/Whatsapp_Chat_Exporter/utility.py", line 141, in get_file_name
    raise ValueError("Unexpected contact format: " + contact)
ValueError: Unexpected contact format: broadcast

@jpfleischer
Copy link

please merge @angelbanderasudg 's fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants