← Back to team overview

mahara-contributors team mailing list archive

[Bug 1945537] Re: Problem with saving web service log message event when float is in another language

 

I'm unable to login using the Mahara Mobile app. And as I try to login,
I receive an error related to the database in the logs. Maybe it's the
same problem. It's related to the column timetaken, and my system is in
portuguese.

[DBG] b0 (webservice/lib.php:1531) executing: module_mobileapi_sync/sync
[Sat Dec 25 18:58:14.623544 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862] [WAR] b0 (lib/errors.php:853) Failed to get a recordset: postgres9 error: [-1: ERRO:  sintaxe de entrada \xc3\xa9 inv\xc3\xa1lida para tipo numeric: "0,3071391582489"] in EXECUTE("INSERT INTO "external_services_logs" ("id", "timelogged", "userid", "externalserviceid", "protocol", "auth", "functionname", "timetaken", "uri", "info", "ip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "external_services_logs" ("id", "timelogged", "userid", "externalserviceid", "protocol", "auth", "functionname", "timetaken", "uri", "info", "ip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (id:3,timelogged:1640469494,userid:2,externalserviceid:1,protocol:REST,auth:OTHER,functionname:module_mobileapi_sync,timetaken:0,3071391582489,uri:/webservice/rest/server.php?alt=json,info:,ip:192.168.100.21)
[Sat Dec 25 18:58:14.623628 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862] Call stack (most recent first):
[Sat Dec 25 18:58:14.623651 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862]   * log_message("Failed to get a recordset: postgres9 error: [-1: E...", 8, true, true) at /var/www/html/lib/errors.php:89
[Sat Dec 25 18:58:14.623673 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862]   * log_warn("Failed to get a recordset: postgres9 error: [-1: E...") at /var/www/html/lib/errors.php:853
[Sat Dec 25 18:58:14.623694 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862]   * SQLException->__construct("Failed to get a recordset: postgres9 error: [-1: E...") at /var/www/html/lib/dml.php:1236
[Sat Dec 25 18:58:14.623715 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862]   * insert_record("external_services_logs", object(stdClass), "id", true) at /var/www/html/webservice/lib.php:1424
[Sat Dec 25 18:58:14.623736 2021] [php7:notice] [pid 1463] [client 192.168.100.21:40862]   * webservice_base_server->run() at /var/www/html/webservice/rest/server.php:75

Should I open a new report?

Thank you.

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1945537

Title:
  Problem with saving web service log message event when float is in
  another  language

Status in Mahara:
  Confirmed

Bug description:
  Initially reported at
  https://mahara.org/interaction/forum/topic.php?id=8930

  So  for example we try to save number as 1,2345 instead of 1.2345

  We probably need to cast it via flotval somehow

  Error looks like this
  PHP Fatal error:  Uncaught SQLException: Failed to get a recordset: postgres8 error: [-1: ERROR:  invalid input syntax for type numeric: "0,12291693687439"] in EXECUTE("INSERT INTO "external_services_logs" ("id", "timelogged", "userid", "externalserviceid", "protocol", "auth", "functionname", "timetaken", "uri", "info", "ip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "external_services_logs" ("id", "timelogged", "userid", "externalserviceid", "protocol", "auth", "functionname", "timetaken", "uri", "info", "ip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (id:109,timelogged:1632941361,userid:23,externalserviceid:3,protocol:REST,auth:OTHER,functionname:module_mobileapi_upload_blog_post,timetaken:0,12291693687439,uri:/webservice/rest/server.php?alt=json,info:exception:SQLExceptionmessage:Failedtogetarecordset:postgres8error:[-1:ERROR:invalidinputsyntaxfortypenumeric:"0,11438679695129"]inEXECUTE("INSERTINTO"external_services_logs"("id","timelogged","userid","externalserviceid","protocol","auth"

  The problem looks to be related to:

  The variable "time_taken" in file:

  htdocs/webservice/lib.php

   $time_taken = $time_end - $WEBSERVICE_START;

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1945537/+subscriptions



References