phpreport icon indicating copy to clipboard operation
phpreport copied to clipboard

Init time isn't sent to server

Open jaragunde opened this issue 9 years ago • 4 comments

[Trac import] Reported by: jaragunde Original date: Wednesday, 13 October 2010 19:50

Under certain circumstances, which I don't know yet, the init date is set in the AJAX interface but isn't saved to the store, causing this exception when data are sent to the task creation service:

[Wed Oct 13 17:48:11 2010] [error] [client 192.168.10.13] PHP Warning:  pg_query(): Query failed: 
ERROR:  23502: null value in column "init" violates not-null constraint
LOCATION:  ExecConstraints, execMain.c:2229 in /var/www/phpreport/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 640, referer: https://phpreport.igalia.com/web/tasks.php?date=2010-10-13
[Wed Oct 13 17:48:11 2010] [error] [client 192.168.10.13] PHP Fatal error:  Uncaught exception 'SQLQueryErrorException' with message 'ERROR:  23502: null value in column "init" violates not-null constraint
LOCATION:  ExecConstraints, execMain.c:2229' in /var/www/phpreport/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php:645
Stack trace:
#0 /var/www/phpreport/phpreport/model/facade/action/CreateReportAction.php(77): PostgreSQLTaskDAO->create(Object(TaskVO))
#1 /var/www/phpreport/phpreport/model/facade/action/Action.php(112): CreateReportAction->doExecute()
#2 /var/www/phpreport/phpreport/model/facade/TasksFacade.php(78): Action->execute()
#3 /var/www/phpreport/phpreport/model/facade/TasksFacade.php(94): TasksFacade::CreateReport(Object(TaskVO))
#4 /var/www/phpreport/phpreport/web/services/createTasksService.php(216): TasksFacade::CreateReports(Array)
#5 {main}
  thrown in /var/www/phpreport/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 645, referer: https://phpreport.igalia.com/web/tasks.php?date=2010-10-13

The worse part is that the user receives a generic error message and doesn't know what's happening.

jaragunde avatar Mar 09 '16 10:03 jaragunde

[Trac import] Comment by: jaragunde Original date: Monday, 19 September 2011 20:23

#76 and #89 were closed as duplicates of this bug.

jaragunde avatar Mar 09 '16 10:03 jaragunde

I also found log messages related to a null "end" field, could it be the same bug?

[Mon Sep 17 19:19:55.298177 2018] [:error] [pid 19954] [client 192.168.10.13:55367] PHP Fatal error:  Uncaught SQLQueryErrorException: ERROR:  23502: null value in column "_end" violates not-null constraint
DETAIL:  Failing row contains (402587, 2018-09-17, 1035, null, null, t, Management issues, null, null, 101, 345, null, null, f).
SCHEMA NAME:  public
TABLE NAME:  task
COLUMN NAME:  _end
LOCATION:  ExecConstraints, execMain.c:1731 in /var/www/phpreport-beta/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php:925
Stack trace:
#0 /var/www/phpreport-beta/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php(943): PostgreSQLTaskDAO->create(Object(TaskVO))
#1 /var/www/phpreport-beta/phpreport/model/facade/action/CreateTasksAction.php(87): PostgreSQLTaskDAO->batchCreate(Array)
#2 /var/www/phpreport-beta/phpreport/model/facade/action/Action.php(112): CreateTasksAction->doExecute()
#3 /var/www/phpreport-beta/phpreport/model/facade/TasksFacade.php(103): Action->execute()
#4 /var/www/phpreport-beta/phpreport/web/services/createTasksService.php(230): TasksFacade::CreateReports(Array)
#5 {main}
  thrown in /var/www/phpreport-beta/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 925, referer: https://.../web/tasks.php

jaragunde avatar Nov 26 '18 11:11 jaragunde

I have an idea but it's more a workaround than a solution: we should add a pre-send callback to the tasks store object, and double-check that every task contains the compulsory values: init, end and projectid. In theory, that check should have been done elsewhere and that's the cause of this bug. If some value isn't there, we could emit a more verbose error message to the user, telling them to re-write the missing field. If it's not too complicated, we could query the UI widget to the missing value ourselves, and put it into the query before sending it, and the user wouldn't perceive the bug.

jaragunde avatar Nov 26 '18 11:11 jaragunde

We are in the process of rewriting the frontend for tasks. Any outstanding bugs and enhancements for the old interface will be taken into account as we implement the new design.

dmtrek14 avatar Sep 01 '23 15:09 dmtrek14