forseti-security/forseti-visualizer

Unable to get Visualizer working

gkowalski-google opened this issue · 10 comments

Story

I have been working with a user to get Visualizer working by following the readme, but we are unable to get it to connect to the Forseti database to show the real data (as opposed to the demo/cached data).

Repro Steps

User was trying to get Visualizer running on the Forseti server by following the readme. After troubleshooting for a while with no luck, we then tried to build and deploy the Visualizer images to a GCE VM but also ran into issues here and stopped after we could not publish the images.

  • It would be helpful to have better documentation around the source.env file, the default values shown on the readme make it kind of confusing.
  • When running ./build-images.sh it throws an error because it tries to source the source.env file from the infrastructure directory, however it is created in the forseti-api directory.
  • The scripts assume a $PROJECT_ID is included in the source.env file, but it was not mentioned in the docs when creating that file.
  • Docker should be listed as a pre-requisite for building the images.
  • What permission/roles are required in order to publish the images? After installing docker, we got an error preventing the images from being published. This should also be listed as a pre-req.
  • Instead of having users build the images, can we publish an image to be used by others?
  • The 3 deployment scripts could use better documentation as well, which values do you need to update? I'm assuming you only need to choose one depending on where you want to deploy Visualizer, but this is not clear. Some users thought they needed to update and run all 3.

After following the directions, we cannot get Visualizer to display any data. It will open and show the UI with no data. If we click the settings icon and then click show cached data, then we get the "demo" data.

Warning at startup has caused some confusion with a few users who thought this was an error and causing Visualizer not to work:
vis-warning-at-startup

This error from the Chrome console is possibly the root cause of why Visualizer is not pulling in real data.
vis-chrome-error

Try using Cloud SQL Proxy. A valid source entry for that may look like:

export CLOUDSQL_HOSTNAME="127.0.0.1" export CLOUDSQL_USERNAME="root" export CLOUDSQL_PASSWORD="" export CLOUDSQL_SCHEMA="forseti_security" export FORSETI_SERVER_VM_CHANNEL="0.0.0.0:50051" export FORSETI_DATA_MODEL_HANDLE="21254f1de747879237a95cb552e80844"

Additionally, will be updating the README on the latest PR to consolidate setup steps.

Hey garette!! As describe by @gkowalski-google we are also facing the same while trying to deploying the forsity-visulizer api on GCE VM with mysql server running on the same machine..
Below is the "source.env" file contents for forsity-api, Though i have masked the CLOUDSQL_PASSWORD and PROJECT_ID.
Kindly suggest any solutions for trobleshooting because its seems all the variables are correctly set in the source.env still facing the same issue in "chrome browser" screenshot.
Also i'm doutful "FORSETI_DATA_MODEL_HANDLE", what value to provide for that, whats the significance of that variable in source.env?
source.env file content:

export API_HOST="0.0.0.0"
export API_PORT="8080"
export CLOUDSQL_HOSTNAME="127.0.0.1"
export CLOUDSQL_USERNAME="root"
export CLOUDSQL_PASSWORD="<mysql-passwd>"
export CLOUDSQL_SCHEMA="forseti_security"
export FORSETI_SERVER_VM_CHANNEL="0.0.0.0:50051"
export FORSETI_DATA_MODEL_HANDLE="f240aa3a5bc9fd9acfaf50fdd3620534"
export PROJECT_ID="<my-project-id>"

image

Yes I also facing the same issue
forseti_viz_error

Just change the localhost to the external IP of the compute engine
at a location
forsei_install/forseti-visualizer/forseti-visualizer-ui/src/services/DataService.js

forseti_err2

Can you confirm whether you have access to the MySQL Database (CloudSQL)? (127.0.0.1 assumes localhost and is enabled when Cloud SQL Proxy is configured and running)

telnet 127.0.0.1 3306

If you do have connectivity, can you hit the endpoint directly via a web browser and let me know if you get an error message. Additionally, you can also try executing the underlying SQL query using mysql CLI or MySQL workbench.

yes garrett, i check my mysql through telnet. and also created a forseti-security table..
Still got the same issue.. and as per @sarthakspringm i did the changes in DataService.js
from localhost to my VM's public ip..

@thekubebuddy - Checking in around this. Has this still been an issue?

If so, can you confirm the operating system and version in which you were using? Additionally, we can schedule a quick call to further debug this. If you'd like to do so, please send me a message on the Forseti Slack - https://app.slack.com/client/TAZFFH7KL/CAZCH95EF/thread/CAZCH95EF-1550792530.009000

Thanks, G

Sending a friendly ping around this to follow-up.

Closing stale request. Please re-open an Issue if still hitting an issue on the newest version.