Page 1 of 1

Phantom feed?

Posted: 04 Oct 2016, 14:43
by Not a robot
Hi,

I'm using Tiny Tiny RSS v16.8 (6687cb9), MariaDB 10.0.27 on Centos 6.8.

I don't remember exactly what I did, but a while back I deleted a whole Category of feeds via the Preferences and all seemed well.

Today, I clicked on Fresh Articles (which I don't often use) and noticed a post / article from one of the feeds that should have been deleted. Clicking on the post works, brings up all of the posts in that feed, but the feed name doesn't appear in the list in the left hand side.

An OPML export doesn't list the phantom feed.

I can hack the database to fix this, but have I found a bug, or did I do something stupid? If the latter, I'll take probation...

Re: Phantom feed?

Posted: 04 Oct 2016, 15:13
by fox
when you delete the category feeds are placed into uncategorized (your database does this using an on delete trigger)

unless you managed to run on myisam which would mean you're pretty much screwed

e:

Code: Select all

select table_name, engine from information_schema.tables where table_schema = 'your_ttrss_db' and engine != 'InnoDB';

Re: Phantom feed?

Posted: 04 Oct 2016, 15:31
by Not a robot
Hmm, I actually have 2 Uncategorized categories (I forget why), neither contain the feed. Although, wouldn't the feed still show on an OPML export?

All Innodb here, so no worries there.

Re: Phantom feed?

Posted: 04 Oct 2016, 16:23
by fox
it won't show if it doesn't have a valid parent category (or NULL)

look for the feed in question in the ttrss_feeds database, find the value of cat_id and see where it points

also you can try deleting one of the uncategorized, if it works fine, if not your database is probably somehow borked

Re: Phantom feed?

Posted: 04 Oct 2016, 22:20
by Not a robot
I've only got one Uncategorized listed in ttrss_feed_categories which has an id of 4. The other Uncategorized contains feeds with a cat_id of NULL, which makes sense. The problem feed and its 7 friends, all had a cat_id of 1, which isn't listed in ttrss_feed_categories, and I guess 1 was the original category name. Changing the cat_id made the feeds reappear.

So, does deleting a category hide feeds for other people, or do they correctly appear in Uncategorized, meaning that the cat_id has been changed to Null?

Re: Phantom feed?

Posted: 04 Oct 2016, 22:38
by fox
since it is impossible to have an invalid cat_id in this table without violating foreign key constraints it means your database seemingly got into an inconsistent (and, for obvious reasons, no longer supported) state.

i can only recommend exporting/importing OPML and reimporting the schema, preferably on a real database server i.e. postgresql.

you can also try fixing missing foreign keys (however many there might be) but i'm not going to help you with this and am generally washing my hands of your case at this point, sorry.

>So, does deleting a category hide feeds for other people, or do they correctly appear in Uncategorized, meaning that the cat_id has been changed to Null?

this is handled by an ON DELETE SET NULL constraint in the feeds table.

Re: Phantom feed?

Posted: 05 Oct 2016, 00:05
by Not a robot
> it means your database seemingly got into an inconsistent state
Yeah, it has been through a lot of feeds, upgrades and server moves, so it wouldn't surprise me if I broke something along the way.

Should anyone else manage to get into this state, the quick fix is to just recreate the missing category in ttrss_feed_categories and delete or move the feeds before deleting the category again. I'll check the constraints later.

> "preferably on a real database server"
I can get you a regular spot in a comedy club if you're interested?

Re: Phantom feed?

Posted: 05 Oct 2016, 00:35
by nameless
Not a robot wrote:
> "preferably on a real database server"
I can get you a regular spot in a comedy club if you're interested?

I would actually love see this happening.
I am willing to pay for fox roasting me, good thing is he does it for free around here on a regular basis.
This is basically the single reason I am still subscribed to the forums RSS feed.

Re: Phantom feed?

Posted: 05 Oct 2016, 00:49
by sleeper_service
nameless wrote:This is basically the single reason I am still subscribed to the forums RSS feed.

there's another reason?

Re: Phantom feed?

Posted: 05 Oct 2016, 00:51
by sleeper_service
Not a robot wrote:> "preferably on a real database server"
I can get you a regular spot in a comedy club if you're interested?

as much as I hate to puff up his nibs ego, he's got a point.

I started out on mysql, and after a while, bit the bullet and switched to postgres... and it does work better.

Re: Phantom feed?

Posted: 05 Oct 2016, 03:50
by JustAMacUser
sleeper_service wrote:I started out on mysql, and after a while, bit the bullet and switched to postgres... and it does work better.


I started out on PostgreSQL, and after a while, switched to MySQL because I needed it for another application and didn't want to run two database servers on one machine.

... and PostgreSQL does work better.

Re: Phantom feed?

Posted: 05 Oct 2016, 22:38
by nameless
So did I. Mysql get the job done mostly fine.
I miss postgres full text search though.
Than again I can't be bothered to maintain to database servers on one machine.