jxpeng98 / obsidian-to-NotionNext

Share obsidian markdown file to any Notion database and generate notion share link 同步obsdian文件到任意Notion数据库。
GNU General Public License v3.0
33 stars 3 forks source link

network error Error: Request failed, status 400 #22

Open mitchmeister opened 4 weeks ago

mitchmeister commented 4 weeks ago

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
mitchmeister commented 3 weeks ago

Hi. Anyone monitoring repository issues?

jxpeng98 commented 2 weeks ago

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.

jxpeng98 commented 1 week ago

@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.

jxpeng98 commented 1 week ago

23

mitchmeister commented 1 week ago

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

jxpeng98 commented 1 week ago

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.

mitchmeister commented 6 days ago

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
jxpeng98 commented 2 days ago

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.

mitchmeister commented 1 day ago

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.

jxpeng98 commented 1 day ago

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:

https://github.com/user-attachments/assets/afe888ff-631a-487b-881e-aa06e701d892

This is an update sync:

https://github.com/user-attachments/assets/bd9132a8-3fb4-4252-bdaa-3d89754ee5d3

mitchmeister commented 20 hours ago

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.

jxpeng98 commented 8 hours ago

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.