Skip to content

Client crashes when attempting to write invalid values into database #2

@Krelyshy

Description

@Krelyshy

Hello! Your client works nice and smooth but when I set the range filter to middle europe (only because there were clients at the time) it started to throw a pretty weird error which seems to be caused by an attempt to insert a string into an integer column in the database (I am not experienced enough with PHP but that seems to be the error). It might be caused by some other client sending invalid data. Here are the last few lines from console before the crash occured:

OgnPosition: in savePositions() - trying to save buffer to db
PHP Fatal error:  Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `ogn`.`ogn_logs`.`climbrate` at row 1 in /var/www/html/ogn/vendor/dbursem/ogn-client-php/lib/OGNClient.php:212
Stack trace:
#0 /var/www/html/ogn/vendor/dbursem/ogn-client-php/lib/OGNClient.php(212): PDOStatement->execute(Array)
#1 /var/www/html/ogn/aprsbot.php(59): dbursem\OGNClient\OGNClient->savePositions()
#2 {main}
  thrown in /var/www/html/ogn/vendor/dbursem/ogn-client-php/lib/OGNClient.php on line 212

Sometimes, the client crashes immediately after launch due to the same error.

Thank you for the amazing client!
Sincerely, Chris Deer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions