darobin / notion-backup

Simple command to backup a Notion workspace
MIT License
425 stars 63 forks source link

Error at the "Run backup" step #4

Closed MahShaaban closed 3 years ago

MahShaaban commented 3 years ago

I am recieving this error at the "Run backup" step.

Run notion-backup
  notion-backup
  shell: /usr/bin/bash -e {0}
  env:
    NOTION_TOKEN: ***
    NOTION_SPACE_ID: ***
Enqueued task <enqueued_task>
TypeError: Cannot read property 'pagesExported' of undefined
    at exportFromNotion (/opt/hostedtoolcache/node/12.22.1/x64/lib/node_modules/notion-backup/notion-backup.js:61:51)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async run (/opt/hostedtoolcache/node/12.22.1/x64/lib/node_modules/notion-backup/notion-backup.js:90:3)
Error: Process completed with exit code 1.
Fengyee commented 3 years ago

I tried and found out that removing the quote mark in the TOKEN and SPACE_ID string resolves this problem

MahShaaban commented 3 years ago

Thanks @Fengyee. Removing the quote marks solved the issue. I had to run it twice before it could work without error. Not sure if this is related though.

davzaman commented 2 years ago

I don't have quote marks in my secrets for the token and space id. However, the job fails everytime I run it, and I always need to rerun the job manually for it to work. This kind of defeats the purpose of an automatic backup, any ideas?

darobin commented 2 years ago

What error are you getting?

-- Robin Berjon VP Data Governance The New York Times On December 29, 2021 12:52:57 Davina Zaman @.***> wrote:

I don't have quote marks in my secrets for the token and space id. However, the job fails everytime I run it, and I always need to rerun the job manually for it to work. This kind of defeats the purpose of an automatic backup, any ideas? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

davzaman commented 2 years ago

I'm getting the same error as reported above.

darobin commented 2 years ago

I managed to get the same error once, but then it just disappeared. I think it's a transient problem with how Notion reports the status of open tasks. I have been adding code to handle those cases better in 1.3.0. Let's see if it works. Sorry I can't be more definitive, it's hard to fix this without being able to reproduce it reliably, or even often.

davzaman commented 2 years ago

Gotcha, I understand. It seems to be helpful! After 2 failed scheduled job attempts, it succeeded the other day, I'm assuming after your update. I appreciate it, if I continue to have problems I'll check in in a bit. Happy new year!