nextcloud / bookmarks

🔖 Bookmark app for Nextcloud
https://apps.nextcloud.com/apps/bookmarks
GNU Affero General Public License v3.0
1.01k stars 173 forks source link

Can't add RSS feed to FreshRSS #1939

Closed Gandalf-the-Blue closed 1 year ago

Gandalf-the-Blue commented 1 year ago

Hi, I tried adding the RSS Feed to FreshRSS with nextcloud credentials but I keep getting this error in FreshRSS -

cURL error 92: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) [https://nextcloud.domain.tld:444/index.php/apps/bookmarks/public/rest/v2/bookmark?folder=8&format=rss&page=-1]

How can I sort this out? Is this a bug?

marcelklehr commented 1 year ago

Mh, can you access the feed using curl from the command line? ie.

$ curl -u "your-user-name:your-password" -v https://nextcloud.domain.tld:444/index.php/apps/bookmarks/public/rest/v2/bookmark?folder=8&format=rss&page=-1
marcelklehr commented 1 year ago

You can also try page=1 instead of -1 in case you have ALOT of bookmarks (as people posting issues in this repo tend to do...)

Gandalf-the-Blue commented 1 year ago

Hi @marcelklehr I'm getting this error in the curl command - curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) Same as that in FreshRSS.

marcelklehr commented 1 year ago

Does it work if you use --http1.1 ? Does it work if you use page=1 ?

Gandalf-the-Blue commented 1 year ago

Same error with both --http1.1 and page=1

marcelklehr commented 1 year ago

Any errors in the webserver log or in the Nextcloud log? Does the bookmarks app web UI still work?

Gandalf-the-Blue commented 1 year ago

I do see this error in my Nextcloud Log - is this relevant? The Web UI for Bookmarks is working, and so is sync with Floccus

[PHP] Error: Error: Undefined variable $folder at /data/nextcloud/apps/notes/lib/Service/NoteUtil.php#154 at <>

  1. /data/nextcloud/apps/notes/lib/Service/NoteUtil.php line 154 OC\Log\ErrorHandler::onError()
  2. /data/nextcloud/apps/notes/lib/Service/NotesService.php line 153 OCA\Notes\Service\NoteUtil->getOrCreateFolder()
  3. /data/nextcloud/apps/notes/lib/Service/NotesService.php line 30 OCA\Notes\Service\NotesService->getNotesFolder()
  4. /data/nextcloud/apps/bookmarks/lib/Service/NotesService.php line 92 OCA\Notes\Service\NotesService->getAll()
  5. /data/nextcloud/apps/bookmarks/lib/Service/NotesService.php line 52 OCA\Bookmarks\Service\NotesService->getNotes()
  6. /data/nextcloud/apps/bookmarks/lib/BackgroundJobs/ExtractFromNotesJob.php line 63 OCA\Bookmarks\Service\NotesService->extractBookmarksFromNotes()
  7. /data/nextcloud/lib/public/BackgroundJob/Job.php line 79 OCA\Bookmarks\BackgroundJobs\ExtractFromNotesJob->run()
  8. /data/nextcloud/lib/public/BackgroundJob/TimedJob.php line 95 OCP\BackgroundJob\Job->execute()
  9. /data/nextcloud/cron.php line 151 OCP\BackgroundJob\TimedJob->execute()
marcelklehr commented 1 year ago

Mh, that error is related to the bookmarks app, but not related to this issue..

Wait a second. Curl'ing the above URL with the option --http1.1 gives you an error that says HTTP/2 stream 0 was not closed cleanly? That's odd. It shouldn't be using HTTP 2 in the first place.

Gandalf-the-Blue commented 1 year ago

Yup, not sure why that happens

marcelklehr commented 1 year ago

What's your server setup? Do you have a reverse proxy? If so, can you try circumventing that to check whether that might be the problem?

Gandalf-the-Blue commented 1 year ago

I am running NextCloudPi behind nginx reverse proxy. How do I circumvent it? I tried replacing nextcloud.domain.tld:444 with the IP of my RaspberryPi 4 with the port of the nextcloud container(which is technically not exposed). I get the following error -

curl: (60) SSL certificate problem: self-signed certificate More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.

marcelklehr commented 1 year ago

You may need to use http only (without ssl)

Gandalf-the-Blue commented 1 year ago

Tried with http <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

400 Bad Request

Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

marcelklehr commented 1 year ago

ok then https it is. You can use curl -k to ignore the certificate

Gandalf-the-Blue commented 1 year ago

With that, I get this response -

<!doctype html><html lang="en" dir="ltr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><meta http-equiv="Content-Language" content="en"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><meta name="HandheldFriendly" content="True"><meta name="MobileOptimized" content="320"><title>Nginx Proxy Manager</title><link rel="apple-touch-icon" sizes="180x180" href="/images/favicons/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/images/favicons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/images/favicons/favicon-16x16.png"><link rel="manifest" href="/images/favicons/site.webmanifest"><link rel="mask-icon" href="/images/favicons/safari-pinned-tab.svg" color="#5bbad5"><link rel="sho* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* Connection #0 to host 192.168.1.165 left intact
rtcut icon" href="/images/favicons/favicon.ico"><meta name="msapplication-TileColor" content="#333333"><meta name="msapplication-config" content="/images/favicons/browserconfig.xml"><meta name="theme-color" content="#ffffff"><link href="/css/main.css?v=2.9.19" rel="stylesheet"></head><body><noscript><div class="container no-js-warning"><div class="alert alert-warning text-center"><strong>Warning!</strong> This application requires Javascript and your browser doesn't support it.</div></div></noscript><div id="app" class="page"><span class="loader"></span></div><script src="/js/main.bundle.js?v=2.9.19"></script></body></html>[1]-  Done
                    curl -k -u "ncp:<>" -v https://<RPi IP>:444/index.php/apps/bookmarks/public/rest/v2/bookmark?folder=8

How do I test this in browser?

marcelklehr commented 1 year ago

Ah, so there is still an nginx inside. foo.

marcelklehr commented 1 year ago

Do you get the error also with RSS feds for other folders or other users?

Gandalf-the-Blue commented 1 year ago

No other users. I have folders inside the main folder of bookmarks though.

When I tried this command (with the new rss feed link for the folder inside) - curl -k -u "<>:<>" -v https://<>:8500/index.php/apps/bookmarks/public/rest/v2/bookmark?folder=8&format=rss&page=1 --http1.1 I do get all the data back! How do I add this to freshrss now?

Gandalf-the-Blue commented 1 year ago

Okay, so putting this url in with SSL security verification disabled in FreshRSS worked, somewhat. For some reason only two of the most recent bookmarks were imported. Any ideas?

marcelklehr commented 1 year ago

curl -k -u "<>:<>" -v https://<>:8500/index.php/apps/bookmarks/public/rest/v2/bookmark?folder=8&format=rss&page=1 --http1.1

the folder id is the same though :thinking:

marcelklehr commented 1 year ago

Any ideas?

No idea, if all the items are in there when using curl, it's up to FreshRSS to import them, maybe FreshRSS only imports items from the last X days to avoid flooding your database?

Gandalf-the-Blue commented 1 year ago

Alright, I'll take a look into the FreshRSS settings. Closing this issue Thanks for the help!!