dasmurphy / tinytinyrss-fever-plugin

TinyTiny RSS Fever API Plugin
239 stars 54 forks source link

Network connection error on every sync with Press 1.5.4 #21

Open rubenv opened 9 years ago

rubenv commented 9 years ago

I'm using:

On every sync, I get a toast message with "Network connection error".

Sync seems to work, partially (only some items get synced in).

Here are the HTTP logs from a sync session:

rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:25 +0000] "POST /plugins/fever/?api&groups HTTP/1.1" 200 513 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:25 +0000] "POST /plugins/fever/?api&feeds HTTP/1.1" 200 4883 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:25 +0000] "POST /plugins/fever/?api&items&since_id=2000 HTTP/1.1" 200 116 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:25 +0000] "POST /plugins/fever/?api&items&since_id=2050 HTTP/1.1" 200 116 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:26 +0000] "POST /plugins/fever/?api&items&since_id=2100 HTTP/1.1" 200 116 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:26 +0000] "POST /plugins/fever/?api&items&since_id=2150 HTTP/1.1" 200 116 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:26 +0000] "POST /plugins/fever/?api&unread_item_ids HTTP/1.1" 200 108 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:26 +0000] "POST /plugins/fever/?api&saved_item_ids HTTP/1.1" 200 107 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"
rss.rocketeer.be 94.225.203.40 - - - [13/Nov/2015:14:56:26 +0000] "POST /plugins/fever/?api&items&with_ids= HTTP/1.1" 500 5 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Nexus 5 Build/MRA58N)"

The last one returns an HTTP 500 error.

Is there any way I can debug this?

rubenv commented 8 years ago

Turns out this happens when you have no saved items.

{
   "auth" : 1,
   "api_version" : 3,
   "last_refreshed_on_time" : "1448290332",
   "saved_item_ids" : ""
}

This causes Press to do the wrong thing. Saving one item makes sync work.

dasmurphy commented 8 years ago

Do you know what Press want in source? I can fix this fast if i know what Press accepts. I don't have any Android device at hand. Can you mail the creator and ask?

rubenv commented 8 years ago

I'm not sure about Press.

I'm guessing that an easy fix would be to make sure that POST /plugins/fever/?api&items&with_ids= doesn't generate a HTTP 500, but just returns a response with zero items in it.

I don't have a Fever install at hand, so I can't really compare between what Press sends/expects from normal Fever and this plugin.

Thanks for this awesome plugin by the way, it's a a life-saver!

travisghansen commented 7 years ago

Pretty sure it's an issue with the query:

2017/07/17 16:54:51 [error] 287#287: *472 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Query SELECT ref_id, feed_id, title, link, content, id, marked, unread, author, updated
                                     FROM ttrss_entries, ttrss_user_entries
                                     WHERE  owner_uid = '2' AND ref_id = id  AND id IN ('')  LIMIT 50 failed: ERROR:  invalid input syntax for integer: ""

I replaced the $query = "id IN ('') "; with $query = "id IN (0) "; to at a minimum fix the error.