vzhd1701 / evernote-backup

Backup & export all Evernote notes and notebooks
MIT License
876 stars 68 forks source link

[Bug]: init-db got error while --backend china #70

Open laodouya opened 6 months ago

laodouya commented 6 months ago

evernote-backup version

1.9.3

What OS are you using?

MacOS

OS Version / Linux distribution

14.2.1

Bug description

The evernote-backup was installed using brew install. After running evernote-backup init-db --backend china, entering the email and password results in the program throwing an error directly.

Log excerpt

evernote-backup init-db --backend china
Logging in to Evernote...
Username or Email: xxxx@xx.com
Password: 
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote/edam/userstore/UserStore.py", line 779, in recv_authenticateLongSession
    raise result.userException
evernote.edam.error.ttypes.EDAMUserException: EDAMUserException(errorCode=8, parameter='consumerKey')
tainanl commented 6 months ago

I got the same error. evernote-backup version 1.9.3

What OS are you using? Linux

python 3.8.10

test@test-pc:~$ evernote-backup init-db --backend china
Logging in to Evernote...
Username or Email: xxxxxx@xx.com
Password: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/cli.py", line 158, in init_db
    cli_app.init_db(
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/cli_app.py", line 38, in init_db
    auth_token = get_auth_token(
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
  File "/usr/local/lib/python3.8/dist-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/lib/python3.8/dist-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2
    return self.recv_authenticateLongSession()
  File "/usr/local/lib/python3.8/dist-packages/evernote/edam/userstore/UserStore.py", line 779, in recv_authenticateLongSession
    raise result.userException
evernote.edam.error.ttypes.EDAMUserException: EDAMUserException(errorCode=8, parameter='consumerKey')
fangxia- commented 6 months ago

When I run the following instruction, I get a similar exception

evernote-backup version 1.9.3

What OS are you using? Mac OS 13.5.1 python3.9


evernote-backup init-db --backend china --force

Logging in to Evernote... Username or Email: my-email@xxx.com Password: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/evernote_backup/cli.py", line 305, in main cli() File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/usr/local/lib/python3.9/site-packages/evernote_backup/cli.py", line 158, in init_db cli_app.init_db( File "/usr/local/lib/python3.9/site-packages/evernote_backup/cli_app.py", line 38, in init_db auth_token = get_auth_token( File "/usr/local/lib/python3.9/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token return evernote_login_password( File "/usr/local/lib/python3.9/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/lib/python3.9/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login return self.user_store.authenticateLongSessionV2( File "/usr/local/lib/python3.9/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper return target_method_retry(*args, *kwargs) File "/usr/local/lib/python3.9/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper return fun(args, kwargs) File "/usr/local/lib/python3.9/site-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2 return self.recv_authenticateLongSession() File "/usr/local/lib/python3.9/site-packages/evernote/edam/userstore/UserStore.py", line 779, in recv_authenticateLongSession raise result.userException evernote.edam.error.ttypes.EDAMUserException: EDAMUserException(errorCode=8, parameter='consumerKey')

Jason11Q commented 6 months ago

me too, same error when run it in win11.

J2eremy commented 5 months ago

me too

liqingfeng-ola commented 5 months ago

me too, on MacOS

timelic commented 5 months ago

same issue

labixx21 commented 5 months ago

me too, on MacOS

lethefrost commented 5 months ago

The same happens when running evernote-backup reauth... I found this documentation, not sure if it helps.

lethefrost commented 5 months ago

Hi @vzhd1701 , could you probably take a look at this issue? Your time and effort is greatly appreciated! We are not sure what's going wrong with the consumerKey. Is your developer API key expired or something? Did they change the API? Thank you so much for making this awesome library😊

marchanbbb commented 5 months ago

me too, on MacOS

ymm135 commented 4 months ago

me too on win11 @vzhd1701

ymm135 commented 4 months ago

不用等了,可以直接用历史版本导出就行,应该是2022年7月后版本不支持. 我下载印象笔记v6.22.60.4452就可以导出enex

lethefrost commented 4 months ago

I'm not sure why @facker289 's post was deleted, maybe it's because they harshly criticized yinxiangbiji's CEO 😂 But thank you so much it really works!🥹🥹 I'm finally able to get my notes synced with local database again after a long time!

It's a pity that post was gone. I'd just repeat here what they suggested, to help anyone else in need.

They pointed out that yinxiangbiji might has changed the tokens' policy. Exporting is no longer available using normal user login tokens. Follow the steps below to export your notes (or use the dev token as the authenticationToken parameter in any API).

  1. Get your developer token via this link - you will need to log in on the webpage and the token will expire after 7 days.
  2. Call evernote-backup commands with options -t or --token, followed by your developer token as its argument. So your command might look like one of the following:
    • evernote-backup init-db --backend china -t <your_developer_token>
    • evernote-backup reauth --token <your_developer_token>
  3. Now you can successfully run evernote-backup sync as you want!
caiuskong commented 4 months ago

Syncing user notebooks... Rate limit reached. Restart program in 39:27.

blurm commented 3 months ago

@lethefrost Same error as @caiuskong

Syncing user notebooks...
  [####################################]  45571/45571
1084 note(s) to download...
Downloading 1084 note(s)...
  [################--------------------]  484/1084  00:03:28Exception caught while downloading note 'Back Workout'!
Aborting, please wait...

Rate limit reached. Restart program in 43:31.
lethefrost commented 3 months ago

@lethefrost Same error as @caiuskong

Syncing user notebooks...
  [####################################]  45571/45571
1084 note(s) to download...
Downloading 1084 note(s)...
  [################--------------------]  484/1084  00:03:28Exception caught while downloading note 'Back Workout'!
Aborting, please wait...

Rate limit reached. Restart program in 43:31.

Seems like it's the first time you run this command? I believe this is because you are downloading too many notes at one time and reached their servers' limit for that. You can try again later - the evernote-backup sync command is designed for differential/incremental synchronization, which means it should be able to resume from the stop point of your last downloading task, instead of from the very beginning. Let't me know if you're able to download the rest of the notes.

icahuang commented 3 months ago

I'm not sure why @facker289 's post was deleted, maybe it's because they harshly criticized yinxiangbiji's CEO 😂 But thank you so much it really works!🥹🥹 I'm finally able to get my notes synced with local database again after a long time!

It's a pity that post was gone. I'd just repeat here what they suggested, to help anyone else in need.

They pointed out that yinxiangbiji might has changed the tokens' policy. Exporting is no longer available using normal user login tokens. Follow the steps below to export your notes (or use the dev token as the authenticationToken parameter in any API).

  1. Get your developer token via this link - you will need to log in on the webpage and the token will expire after 7 days.
  2. Call evernote-backup commands with options -t or --token, followed by your developer token as its argument. So your command might look like one of the following:

    • evernote-backup init-db --backend china -t <your_developer_token>
    • evernote-backup reauth --token <your_developer_token>
  3. Now you can successfully run evernote-backup sync as you want!

It works. Thanks for ur help! And yes for sure the CEO SUCKS.

xjqwexj commented 2 months ago

我不知道为什么@facker289帖子被删了,可能是因为他们严厉批评了印象笔记的CEO吧😂不过还是非常感谢,真的有用!🥹🥹时隔这么久,我的笔记终于可以再次同步到本地数据库了! 可惜那个帖子不见了。我只是在这里重复他们的建议,以帮助其他有需要的人。 他们指出,银象笔记可能改变了代币的政策。无法再使用普通用户登录令牌进行导出。按照以下步骤导出您的笔记(或使用开发令牌作为authenticationToken任何 API 中的参数)。

  1. 通过此链接获取您的开发者令牌- 您需要登录网页,令牌将在 7 天后过期。
  2. 使用选项或调用evernote-backup命令,后跟您的开发人员令牌作为其参数。因此您的命令可能类似于以下命令之一:-t``--token

    • evernote-backup init-db --backend china -t <your_developer_token>
    • evernote-backup reauth --token <your_developer_token>
  3. 现在你可以evernote-backup sync按照你想要的方式成功运行了!

有用。感谢你的帮助! 是的,首席执行官肯定很糟糕。

why "sqlite3.OperationalError: unable to open database file"??

Fisherworks commented 4 weeks ago

I'm not sure why @facker289 's post was deleted, maybe it's because they harshly criticized yinxiangbiji's CEO 😂 But thank you so much it really works!🥹🥹 I'm finally able to get my notes synced with local database again after a long time!

It's a pity that post was gone. I'd just repeat here what they suggested, to help anyone else in need.

They pointed out that yinxiangbiji might has changed the tokens' policy. Exporting is no longer available using normal user login tokens. Follow the steps below to export your notes (or use the dev token as the authenticationToken parameter in any API).

  1. Get your developer token via this link - you will need to log in on the webpage and the token will expire after 7 days.
  2. Call evernote-backup commands with options -t or --token, followed by your developer token as its argument. So your command might look like one of the following:

    • evernote-backup init-db --backend china -t <your_developer_token>
    • evernote-backup reauth --token <your_developer_token>
  3. Now you can successfully run evernote-backup sync as you want!

I'm glad that it's still working

caiuskong commented 3 weeks ago

Reading database en_backup.db... Authorizing auth token, china backend... Successfully authenticated as 1032316751! Current login will expire at 2024-07-09 06:29:09. Syncing user notebooks... Rate limit reached. Restart program in 26:19.