richartkeil / notion-guardian

🛡✍️ Keeps your Notion workspace safe and version controlled at all times.
MIT License
143 stars 119 forks source link

AxiosError: Request failed with status code 400 #13

Closed alice-rosen closed 1 year ago

alice-rosen commented 1 year ago

Hi @richartkeil

I have been using a fork of notion-guardian (notion-backup), but since yesterday the backup has been failing with this error:

AxiosError: Request failed with status code 400

Details (sanitized) - I'm not sure if this is what you need or not:

headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      Cookie: 'token_v2=***',
      'User-Agent': 'axios/1.3.5',
      'Content-Length': '197',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    baseURL: 'https://www.notion.so/api/v3',
    method: 'post',
    url: 'enqueueTask',
    data: '{"task":{"eventName":"exportBlock","request":{"blockId":"xxxxxxxx-xxxx-x[xx](https://github.com/alice-rosen/notion-dphil-automated/actions/runs/xxxxxxxxxx/jobs/xxxxxxxxxx#step:6:43)x-xxxx-xxxxxxxxxxxx","exportOptions":{"exportType":"markdown","locale":"en","timeZone":"Europe/Vienna"},"recursive":true}}}'
  },

And response details:

 response: {
     status: 400,
     statusText: 'Bad Request',

Apologies, this is my first time posting an issue, so please let me know if you need more info. Let me know if you have any ideas or if there is anything not too complicated I could try :)

richartkeil commented 1 year ago

Hi @alice-rosen, it seems @karlhorky just fixed the issue in commit https://github.com/upleveled/notion-backup/commit/3a5ed8b65d91007932dcbf7453a4229c1edcf876, can you fetch the latest changes and retry?

karlhorky commented 1 year ago

I forgot that notion-guardian takes a different approach, which includes the user already setting the NOTION_SPACE_ID.

So I think notion-guardian may not have the same bug that notion-backup did.

Now that notion-backup has been fixed in https://github.com/upleveled/notion-backup/commit/3a5ed8b65d91007932dcbf7453a4229c1edcf876 (more details) and since notion-guardian probably is not affected by this, maybe this issue can be closed?

richartkeil commented 1 year ago

Sounds good, closing this for now as it seems to be fixed. @alice-rosen just comment or open a new issue if necessary.