jckleiner / notion-backup

Automatic Notion workspace backup to Google Drive, Dropbox, pCloud, Nextcloud or to your local machine.
86 stars 33 forks source link

Error - no value present #7

Closed s-dziedzic closed 1 year ago

s-dziedzic commented 1 year ago

I try to do local backup. All required variables in env file are set up.

11:49:06.984 [main] INFO com.greydev.notionbackup.NotionBackup - ---------------- Starting Notion Backup ---------------- 11:49:07.162 [main] INFO com.greydev.notionbackup.NotionClient - DOWNLOADS_DIRECTORY_PATH is not set. Downloads will be saved to: /downloads 11:49:07.162 [main] INFO com.greydev.notionbackup.NotionClient - Using export type: markdown 11:49:07.162 [main] INFO com.greydev.notionbackup.NotionClient - Flatten export file tree: false Exception in thread "main" java.util.NoSuchElementException: No value present at java.base/java.util.Optional.orElseThrow(Optional.java:382) at com.greydev.notionbackup.NotionClient.getTokenV2(NotionClient.java:194) at com.greydev.notionbackup.NotionClient.export(NotionClient.java:106) at com.greydev.notionbackup.NotionBackup.main(NotionBackup.java:56)

danielcharrua commented 1 year ago

Same error over here... I think there is a PR opened addressing this issue #8

jckleiner commented 1 year ago

The problem was that Notion changed their API which broke the programatic login. I've updated the tool and documentation to work around this problem. Please see the documentation.

danielcharrua commented 1 year ago

Hey @jckleiner thank you for the update but I think this solution is not maintainable...

We need to fetch the cookie value each time we login-out of notion? This is crazy... Is there any other workaround?

jckleiner commented 1 year ago

@danielcharrua The token is valid (for a year) as long as you don't explicitly logout over the web-UI. So the best workaround I found is just not to logout from the Notion account that you are backing up with this tool. I know, this is not great but unfortunately I did not find any other another solution. If I find something else I'll try to implement it.