oliveiraped / Reportula

Reportula is a php based web program that provides you a summarized output stats of Bacula Backups jobs, clients, volumes and director that have already run. It obtains its information from your catalog database. This is a fairly high level bacula management tool. Here are a few points that one user made concerning this important tool. It is web-based so can be accessed from anywhere. It packs a phenomenal amount of information into a single web-page – that I credit as being very good design! Features Display last jobs status Display volumes usage by pool Full supported MySQL, PostgreSQL databases. Show Jobs which executed with errors last day, week, month Show a condition of your Volumes Show terminated Jobs Search Jobs on several conditions The detailed information on Pools, Volumes, Storages and Clients Search options List the files stored on job Acl Supports and Login users support Integration with Active Directory or Ldap servers
http://www.reportula.org
GNU General Public License v3.0
25 stars 9 forks source link

type mismatch error #4

Open jacekjaros opened 10 years ago

jacekjaros commented 10 years ago

php artisan BaculaStats:collect

[Illuminate\Database\QueryException] SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "0.0833333333333333" (SQL: select * from "hoursstats" where "data" = 2014-04-08 and "server" = angel and "bytes" = 6884397 and "starttime" = 20 14-04-07 23:05:01 and "endtime" = 2014-04-07 23:10:06 and "timediff" = 00:05:04 and "hoursdiff" = 0.0833333333333333 and "hourbytes" = 82612764 limit 1)

oliveiraped commented 10 years ago

Jacek it's on Mysql or Postgres ?

jacekjaros commented 10 years ago

I use postgres

jacekjaros commented 10 years ago

i believe the error is caused by escaping 'hoursdiff' variable: query with escaping: bacula=# select * from "hoursstats" where "data" = '2014-04-08' and "server" = 'angel' and "bytes" = 6884397 and "starttime" = '14-04-07 23:05:01' and "endtime" = '2014-04-07 23:10:06' and "timediff" = '00:05:04' and "hoursdiff" = '0.0833333333333333' and "hourbytes" = 82612764 limit 1; ERROR: invalid input syntax for integer: "0.0833333333333333" LINE 1: ...06' and "timediff" = '00:05:04' and "hoursdiff" = '0.0833333...

query without escaping: ^ bacula=# select * from "hoursstats" where "data" = '2014-04-08' and "server" = 'angel' and "bytes" = 6884397 and "starttime" = '14-04-07 23:05:01' and "endtime" = '2014-04-07 23:10:06' and "timediff" = '00:05:04' and "hoursdiff" = 0.0833333333333333 and "hourbytes" = 82612764 limit 1; id | data | server | starttime | endtime | bytes | hoursdiff | hourbytes | timediff ----+------+--------+-----------+---------+-------+-----------+-----------+---------- (0 rows)

jayme-github commented 10 years ago

Facing the same error with PostgreSQL 8.3 As I'm not familiar with the frameworks used here: Is there a quick workaround?