PDO is coming, here's what you need to know

Back on master, things look good here too.

No, I opened an issue: Plugin does not work anymore since tt-rss moved to PDO · Issue #26 · hydrian/TTRSS-Auth-LDAP · GitHub

that should have been fixed by the semi-botched PR yesterday

if it doesn’t work on current trunk i can revise it (probably need to replace function_exists() for check_password with method_exists())

https://git.tt-rss.org/git/tt-rss/src/master/classes/pref/prefs.php#L925

(nvm about auth_base)

i guess iauthmodule could enforce this but idk if its really necessary.

It works but I can’t login:
PHP message: PHP Warning: Failed login attempt for huy from x.x.x.x in /tt-rss/classes/handler/public.php on line 505

Thanks @fox for the fever_api.php patch. Sync now seems to be working again, but I’m seeing this in the apache error log:

[Sat Dec 16 12:56:50.494304 2017] [php7:notice] [pid 78938] [client 127.0.0.1:54604] PHP Notice: Legacy connect requested to pgsql in /Library/Server/Web/Data/Sites/Default/tt-rss/classes/db.php on line 22

Something I need to worry about (or did wrong?). Or just because it’s old code?

Cheers

the point is to nag everyone into updating their stuff to use PDO, otherwise this may be ignored

Update was smooth and fast to commit 3d4ef6 on VPS with Ubuntu 16.04 and mysql.
No problems noticed.

Since the update on the newest version I always get the following error:

pi@raspberrypi2:~ $ /var/www/html/tt-rss/update.php --feeds
PHP Notice: Legacy connect requested to mysql in /var/www/html/tt-rss/classes/db.php on line 22
[13:48:49/22728] Lock: update.lock
[13:48:49/22728] Scheduled 10 feeds to update…
[13:48:49/22728] Base feed: tagesschau.de - Die Nachrichten der ARD
[13:48:49/22728] => 2017-12-15 15:00:04, 8 1
PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘There is no active transaction’ in /var/www/html/tt-rss/classes/rssutils.php:1159
Stack trace:
#0 /var/www/html/tt-rss/classes/rssutils.php(1159): PDO->commit()
#1 /var/www/html/tt-rss/classes/rssutils.php(185): RSSUtils::update_rss_feed(‘8’, true, false)
#2 /var/www/html/tt-rss/update.php(168): RSSUtils::update_daemon_common()
#3 {main}
thrown in /var/www/html/tt-rss/classes/rssutils.php on line 1159

Im running tiny tiny rss on a raspberry with mysql

preferences - system - open log and looks for an actual SQL error which precedes this one

e: i’m 90% sure it’s a misbehaving plugin

Many thanks, you were right. It was caused by the plugin 'api_newsplus` I added some years ago.

Unfortunately now I’m getting a new error:

Uncaught exception ‘PDOException’ with message ‘There is no active transaction’ in /var/www/html/tt-rss/classes/rssutils.php:1159 Stack trace: #0 /var/www/html/tt-rss/classes/rssutils.php(1159): PDO->commit() #1 /var/www/html/tt-rss/classes/rssutils.php(185): RSSUtils::update_rss_feed(‘16’, true, false) #2 /var/www/html/tt-rss/update.php(168): RSSUtils::update_daemon_common() #3 {main} thrown
PDOStatement::execute(): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (ttrss.ttrss_tags, CONSTRAINT ttrss_tags_ibfk_1 FOREIGN KEY (post_int_id) REFERENCES ttrss_user_entries (int_id) ON DELETE CASCADE)

Is an update of the DB sheme required for the new version ? In contrast to other updates I didn’t see any.

if this happens sometimes this could mean you run into concurrent feed updates, if its all the time then idk, could be a bug with tag inserting logic, could be something else

e: i’m yet to run into this problem on my instances but this has been reported before and its not pdo related

Ok, and what can I do to solve the problem? I tried to delete all feeds and to create them again. But the same error appears again.

try reading what i have wrote to you above

Hello, sorry if my question is stupid :slight_smile:
I just did update and error log is flooded with this message.

E_USER_NOTICE (1024)	classes/db.php:22	Legacy connect requested to pgsql
1. classes/db.php(22): user_error(Legacy connect requested to pgsql, 1024)
2. classes/db.php(89): legacy_connect()
3. classes/pluginhost.php(93): get()
4. plugins/api_newsplus/init.php(36): get_dbh()
5. classes/pluginhost.php(207): init([PluginHost])
6. include/functions.php(1948): load(auth_internal, note, updater, api_newsplus, 1)
7. backend.php(51): init_plugins()
E_USER_NOTICE (1024)	classes/db.php:22	Legacy connect requested to pgsql

Does that mean, I should “nag” all creators of plugins I use? In my case api_newsplus? Thanks

Yes, the plugins should be updated.

It is a third-party plugin - I don’t think it will be updated. I have removed it - and newsplus also works without the update.

When I try to update my feeds via a cron job, I get the following error:

PHP Fatal error:  Uncaught PDOException: There is no active transaction in /[...]/tt-rss/classes/rssutils.php:1159
Stack trace:
#0 /[...]/tt-rss/classes/rssutils.php(1159): PDO->commit()
#1 /[...]/tt-rss/classes/rssutils.php(185): RSSUtils::update_rss_feed('67', true, false)
#2 /[...]tt-rss/update.php(168): RSSUtils::update_daemon_common()
#3 {main}

In the error log there is this additional entry:
PDOStatement::execute(): SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'NOW()' for column 'last_read' at row 1

It seems to an SQL error. My schema is already updated:

update.php --update-schema

Lock: update.lock
checking for updates (mysql)...
update not required.

I’m on commit commit 6fb5f17be69f9ff3a0e1379e64a3c7bd71ab3271 and use the following plugins:
define('PLUGINS', 'auth_internal, updater, api_newsplus');

Does anyone know how to solve this?

post the stack trace for the NOW() error; also you will likely need to either update or remove the newsplus plugin (search the forum this has been just discussed)

e: also it’s probably this https://git.tt-rss.org/git/tt-rss/commit/d4c05d0be2c0e865d06b24d334afeeeebadcfd58

In my case it was caused by the newsplus plugin and I had to reset the database.

https://discourse.tt-rss.org/t/pdo-is-coming-heres-what-you-need-to-know/689/68?u=yogi43