Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

PDOException on 5a35b31 with PHP7.2 #31

Open
Science4583 opened this issue Sep 9, 2018 · 9 comments
Open

PDOException on 5a35b31 with PHP7.2 #31

Science4583 opened this issue Sep 9, 2018 · 9 comments
Assignees

Comments

@Science4583
Copy link

Hello,

I'm running into this error on a brand new setup. It passes the login screen but then just sits at a blank page.

Uncaught PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" in /var/www/ttrss/classes/logger/sql.php:21 Stack trace: #0 /var/www/ttrss/classes/logger/sql.php(21): PDOStatement->execute(Array) #1 /var/www/ttrss/classes/logger.php(28): Logger_SQL->log_error(1024, 'Array\n(\n [ho...', '', '', '') #2 /var/www/ttrss/plugins.local/auth_ldap/init.php(84): Logger->log_error(1024, 'Array\n(\n [ho...', '', '', '') #3 /var/www/ttrss/plugins.local/auth_ldap/init.php(284): Auth_Ldap->_log('Array\n(\n [ho...', 1024) #4 /var/www/ttrss/include/functions.php(706): Auth_Ldap->authenticate('testuser', '12345') #5 /var/www/ttrss/classes/handler/public.php(481): authenticate_user('testuser', '12345') #6 /var/www/ttrss/public.php(50): Handler_Public->login() #7 {main} thrown

@hydrian
Copy link
Owner

hydrian commented Sep 10, 2018

Looks like an error in the logging system not Auth-LDAP. Auth-LDAP doesn't use PDO for anything. Please at switch to log logging type and see if that error continues. File or syslog are good candidates.

If it doesn't, it is a logging issue and you should update the core. It the exception continues, I'll take a look into it.

@chrbayer
Copy link

chrbayer commented Sep 10, 2018

I have the same issue, looks like commit 01d22e255f7a026bb0b0324cde1d8a8756c84a20 in the tt-rss repository leads to this problem:

-		$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+		$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

But I can't say what the root cause problem is... Now some problem is not a simple warning but an exception which stops tt-rss from working...

@hydrian hydrian self-assigned this Sep 10, 2018
@hydrian
Copy link
Owner

hydrian commented Sep 10, 2018

Did either of you try switching to non-sql logging? See if that works.

@chrbayer
Copy link

I will try to change the log method, but something is really wrong with the logging, this should work even with sql logging...

PDOStatement::execute(): SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: ""
1. classes/logger/sql.php(21): execute(Array)
2. classes/logger.php(28): log_error(1024, User: admin authentication successful, , , )
3. plugins.local/auth_ldap/init.php(89): log_error(1024, User: admin authentication successful, , , )
4. plugins.local/auth_ldap/init.php(323): _log(User: admin authentication successful)
5. include/functions.php(706): authenticate(admin, XXX)
6. classes/handler/public.php(481): authenticate_user(admin, XXX)
7. public.php(50): login()

@chrbayer
Copy link

With both other logging methods it works...

@hydrian
Copy link
Owner

hydrian commented Sep 10, 2018

I haven't changed the logging messages in years, so something changed upstream. It has to be determined if this is a bug from upstream or a change of logging requirements.

@hydrian
Copy link
Owner

hydrian commented Sep 10, 2018

@chrbayer It sounds like a bug. If it was a change of requirements, it would have probably still had an issue.

I'll see what I can find upstream.

@Science4583
Copy link
Author

I posted this mainly because I haven't gotten the LDAP auth to work right yet. I noticed that the error logging was broken before my pull and even more broken after. I haven't spent much time digging into it due to other priorities, but switching the logging to syslog works fine for getting the errors.

@hydrian
Copy link
Owner

hydrian commented Sep 11, 2018

@mbazdell,
Looks like there is some code rot. I'll look into cleaning it up. As a temporary workaround, if you can change your logging type file or syslog and not hit this error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants