omnivore-app / obsidian-omnivore

Obsidian plugin to fetch articles and highlights from Omnivore
MIT License
813 stars 48 forks source link

Failed to fetch articles #65

Closed a-stein closed 1 year ago

a-stein commented 1 year ago

Hi,

I recently updated the Obsidian plugin to 1.3.0. Since then I'm not able to sync any articles at all. I just receive the generic error message Failed to fetch articles. I already tried to reinstall the plugin and also added a new API Key, but this didn't help.

Any ideas?

ms3056 commented 1 year ago

I am getting this problem too. A look at the inspector - this is the article title that is causing an issue:

plugin:obsidian-omnivore:8190 YAMLParseError: Nested mappings are not allowed in compact mappings at line 2, column 8:

title: In Memoriam: Mac | Get Hiroshima
       ^

I think the : and | characters are throwing it off - they are not valid YAML - there needs to be a way to clean these titles I think. In the past these characters would come in and I would clean up the title to make the YAML compliant. Now it looks like they are being blocked.

ms3056 commented 1 year ago

Here is another title throwing the import off: How to Be a Better Manager: The Theory of the Elephant and the Rider | Inc.com

You can edit the title in Omnivore on the web to remove those characters and then bring them in just fine - but I think there should be a way to substitute these characters programmatically.

sywhb commented 1 year ago

Hey @a-stein @ms3056 , firstly, sorry for the inconvenience caused.

I removed the quotes around the title in the YAML of the front matter ("${title}") because some titles also have quotes ("this is a title") which caused the YAML to be invalid. You can refer to this issue #49

Starting from 1.3.0, by default, we will use multiline string > for the title and author in the YAML to prevent escaping issues.

Pleases kindly update your template and use > for the values of string type in the YAML

Below is an example of front matter section in the template setting:

