jxpeng98/obsidian-to-NotionNext

network error Error: Request failed, status 400

Opened this issue ยท 17 comments

I am trying to use Share to NotionNet with a custom database and getting this error.

SCR-20240618-otep

It worked once but hasn't worked since.


Aside:

  1. For a Custom database does the title of the Notion note have to be a property? Can't it be just the title of the note?
  2. It doesn't seem possible to add, edit or delete properties once its set up. I think this is essential

Hi. Anyone monitoring repository issues?

Hi. Anyone monitoring repository issues?

@mitchmeister
Sorry for the late reply. 400 means the frontmatter that you provided is not matched with the Notion database.

When you create a custom database, the first one should always match with the title or name that you can click to open the notion page.

For now, the edit function has not been developed well. It will be improved in the next few updates.

@mitchmeister This issue has been fixed.

It may be caused that you created one or more properties. However, you did not include all properties in the front matter in .md.

In the new version, these missed properties will be ignored.

Tried that thanks.

I got one task to partially sync, but it didn't copy across the note name.

SCR-20240705-irvm SCR-20240705-iswb

then tried on another note & got a 400 error again. Not sure if this is a config error or something else.

SCR-20240705-isjn

SCR-20240705-ittw

Hi,

This is because you do not recreate the database after you update to the latest version of the plugin. The new version uses a new mapping index, which is not included in the version before 2.3.0.

Once you updated to the latest version, try to reconstruct the database. The title columns should only have one choice:
image

Also, you have Name in your Notion database.
image

You should use the same Name as the title column in your obsidian setting.

If you have any questions, please let me know.

I tried again and get the 404 error. The lack of documentation & useful feedback & the fragility of the setup process make it too hard. Its a shame because this plugin would offer lots of value to lots of people if it worked. Is there a debug log somewhere to help with troubleshooting?

Followed your instructions but got this old error.
SCR-20240711-prri-2

Hi, I updated the readme file with instructions from the beginning.

You'll be able to follow the steps to check.

Usually, you will receive a 400 error if you do not set the properties correctly.

404 means that you provided the wrong database ID.

I will update the plugin with better debugging.

Thanks for your continuing help. Your instructions are much clearer now.

I have "upgraded" from a 404 error to a 400 error
SCR-20240716-mkjm

Here is my setup
SCR-20240716-mkws

And here is my Notion database
SCR-20240716-mldv

I'm not clear from your instructions what the first column of the database should be as earlier in your instructions you suggest changing form "Name" to "title". I have tried both but neither works.

Hi, sorry for the misunderstanding. I changed the name in the instructions since I want to show how the plugin corresponds to the notion properties.

According to your notion database, You only need to set up the following properties in the obsidian setting:

Title column: Name - Title
Property 1: tags - Multi-select
Property 2: dodate - Date
Property 3: when - Select

image

In your note front matter, add the following:

---
Name: test-title
tags [test, test1]
dodate: 2024-07-15
when: Draft
---

this is a test file.

This is the first sync:

Recording.at.2024-07-16.09.43.44.mp4

This is an update sync:

Recording.at.2024-07-16.09.44.25.mp4

I added the tags property & it worked! yay.

I didn't have to add a Name property to my Obsidian note (which I'm glad of as I would prefer it just uses the note name as apparently it does)

Really grateful for your help in getting this working.

Question: Is there any plan to support images in the future?

Thanks again.

PS. This is currently the gold standard in terms of rendering an Obsidian note to the web.

I added the tags property & it worked! yay.

I didn't have to add a Name property to my Obsidian note (which I'm glad of as I would prefer it just uses the note name as apparently it does)

Really grateful for your help in getting this working.

Question: Is there any plan to support images in the future?

Thanks again.

PS. This is currently the gold standard in terms of rendering an Obsidian note to the web.

I am glad that your problem has been solved.

For the images, Notion refuses to upload files, images and other media via Notion API.
image

However, you can try hosting the image or media via an image host service, such as Imgur, etc.

You just need to add the image URL and sync. It will recognise and sync the image to Notion automatically.

Please please add some helpful messages instead of 400 or 404. The plugin is super-fragile & when it doesn't work its near impossible to understand whats not working.

I had it working. I added another property to sync. IT 400-ed. I deleted the setup & recreated. 400 again. I don't know whats not working.

I've also had the situation where a particular (long) note wouldn't sync. I deleted the sedond half of the note & it did. Not sure why.

(When it does work its wonderful!). Thank you for your continued support.

Please please add some helpful messages instead of 400 or 404. The plugin is super-fragile & when it doesn't work its near impossible to understand whats not working.

I had it working. I added another property to sync. IT 400-ed. I deleted the setup & recreated. 400 again. I don't know whats not working.

I've also had the situation where a particular (long) note wouldn't sync. I deleted the sedond half of the note & it did. Not sure why.

(When it does work its wonderful!). Thank you for your continued support.

Hi,

I will add better debug in the next update.

๐Ÿ™๐Ÿป

@mitchmeister

Try the latest version 2.3.4. You should see the message in the console if you have errors.

๐Ÿ‘๐Ÿป ๐Ÿ™๐Ÿป