New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDOException on 5a35b31 with PHP7.2 #31

Open
mbazdell opened this Issue Sep 9, 2018 · 9 comments

Comments

Projects
None yet
3 participants
@mbazdell

mbazdell commented Sep 9, 2018

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

This comment has been minimized.

Show comment
Hide comment
@hydrian

hydrian Sep 10, 2018

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@chrbayer

chrbayer 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...

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

This comment has been minimized.

Show comment
Hide comment
@hydrian

hydrian Sep 10, 2018

Owner

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

Owner

hydrian commented Sep 10, 2018

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

@chrbayer

This comment has been minimized.

Show comment
Hide comment
@chrbayer

chrbayer Sep 10, 2018

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 commented Sep 10, 2018

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

This comment has been minimized.

Show comment
Hide comment
@chrbayer

chrbayer Sep 10, 2018

With both other logging methods it works...

chrbayer commented Sep 10, 2018

With both other logging methods it works...

@hydrian

This comment has been minimized.

Show comment
Hide comment
@hydrian

hydrian Sep 10, 2018

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@hydrian

hydrian Sep 10, 2018

Owner

@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.

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.

@mbazdell

This comment has been minimized.

Show comment
Hide comment
@mbazdell

mbazdell Sep 10, 2018

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.

mbazdell commented Sep 10, 2018

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

This comment has been minimized.

Show comment
Hide comment
@hydrian

hydrian Sep 11, 2018

Owner

@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.

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 join this conversation on GitHub. Already have an account? Sign in to comment