evernote-backup icon indicating copy to clipboard operation
evernote-backup copied to clipboard

[Bug]: just errors?

Open StefanLindow opened this issue 1 year ago • 7 comments

evernote-backup version

1.9.3

What OS are you using?

MacOS

OS Version / Linux distribution

MacOS 13.6.9

Bug description

  • after install (via brew) I wanted to init-db, see log for what came back
  • I tried:
  1. putting username/password into command
  2. reinstalling python
  3. reinstalling evernote-backup

Log excerpt

File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 158, in init_db
    cli_app.init_db(
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app.py", line 38, in init_db
    auth_token = get_auth_token(
                 ^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2
    return self.recv_authenticateLongSession()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote/edam/userstore/UserStore.py", line 772, in recv_authenticateLongSession
    raise x
thrift.Thrift.TApplicationException: <exception str() failed>

StefanLindow avatar Sep 25 '24 10:09 StefanLindow

oh, should this be in the discussions?

StefanLindow avatar Sep 25 '24 10:09 StefanLindow

After an install from Homebrew, I did

mkdir evernoteBackup
cd evernoteBackup
evernote-backup init-db --oauth -d ./en_db/en_backup.db
evernote-backup sync -d ./en_db/en_backup.db

where evernoteBackup was the directory I chose to put things. The --oauth line launches a browser (or something I don't remember now) to carry out the authentication step even though I was not using a Google or Apple account for Evernote.

dgreen avatar Sep 25 '24 21:09 dgreen

thank you. I used this, the browser launch and I could login. however, database initialisation did not work.

Current login will expire at 2025-09-26 06:30:52. Initializing database en_backup.db... Traceback (most recent call last): File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 305, in main cli() File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1157, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 158, in init_db cli_app.init_db( File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app.py", line 50, in init_db storage = initialize_storage(database, force) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app_storage.py", line 52, in initialize_storage initialize_db(database_path) File "/usr/local/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/note_storage.py", line 64, in initialize_db db = sqlite3.connect(database_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file

StefanLindow avatar Sep 26 '24 06:09 StefanLindow

Sorry, it looks like I did not update my notes quite right, I think you will need to also make en_db

mkdir evernoteBackup
cd evernoteBackup
mkdir en_db
evernote-backup init-db --oauth -d ./en_db/en_backup.db
evernote-backup sync -d ./en_db/en_backup.db

dgreen avatar Sep 26 '24 08:09 dgreen

works.

(however, not I get a "Rate limit reached" after a while)

StefanLindow avatar Sep 26 '24 10:09 StefanLindow

Thank you dgreen!! This appears to be working for me too.

BTW I ran the sync command w/o the command extensions and that worked. I was getting a "database already exist" error when the command extenions were included.

Update: This worked for me. All of my Evernote folders/notes were exported as ENEX files, one for each folder. Thank you!!

wingman301 avatar Oct 05 '24 05:10 wingman301

I can't get past this error.

windows cmd: evernote-backup init-db --oauth -d ./en_db/en_backup.db

File "...\AppData\Local\Programs\Python\Python312\Lib\site-packages\thrift\compat.py", line 45, in str_to_binary return bytes(str_val, 'utf8') ^^^^^^^^^^^^^^^^^^^^^^ TypeError: encoding without a string argument

zieglerjm avatar Oct 10 '24 17:10 zieglerjm

i have same error,Have you solved the problem yet?

YohanLiu avatar Nov 08 '24 08:11 YohanLiu

Have you tried expressing the path in windows format?

instead of

evernote-backup init-db --oauth -d ./en_db/en_backup.db

using

evernote-backup init-db --oauth -d .\en_db\en_backup.db

dgreen avatar Nov 08 '24 13:11 dgreen

i have same error,Have you solved the problem yet?

After creating the "en_db" folder, just saw that on this thread, now I am getting a "SSL: Certificate_Verify_Failed" error.

To fix that, create: c:\ProgramData\pip\pip.ini [global] trusted-host = www.evernote.com

zieglerjm avatar Nov 08 '24 13:11 zieglerjm

i use yinxiangbiji not evernote

YohanLiu avatar Nov 09 '24 10:11 YohanLiu

Sorry, it looks like I did not update my notes quite right, I think you will need to also make en_db

mkdir evernoteBackup
cd evernoteBackup
mkdir en_db
evernote-backup init-db --oauth -d ./en_db/en_backup.db
evernote-backup sync -d ./en_db/en_backup.db

Thanks -- this worked for me today. I just wanted to add the next step for anyone else who was stuck:

evernote-backup export -d en_db/en_backup.db export/ (I put my exported .enex files in a subdirectory called "export")

rjl77 avatar Nov 09 '24 17:11 rjl77

Thank you to @dgreen and @rjl77 whose comments helped me quickly export my Evernote to my local system!

So I am adding export to Markdown instructions to their steps to finish what my objective was. I did this on Mac Sequoia 15.2 Intel i9, only this and the evernote2md package both installed via brew.

Backup and export Evernote to ENEX

mkdir evernoteBackup
cd evernoteBackup
mkdir en_db
evernote-backup init-db --oauth -d ./en_db/en_backup.db
evernote-backup sync -d ./en_db/en_backup.db
evernote-backup export -d en_db/en_backup.db export/

ENEX to Markdown

I then used evernote2md from https://github.com/wormi4ok/evernote2md to export to markdown in a folder called evernoteBackup\enex2md\. I added Front Matter option so details for each note are within the note.

for enex_file in export/*.enex; do
    # Get the base name without extension
    base_name=$(basename "$enex_file" .enex)
    # Create directory
    mkdir -p "enex2md/$base_name"
    # Convert the file
    evernote2md "$enex_file" -o "enex2md/$base_name" --addFrontMatter
    echo "Processed: $base_name"
done

Browsing Notes locally

I used JetBrain's Webstorm, which is currently free for non-commercial use, to browse the evernoteBackup\enex2md folder more-or-less mimicking Evernote UI.

I hope this helps someone else!

babul avatar Dec 16 '24 01:12 babul

Fixed in the new version. OAuth will be used by default now, username/password login API is disabled by Evernote.

vzhd1701 avatar Apr 06 '25 16:04 vzhd1701