Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph not displaying #2813

Closed
zohaib85 opened this issue Nov 18, 2017 · 9 comments
Closed

Graph not displaying #2813

zohaib85 opened this issue Nov 18, 2017 · 9 comments
Assignees
Labels
Bug Bugs with Cachet

Comments

@zohaib85
Copy link

image
image
image

I'm using docker version.
I have tested v2.3.13 too same issue.
Please advise

@jmccann
Copy link

jmccann commented Nov 28, 2017

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

@jmccann
Copy link

jmccann commented Nov 28, 2017

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.

@zohaib85
Copy link
Author

@jmccann thanks. Once you blanked out DB_PREFIX did you rebuild the container or is there a way to run migration without rebuilding it?

@jmccann
Copy link

jmccann commented Nov 28, 2017

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.

@zohaib85
Copy link
Author

zohaib85 commented Nov 28, 2017

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.

@mflpopescu
Copy link

mflpopescu commented Dec 8, 2017

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)

@vanveele
Copy link

Looks like this abstraction to add $prefix needs to be backported to 2.3:
1c00dec

@jamesrenaud
Copy link

@mflpopescu thank you SO much for this workaround, saved my bacon.

@jbrooksuk jbrooksuk self-assigned this Mar 14, 2018
@jbrooksuk jbrooksuk added the Bug Bugs with Cachet label Mar 14, 2018
@jbrooksuk jbrooksuk modified the milestone: 2.3 Mar 14, 2018
@jbrooksuk
Copy link
Member

Closed by #2960

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bugs with Cachet
Projects
None yet
Development

No branches or pull requests

6 participants