fasheng / elfeed-protocol

Provide extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
GNU General Public License v3.0
100 stars 18 forks source link

error with tt-rss #3

Closed irfus closed 6 years ago

irfus commented 6 years ago

Following the config for the tt-rss protocol gives me this error line in the elfeed log: [error]: https://<snipped-domain.tld>/tt-rss/api/: (wrong-type-argument stringp nil)

Could it be because I do not have tt-rss running on a separate sub-domain?

elfeed and elfeed-protocol installed from MELPA. TT-RSS v17.4

fasheng commented 6 years ago

I'm not sure, I didn't test a top-level domain like <snipped-domain.tld> before. But for a ttrss connection issue it should shows such logs:

[2018-01-31 16:24:45] [debug]: retrieve (http://localhost/api/)
[2018-01-31 16:24:45] [error]: http://localhost/api/: "(7) Failed to connect to host."

How about testing locally with the the README steps? https://github.com/fasheng/elfeed-protocol#tiny-tiny-rss

If still failed, you could show more logs even panic stacks with little setup before update operation:

(setq elfeed-log-level 'debug)
(toggle-debug-on-error)
irfus commented 6 years ago

Doesn't seem to be a connection issue. Here are the debug log entries generated upon update.

[2018-01-31 09:50:29] [info]: Elfeed update: January 31 2018 09:50:29 CST
[2018-01-31 09:50:29] [debug]: retrieve (https:/domain.tld/tt-rss/api/)
[2018-01-31 09:50:30] [debug]: retrieve (https://domain.tld/tt-rss/api/)
[2018-01-31 09:50:31] [debug]: retrieve (https://domain.tld/tt-rss/api/)
[2018-01-31 09:50:36] [debug]: elfeed-protocol-ttrss: parsing entries, first-entry-id: -1 last-entry-id: -1
[2018-01-31 09:50:36] [error]: https://domain.tld/tt-rss/api/: (wrong-type-argument stringp nil)
fasheng commented 6 years ago

Fine, at least TT-RSS v16.3 works here, I will test v17.4 later..

fasheng commented 6 years ago

Well, I tested fischerman/docker-ttrss docker image which version is v17.4 instead of clue/ttrss just now, but everything works fine. The elfeed-protocol package version is 20171214.2319.

Here is my full configs:

(setq elfeed-curl-extra-arguments '("--insecure"))
(setq elfeed-log-level 'debug)
(setq elfeed-use-curl t)
(elfeed-set-timeout 36000)
(setq elfeed-protocol-ttrss-maxsize 10) // limit maxsize so could update multi times
(setq elfeed-feeds (list "ttrss+http://admin:password@localhost"))

And the success logs looks like this:

[2018-02-01 15:25:09] [debug]: retrieve (http://localhost/api/)
[2018-02-01 15:25:09] [debug]: retrieve (http://localhost/api/)
[2018-02-01 15:25:09] [debug]: retrieve (http://localhost/api/)
[2018-02-01 15:25:09] [debug]: elfeed-protocol-ttrss: parsing entries, first-entry-id: -1 last-entry-id: -1
[2018-02-01 15:25:09] [debug]: elfeed-protocol-ttrss: parsed 10 entries finished with 0.007211446762084961s, first-entry-id: 36 last-entry-id: 45

So still need your help to debug the error:

  1. run curl https://domain.tld/tt-rss/api/ in terminal to see if could connect server success. The prefer result is:
    {"seq":null,"status":1,"content":{"error":"NOT_LOGGED_IN"}}
  2. After update operation, see variable elfeed-protocol-ttrss-feeds if is empty
  3. The error should be occurred in elfeed-protocol-ttrss--parse-entries function, so just edit it and insert one line code in the header to dump the argument content:
    (elfeed-log 'error "debug elfeed-protocol-ttrss--parse-entries: %s" content)
irfus commented 6 years ago
  1. Using curl to query the api url gives the preferred result.
  2. elfeed-protocol-ttrss-feeds is not empty, it contains,
    #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8
          data ("ttrss+https://<user>@<domain.tld>/tt-rss" [((feed_url
          . "http://tt-rss.org/forum/rss.php") (title . "Tiny Tiny
          RSS: Forum") (id . 2) (unread . 579) (has_icon . t)
          (cat_id . 0) (last_updated . 1517695978) (order_id
          . 0))]))
  3. That dumped a whole lot of feed content into the log, which is attached. elfeed-log.txt
fasheng commented 6 years ago

Thanks, the dumped result helps and the point is closer, looks it's a mistype issue caused by the feed_id or tags element in the entries. But I mistake the debug code before XD, so please debug once again to dump the correct JSON buffer string instead:

(elfeed-log 'error "debug elfeed-protocol-ttrss--parse-entries: %s" (buffer-string))

BTW: could limit the elfeed-protocol-ttrss-maxsize to decrease the result size ;)

EDIT: Reproduce the issue here with the missing feed url https://www.anandtech.com/rss/, will try to fix it later.

fasheng commented 6 years ago

Thanks for your report, the issue should be fixed now, please update to the latest code and try again ;)

irfus commented 6 years ago

Confirmed working. Thanks!