---
id: {{{id}}}
title: >
  {{{title}}}
{{#author}}
author: >
  {{{author}}}
{{/author}}
---
legend053 commented 1 year ago

still not work. same issue

trwolfe commented 1 year ago

still not work. same issue

Can confirm. Also getting fetch issue, even with the > implementation.

sywhb commented 1 year ago

Hey @legend053 @trwolfe , sorry for the mess.

May I have a look at your template settings? If possible, could you also show me a screenshot of the developer console so I could have a better understanding of the error

trwolfe commented 1 year ago

Hey @legend053 @trwolfe , sorry for the mess.

May I have a look at your template settings? If possible, could you also show me a screenshot of the developer console so I could have a better understanding of the error

I only added the {{{content}}} at the end. Is that in the wrong spot?

`--- id: {{{id}}} title: > {{{title}}} {{#author}} author: > {{{author}}} {{/author}} {{#labels.length}} tags: {{#labels}} - {{{name}}} {{/labels}} {{/labels.length}} date_saved: {{{dateSaved}}} {{#datePublished}} date_published: {{{datePublished}}} {{/datePublished}}

{{{title}}}

Omnivore

Read on Omnivore Read Original

{{#highlights.length}}

Highlights

{{#highlights}}

{{{text}}} ‴️ {{#labels}} #{{name}} {{/labels}} {{#note}}

{{{note}}} {{/note}}

{{/highlights}} {{/highlights.length}}

{{{content}}} `

trwolfe commented 1 year ago

Ahhhh, so randomly, I just deleted my entire Omnivore folder from within Obsidian and re-ran the sync and it worked!

sywhb commented 1 year ago

Hey @legend053 @trwolfe , sorry for the mess. May I have a look at your template settings? If possible, could you also show me a screenshot of the developer console so I could have a better understanding of the error

I only added the {{{content}}} at the end. Is that in the wrong spot?

`---

id: {{{id}}} title: > {{{title}}} {{#author}} author: > {{{author}}} {{/author}} {{#labels.length}} tags: {{#labels}} - {{{name}}} {{/labels}} {{/labels.length}} date_saved: {{{dateSaved}}} {{#datePublished}} date_published: {{{datePublished}}} {{/datePublished}}

{{{title}}}

Omnivore

Read on Omnivore Read Original

{{#highlights.length}}

Highlights

{{#highlights}}

{{{text}}} ‴️ {{#labels}} #{{name}} {{/labels}} {{#note}}

{{{note}}} {{/note}}

{{/highlights}} {{/highlights.length}}

{{{content}}} `

Hey @trwolfe , to use multiline string, we need to add two spaces before the {{{title}}} on the next line in the front matter.

This is invalid

title: >
{{{title}}}

And below is valid:

title: >
  {{{title}}}
w36zl commented 1 year ago

Heyy All, also have the fetching problem. I have tried the above strategies without success.

jidloyola commented 1 year ago

I'm experiencing the same issue just today. I have already uninstalled and re-installed Omnivore but I'm still getting the same error. Also, prior to re-installing, I have completely deleted the Omnivore folder from Obsidian.

w36zl commented 1 year ago

For now as a temporary solution, I'm using obsidian46 - BRAT with the add beta plugin with frozen version option version: 1.2.3 and it works fine again πŸ˜ƒ

legend053 commented 1 year ago

For now as a temporary solution, I'm using obsidian46 - BRAT with the add beta plugin with frozen version option version: 1.2.3 and it works fine again πŸ˜ƒ

it works. version 1.2.3 works great. πŸ‘

mwisnefsky commented 1 year ago

For now as a temporary solution, I'm using obsidian46 - BRAT with the add beta plugin with frozen version option version: 1.2.3 and it works fine again πŸ˜ƒ

it works. version 1.2.3 works great. πŸ‘

Confirmed this worked for me as well

ms3056 commented 1 year ago

For me deleting all of the imports in Obsidian and changing the config with this worked fine.

title: >
  {{{title}}}
jidloyola commented 1 year ago

For now as a temporary solution, I'm using obsidian46 - BRAT with the add beta plugin with frozen version option version: 1.2.3 and it works fine again πŸ˜ƒ

Sadly, this did not work for me. :(

EDIT: It worked the second time I did it. Thank you for this workaround.

sywhb commented 1 year ago

Hey guys, sorry for the delay. I have fixed this error in the latest release 1.3.1.

It includes:

Bug Fixes

Feature

Please let me know if it works for you guys and looking forward to your feedback

ms3056 commented 1 year ago

I don't like how the tags are coming in. It messes up all of my Dataview Queries.

I don't like:

tags:

I want

tags: [tag1, tag2, tag3]

Or some other YAML-compliant multiple entry methods.

ms3056 commented 1 year ago

this would work - just remove "name:" for tags please:

tags:

sywhb commented 1 year ago

this would work - just remove "name:" for tags please:

tags: - tag1 - tag2 - tag3

Sorry for the breaking change. I'm working on a fix now

ms3056 commented 1 year ago

no worries. i appreciate the ability to bring Omnivore into Obsidian. Thank you for your hard work.

sywhb commented 1 year ago

Hey @ms3056 , a new version 1.3.2 is released to use below format for the tags in the front matter.

tags:
  - tag1
  - tag2
  - tag3

Could you upgrade your plugin and try again?

ms3056 commented 1 year ago

This has worked for me - thanks!

marcgilgien commented 1 year ago

Hey guys, sorry for the delay. I have fixed this error in the latest release 1.3.1.

It includes:

Bug Fixes

  • Fixed Failed to fetch articles error due to invalid YAML format in the front matter. Now you can define which variables to be used in the front matter

Feature

  • Added a reset template button to reset the template to default

Please let me know if it works for you guys and looking forward to your feedback

This does work. But unfortunatly it prevents you from setting your own keys in fronmatter, like:

created: {{{dateSaved}}}

As I use my own keys this is now unusable to me (Unless I did miss the correct way to do this).

ShaddyDC commented 1 year ago

Can you update the template under this link to include the multiline frontmatter fields?

Unfortunately, it still does not seem to be working for me on 1.3.3 after resetting the template to default. I'm not getting an error, it just seems to be stuck syncing for ever. image

I got some 5xx error with the generic error message Failed to fetch articles of the OP once, but that was over the course of hours, and I forgot making a screenshot or noting the stacktrace. Switching to version 1.2.3 fixed the issue for me as well.

Template ``` # {{{title}}} #Omnivore [Read on Omnivore]({{{omnivoreUrl}}}) [Read Original]({{{originalUrl}}}) {{#highlights.length}} ## Highlights {{#highlights}} > {{{text}}} [‴️]({{{highlightUrl}}}) {{#labels}} #{{name}} {{/labels}} {{#note}} {{{note}}} {{/note}} {{/highlights}} {{/highlights.length}} ```

Edit:

It worked again on the latest version on a different machine I sync the plugin settings to. I haven't investigated what makes the difference.

legend053 commented 1 year ago

version 1.3.3 does not work again on fetching whole articles. It worked before, but failed to fetch articles starting today.

legend053 commented 1 year ago

version 1.3.3 does not work again on fetching whole articles. It worked before, but failed to fetch articles starting today.

I restore it back to 1.2.3. Everything works perfect.

Spatial-Warrior commented 1 year ago

Version 1.3.3 getting "Failed to fetch articles". I reinstalled plugin on Obsidian and generated a new API key but same result. Interestingly it brought across 3 files from archive folder but then same result on refresh. I'd be very grateful if you could find a fix.

ms3056 commented 1 year ago

Version 1.3.3 getting "Failed to fetch articles". I reinstalled plugin on Obsidian and generated a new API key but same result. Interestingly it brought across 3 files from archive folder but then same result on refresh. I'd be very grateful if you could find a fix.

Make sure even when you reinstall that you remove the value of Last Sync in the Omnivore plug-in settings. This tells the plug-in to not bring anything over that is older than that date.

sywhb commented 1 year ago

Hey guys, Omnivore plugin 1.4.0 is out.

I hope it will solve all the issues with parsing YAML in the front matter and the sync will continue even if there was a parsing error.

Additionally, now you can create an alias for the metadata in the front matter in the format of metadata::alias. For example, state::status will create a metadata status to represent the state. The available metadata could be found here.

Screenshot:

Screenshot 2023-05-31 at 4 56 05 PM

Moreover, for users with the need to put hardcoded metadata in the front matter or some other advanced usage, we have added a "front matter template" section under the "Advanced Settings". It will override the "Front matter" if set. Sample template could be found here.

Screenshot:

Screenshot 2023-05-31 at 4 56 17 PM
w36zl commented 1 year ago

Hi All, for some reason I do not understand (on my windows machine) it still notifies failed to fetch articles On my iPhone and iPad the obsidian plugin just works fine.

what I tried till now:

hope that anyone has some idea that can help

legend053 commented 1 year ago

Hi All, for some reason I do not understand (on my windows machine) it still notifies failed to fetch articles On my iPhone and iPad the obsidian plugin just works fine.

what I tried till now:

  • copied the obsidian vault folder of my iphone to my windows machine (with as result: it works shortly and then stops functioning)
  • use the exact same frontmatter template as my iphone obsidian vault
  • tried the standard template from the website
  • deleted the last sync
  • uninstalled and reinstalled

hope that anyone has some idea that can help

Same here. 1.4.0 has this issue too. So far,1.2.3 works best without such issue. So, roll back to version 1.2.3.

jacksonh commented 1 year ago

I need to verify this on Windows, but I believe the issue I've seen is emoji's in titles causing invalid Window's file names.

sywhb commented 1 year ago

Hey @w36zl @legend053 , thanks for reporting.

After some research, we found out that it's the control characters in the filename caused the error on Windows and it has be fixed in the latest version 1.4.1.

Could you please upgrade your plugin and let me know if it works for you?

Thank you!

w36zl commented 1 year ago

That's great! Thank you will check when I returned home 🀩

w36zl commented 1 year ago

Yeeeeey @sywhb 😍😍😍 it's working! Such a joy!! Thank you

SAK59823 commented 1 year ago

I'm experiencing an issue when trying to fetch files with Japanese characters in their filenames using the Omnivore plugin in Obsidian.

The error I encounter is:

Error: EINVAL: invalid argument, open 'H:\Obsidian\Omnivore\2023-06-20\ - Wikipedia.md'

It seems that the Japanese characters are not being included in the filenames.

Example of original file name '( Japanese characters ) - Wikipedia.md' 'γƒ†γ‚―γƒŽγƒ­γ‚ΈγƒΌ - Wikipedia.md'

Link:γƒ†γ‚―γƒŽγƒ­γ‚ΈγƒΌ

The Filename setting in the Omnivore plugin, which I've configured to use {{{title}}} for the file name, appears to be causing this issue. When I adjust this setting to {{{dateSaved}}}, the file fetch is successful, even for webpages with a Japanese title

This problem doesn't occur when the same article is in English.

Link:Technology

sywhb commented 1 year ago

@SAK59823 sorry, there is a bug with the current version and I'm fixing it now. Should be done pretty soon

LightTemplar commented 1 year ago

@sywhb, is it possible to latinize titles for filenames? not for all, but optional, of course.

sywhb commented 1 year ago

Hey @SAK59823 , I just released 1.5.1 to fix this bug ;)

Screenshot 2023-06-21 at 10 13 03 AM
sywhb commented 1 year ago

@sywhb, is it possible to latinize titles for filenames? not for all, but optional, of course.

Hey @LightTemplar , currently we do not latinize titles for filenames but I will take a look at some libraries that we can use

SAK59823 commented 1 year ago

Hey @SAK59823 , I just released 1.5.1 to fix this bug ;)

Screenshot 2023-06-21 at 10 13 03 AM

Thank you!!

wieniawski-lai commented 1 year ago

I still face this problem, and my version is 1.5.3. The only information is:

Failed to fetch articles

And I have set

  1. API key
  2. template as methioned in above discussion.
  3. local save folder image
sywhb commented 1 year ago

Hey @wieniawski-lai , would you mind sharing with me your username so I can check in the backend?

wieniawski-lai commented 1 year ago

Hey @wieniawski-lai , would you mind sharing with me your username so I can check in the backend?

My username is wieniawski in omnivore.

sywhb commented 1 year ago

@wieniawski-lai Thank you! I have found the API call made by the plugin is successful and results have been returned so I guess the error comes from the plugin itself.

Would you mind sharing with me the article template config in your plugin settings?

Screenshot 2023-07-21 at 6 39 52 PM
wieniawski-lai commented 1 year ago

@wieniawski-lai Thank you! I have found the API call made by the plugin is successful and results have been returned so I guess the error comes from the plugin itself.

Would you mind sharing with me the article template config in your plugin settings?

Screenshot 2023-07-21 at 6 39 52 PM

sure, pls see below

# {{{title}}}
#Omnivore

[Read on Omnivore]({{{omnivoreUrl}}})
[Read Original]({{{originalUrl}}})

{{#highlights.length}}
## Highlights

{{#highlights}}
> {{{text}}} [‴️]({{{highlightUrl}}}) {{#labels}} #{{name}} {{/labels}} ^{{{highlightID}}}
{{#note}}

{{{note}}}
{{/note}}

{{/highlights}}
{{/highlights.length}}
sywhb commented 1 year ago

Hey @wieniawski-lai , sorry for the late reply. I have released 1.6.0 to address a few fetching issues.

Could you please kindly upgrade your plugin and re-sync all the articles?

We need to clear this "Last Sync" config in the plugin settings and then click on the sync icon again.

Screenshot 2023-08-03 at 6 24 08 PM
wieniawski-lai commented 1 year ago

thx, @sywhb I have updated to v1.6.0, and clear "Last Sync" as you said. Besides, on windows, my folder to save synced data is E:/backup/note/0.MISC/5.Omnivore/{{{date}}} image

And at this time, there is not error happens. However, I still can not find any md file under E:/backup/note/0.MISC/5.Omnivore/{{{date}}}

Is there any log that I can see?

sywhb commented 1 year ago

Thanks for the reply @wieniawski-lai .

I think the "Folder" and "Attachment Folder" should be relative path in the Vault.

Screenshot 2023-08-04 at 1 04 16 PM Screenshot 2023-08-04 at 1 00 08 PM

We do not support saving notes to a different vault for now