Project

General

Profile

Actions

action #123490

closed

o3 logreports DBI Exception: DBD::Pg::st execute failed: ERROR: invalid input syntax for type bigint size:M

Added by jbaier_cz almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Start date:
2023-01-23
Due date:
% Done:

0%

Estimated time:

Description

Observation

We see the following in /var/log/openqa on o3:

[2023-01-21T22:04:08.897649Z] [error] [bXpoFGyR3PEg] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR:  invalid input syntax for type bigint: "root-console-20200501"
CONTEXT:  unnamed portal parameter $1 = '...' [for Statement "SELECT me.id, me.dir_id, me.filename, me.last_seen_time, me.last_seen_module_id, me.last_matched_time, me.last_matched_module_id, me.last_updated, me.file_present, me.tags, me.t_created, me.t_updated FROM needles me WHERE ( me.id = ? )" with ParamValues: 1='root-console-20200501'] at /usr/share/openqa/script/../lib/OpenQA/WebAPI/Controller/File.pm line 65

Acceptance criteria

  • AC1: No new error messages like this in the logs

Suggestions

  • Add input validation to route

Related issues 1 (0 open1 closed)

Copied from openQA Infrastructure (public) - action #108533: o3 logreports DBI Exception: DBD::Pg::st execute failed: ERROR: invalid input syntax for type integerResolvedtinita2022-03-31

Actions
Actions #1

Updated by jbaier_cz almost 2 years ago

  • Copied from action #108533: o3 logreports DBI Exception: DBD::Pg::st execute failed: ERROR: invalid input syntax for type integer added
Actions #2

Updated by kraih almost 2 years ago

  • Status changed from New to In Progress

I'll take a look.

Actions #3

Updated by kraih almost 2 years ago

  • Assignee set to kraih
Actions #4

Updated by kraih almost 2 years ago

Looks like the problem is route patterns that are not specific enough:

$r->get('/needles/:needle_id/image')->name('needle_image_by_id')->to('file#needle_image_by_id');
$r->get('/needles/:needle_id/json')->name('needle_json_by_id')->to('file#needle_json_by_id');
$r->get('/needles/:distri/#name')->name('needle_file')->to('file#needle');

So, if someone requests GET /needles/root-console-20200501/image or GET /needles/root-console-20200501/json they would get this error. Making sure that the first two routes only receive numbers (/needles/<needle_id:num>/image) should fix the issue. I'll make a PR.

Actions #5

Updated by kraih almost 2 years ago

  • Description updated (diff)
Actions #7

Updated by kraih almost 2 years ago

  • Status changed from In Progress to Feedback
Actions #8

Updated by okurz almost 2 years ago

  • Subject changed from o3 logreports DBI Exception: DBD::Pg::st execute failed: ERROR: invalid input syntax for type bigint to o3 logreports DBI Exception: DBD::Pg::st execute failed: ERROR: invalid input syntax for type bigint size:M
  • Description updated (diff)
Actions #9

Updated by kraih almost 2 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF