jckleiner / notion-backup

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

Notion API workspace export returned a 'failure' state. Reason: Invalid input. #11

Closed orellazri closed 9 months ago

orellazri commented 11 months ago

Hi. First of all, thanks for making this great tool! I've been using it for so long and it works really well. Today I encountered an issue when trying to run it:

06:20:31.231 [main] INFO com.greydev.notionbackup.NotionBackup - ---------------- Starting Notion Backup ----------------
06:20:31.789 [main] INFO com.greydev.notionbackup.NotionClient - DOWNLOADS_DIRECTORY_PATH is not set. Downloads will be saved to: /downloads
06:20:31.791 [main] INFO com.greydev.notionbackup.NotionClient - Using export type: html
06:20:31.792 [main] INFO com.greydev.notionbackup.NotionClient - Flatten export file tree: false
06:20:32.624 [main] INFO com.greydev.notionbackup.NotionClient - taskId extracted
06:21:02.285 [main] INFO com.greydev.notionbackup.NotionClient - Notion API workspace export returned a 'failure' state. Reason: Invalid input.
06:21:02.286 [main] INFO com.greydev.notionbackup.NotionClient - downloadLink could not be extracted
Exception in thread "main" java.lang.IllegalStateException: Could not export notion file
        at com.greydev.notionbackup.NotionBackup.lambda$main$0(NotionBackup.java:57)
        at java.base/java.util.Optional.orElseThrow(Optional.java:408)
        at com.greydev.notionbackup.NotionBackup.main(NotionBackup.java:57)

From a brief look at the code, it seems to fail in getDownloadLink: https://github.com/jckleiner/notion-backup/blob/25265a34548d271d6d8c36259c54eebe3ed41083/src/main/java/com/greydev/notionbackup/NotionClient.java#L186

For context, I'm running it via the docker container. This error happens both with markdown and html. I also tried setting the v2 token again, but it doesn't seem to be related.

jmanek commented 11 months ago

The PR by @orellazri resolved this issue for me as well.