Skip to content

Running updater causes Uncaught PDOException #465

@mkools

Description

@mkools

What are the steps to reproduce this issue?

  1. Install Debian 9.x with PHP 7.2 (NGINX with PHP 7.2 FPM).
  2. Copy v1.x release of SB++ over the Sourcebans 1.4.11 directory.
  3. Run /updater/ to update the 1.4.11 installation to SB++

What happens?

Running the updater throws 2 errors, first is a PHP error:

Warning: Use of undefined constant SB_EMAIL - assumed 'SB_EMAIL' (this will throw an Error in a future version of PHP) in /var/www/html/sbpp/init.php on line 155

Next it's throwing a PDOException:

Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0 COMMENT '1 - Mute, 2 - Gag', ureason text, PRIMARY KEY (`b' at line 15 in /var/www/html/sbpp/includes/Database.php:70 Stack trace: #0 /var/www/html/sbpp/includes/Database.php(70): PDOStatement->execute() #1 /var/www/html/sbpp/updater/data/475.php(29): Database->execute() #2 /var/www/html/sbpp/updater/Updater.php(75): require_once('/var/www/html/s...') #3 /var/www/html/sbpp/updater/Updater.php(23): Updater->update() #4 /var/www/html/sbpp/updater/index.php(32): Updater->__construct(Object(Database)) #5 {main} thrown in /var/www/html/sbpp/includes/Database.php on line 70

What were you expecting to happen?

I expected the updater to run so I can update my 1.4.11 installation to SB++.

Any logs, error output, etc.?

NGINX logs show this:

2018/05/16 05:37:52 [error] 6419#6419: *116053 FastCGI sent in stderr: "PHP message: PHP Warning: Use of undefined constant SB_EMAIL - assumed 'SB_EMAIL' (this will throw an Error in a future version of PHP) in /var/www/html/sbpp/init.php on line 155
PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0 COMMENT '1 - Mute, 2 - Gag',
ureason text,
PRIMARY KEY (`b' at line 15 in /var/www/html/sbpp/includes/Database.php:70
Stack trace:
#0 /var/www/html/sbpp/includes/Database.php(70): PDOStatement->execute()
#1 /var/www/html/sbpp/updater/data/475.php(29): Database->execute()
#2 /var/www/html/sbpp/updater/Updater.php(75): require_once('/var/www/html/s...')
#3 /var/www/html/sbpp/updater/Updater.php(23): Updater->update()
#4 /var/www/html/sbpp/updater/index.php(32): Updater->__construct(Object(Database))
#5 {main}

Any other comments?

Clean installation seems to work out fine, it's just the upgrade that's failing.

What versions of software are you using?

Operating System: Debian 9.4
SourceBans++ Version: Github latest version (v1.x branch).

PHP Version: PHP 7.2.5-1+020180505045740.21+stretch1.gbpca2fa6
MySQL Version: 10.1.26-MariaDB
Link to your project: https://mgftw.com/sbpp/
Link to a phpinfo() output: https://mgftw.com/pi.php

SourceMod Version:
MetaMod Version:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions