


I'm using docker version.
I have tested v2.3.13 too same issue.
Please advise
I'm running into this too. I am also using the docker image, v2.3.12.
I see the following in my logs:
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "NOTICE: PHP message: [2017-11-28 19:41:20] development.ERROR: PDOException: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "metric_points" does not exist"
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "LINE 1: ..._points.counter) as value FROM chq_metrics m JOIN metric_poi..."
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: " ^ in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:335"
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "Stack trace:"
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(335): PDOStatement->execute(Array)"
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(706): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\PostgresConnection), 'select sum(metr...', Array)"
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select sum(metr...', Array, Object(Closure))"
[28-Nov-2017 19:41:20] WARNING: [pool www] child 2778 said into stderr: "#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(342): Illuminate\Da..."
2017/11/28 19:41:20 [error] 64#64: *68865 FastCGI sent in stderr: "PHP message: [2017-11-28 19:41:20] development.ERROR: PDOException: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "metric_points" does not exist
LINE 1: ..._points.counter) as value FROM chq_metrics m JOIN metric_poi...
^ in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:335
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(335): PDOStatement->execute(Array)
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(706): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\PostgresConnection), 'select sum(metr...', Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select sum(metr...', Array, Object(Closure))
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(342): Illuminate\Database\C" while reading response header from upstream, client: 192.168.27.26, server: localhost, request: "GET /metrics/1?filter=today HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "cachet-host", referrer: "https://cachet-host/"
192.168.27.26 - - [28/Nov/2017:19:41:20 +0000] "GET /metrics/1?filter=today HTTP/1.1" 500 3241 "https://cachet-host/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5" "10.113.6.214, 10.113.6.214"
Seems like it is trying to use metric_points when it should be trying to use chq_metric_points
So I blanked out the value for DB_PREFIX I was using with the docker image and now the graphs are working since metric_points isn't being created as with a prefix (e.g. chq_metric_points) anymore.
So this seems like a bug but at least there seems to be a workaround.
@jmccann thanks. Once you blanked out DB_PREFIX did you rebuild the container or is there a way to run migration without rebuilding it?
I'm just starting to evaluate cachet so I was able to blow everything away and start over. I'm not sure what the strategy would be for existing deployments that have data you don't want to loose. Sorry.
I'm going to take postgres backup from the container and rebuild the image.
But it will create same tables with same prefix once I restore from postgres dump... hmm
or it will create new tables as well without prefix...
I will try it in coming days.
You can connect to the Postgres database and create a VIEW of the missing metric_points table. A query is run to chq_metric_points every time view metric_points is referenced.
su - postgres
psql
create view metric_points as SELECT * from chq_metric_points;
Now contents of chq_metric_points and metric_points are identical and changes (UPDATES, DELETES) to chq_metric_points will be visible in metric_points thus allowing display of graphs
postgres=# select * from chq_metric_points;
id | metric_id | value | created_at | updated_at | counter
----+-----------+-------+---------------------+---------------------+---------
2 | 2 | 2.000 | 2017-12-08 09:57:38 | 2017-12-08 09:57:38 | 1
3 | 2 | 0.000 | 2017-12-08 09:57:45 | 2017-12-08 09:57:45 | 1
1 | 2 | 1.000 | 2017-12-08 09:57:12 | 2017-12-08 09:57:51 | 2
(3 rows)
postgres=# select * from metric_points;
id | metric_id | value | created_at | updated_at | counter
----+-----------+-------+---------------------+---------------------+---------
2 | 2 | 2.000 | 2017-12-08 09:57:38 | 2017-12-08 09:57:38 | 1
3 | 2 | 0.000 | 2017-12-08 09:57:45 | 2017-12-08 09:57:45 | 1
1 | 2 | 1.000 | 2017-12-08 09:57:12 | 2017-12-08 09:57:51 | 2
(3 rows)
Looks like this abstraction to add $prefix needs to be backported to 2.3:
https://github.com/CachetHQ/Cachet/commit/1c00dec3648f83d9cec3d9ce54eb2f5d37d89ea6
@mflpopescu thank you SO much for this workaround, saved my bacon.
Most helpful comment
You can connect to the Postgres database and create a VIEW of the missing metric_points table. A query is run to chq_metric_points every time view metric_points is referenced.
Now contents of chq_metric_points and metric_points are identical and changes (UPDATES, DELETES) to chq_metric_points will be visible in metric_points thus allowing display of graphs