-
Notifications
You must be signed in to change notification settings - Fork 508
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
Cannot see dispatch views being populated with data, after configuring database correctly! #501
Comments
Closed in error, re-opened |
To establish a connection to the database I needed to make these config changes on the database side |
Can someone have a look when they get an opportunity please?
The database is up and running on 5433 |
@mccannm1 is the database running on port |
Note that |
Also note, that default there will not be any data in the database, if you'd like to use some example data you would have to restore the sample dataset. Located here: https://github.com/Netflix/dispatch/blob/develop/data/dispatch-sample-data.dump Once downloaded into the root application directory you can restore this data by issuing:
|
Hi @mvilanova Anyway.. I have it installed on server2 as well (and populated)... using port 5432.... I dont mind which database.
root@antic1:~# sudo -u postgres -i psql postgres=# \c dispatch_db dispatch_db=#
dispatch_db=# SELECT version();
|
I imported the data using the dump file...like so |
COMPOSE_PROJECT_NAME=dispatch Database DATABASE_CREDENTIALS=postgres:postgres_password_here Used by postgres docker |
I can talk to the DB on server2 from server1 (running query) java -cp ./postgresql-42.2.14.jre7.jar:. Testantic //antic1.fyre.ibm.com:5432/dispatch_db postgres postgres_password |
sorry for poor formatting in previous posts:
dispatch/dispatch-docker# docker-compose run dispatch server config dispatch/dispatch-docker# docker-compose run dispatch database upgrade |
Looks like you're missing the service name after run (see https://docs.docker.com/compose/reference/run/). The command should be |
HI @mvilanova @kevgliss |
When using the docker compose, do not include e.g.
|
HI @kevgliss I executed docker-compose run web database restore mv dispatch-sample-data.dump dispatch-backup.dump => it says it is looking for the file is it looking for it ion the DB server (antic1) in this case? if so which location? |
If you're attempting to use docker to do the restore you have to make the file available to the container. It looks like you would want: |
Hi @kevgliss Thanks docker ps /dispatch/dispatch-docker# docker exec dispatch_postgres_1 ls /root/ /dispatch/dispatch-docker# docker-compose run web database restore RAN: /usr/bin/psql -h antic1.fyre.ibm.com -p 5432 -U postgres -d dispatch_db -f dispatch-backup.dump STDOUT: STDERR: Thanks |
The file will need to be copied to: |
docker cp dispatch-backup.dump dispatch_postgres_1:/usr/src/dispatch From installation folder: /root/dispatch/dispatch-docker ran See the same output I saw from previous post, No such file or directory |
dispatch I see is a file in this case? now containing the content of the .dump file dispatch/dispatch-docker# docker exec dispatch_postgres_1 ls -l /usr/src |
Sorry, I haven't done this within a container before. I think it would be easiest to copy your file to Like so: |
HI @kevgliss I see same result...
Thanks |
The issue is we're copying the file to a container that we aren't using. Each time we run the restore command we create a new container that then exits, and since we don't mount a consistent volume to the webserver we get a new filesystem each time. If you simply want to restore the sample data, run this from the host itself skipping the containers entirely:
The above assumes that you are running the postgres database with docker-compose, if you're running the database somewhere else adjust accordingly. |
Not experience myself with docker and docker-compose. Perhaps this doesn't help. I had a look at some tutorials You mention I was copying a file to a container that isn't being used. How is it not been used? dispatch_postgres_1 If a new container is being created with the restore command that exists how come it cannot be seen in that printout Anyway ..I don't necessarily need to use the containers...I start and stop docker-dispatch this way. I have the database running on another host which has the data populated being pointed to in the .env file.... DATABASE_CREDENTIALS=postgres: Used by postgres docker POSTGRES_DB=dispatch_db What is the difference between the two sections above? is the latter section used by the postgres container? Just trying to get the application to pick up the sample data what ever way... Why is it not seeing it? sudo -u postgres -i psql -h 127.0.0.1 -U postgres -p 5432 dispatch_db < /root/dispatch-sample-data.dump |
How does the application read the database? from the defined DB properties in .env ? |
@mvilanova After install of docker, docker-compose and the installation of dispatch itself (using install.sh) seem to have a problem figuring how to get the data to the UI.. Will data restore do the trick? |
1 similar comment
@mvilanova After install of docker, docker-compose and the installation of dispatch itself (using install.sh) seem to have a problem figuring how to get the data to the UI.. Will data restore do the trick? |
Trying docker-compose build... |
@mccannm1 I installed Dispatch using the |
Thank you @mvilanova |
Ok, sorry for the delay. It took way longer than I expected. I've updated the sample data (#518) and bumped the Postgres version on the Dispatch docker side from 9.6 to latest (Netflix/dispatch-docker#65) to make sure the dumps we create are compatible with the postgres version. Here are the steps to get Dispatch up and running with some sample data:
Let me know if you run into any issues. |
Hi @mvilanova I have included the docker-compose.yml and .env |
In the docker-compose.yml file please note I updated the volume to the data location .... this is where the data is stored on the database server (antic) I specified.....however this didn't to make any difference.. to the UI data being populated.. |
is the data visible to the application through a direct connection (port 5432) to a server with Postgres that has been manually |
I'm not quite sure what you mean here... it looks like you aren't using the included version of postgres at all: e.g. you have
As I mentioned earlier in the thread I would just us the native psql tools for your particular setup:
After which I would use psql (or some other application) to double check that data exists in your database:
|
HI @kevgliss docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES From here would I run that /usr/bin/psql ... On antic1: root@antic1:~# sudo -u postgres psql postgres=# \c dispatch
Schema | Name | Type | Owner |
Do those tables have any items? |
I executed the plsql as shown On antic1 some of the tables have rows... on antic1 before I populated the database like this: |
The dump file was taken from the repository... |
This file shows the output data (all select statements for all 54 tables... There is some data.... I presume the .dump file contains sample data to populate the various views/ dashboards |
the |
I am seeing that error in the UI when I access the dispatch server URL... |
@kevgliss @mvilanova But again I cannot see the data being populated in the UI, same error "Something has gone very wrong....etc" |
Hi @kevgliss @mvilanova |
We think at this point we've exhausted our resources in helping troubleshooting your specific issues. Generally, our stance is to help folks as much as possible and answer specific questions or issues. But I think this has become largely a troubleshooting exercise for your deployment setup, which we can't and don't intend to provide support for. If during your investigation, you find specific bugs or issues we're more than happy to help triage those. cc @mvilanova |
ok thanks @kevgliss @mvilanova .. |
Describe the bug
This similar to issue: #416
Problem: I start the dispatch server: docker-compose up -d
When I hit the URL http://server1.fyre.ibm.com:8000/dashboard I do see the page rendering
but the views/dashboards are not getting populated and a message appears saying
"Something has gone very wrong please retry or inform your admin you are receiving this error""
To Reproduce
Steps to reproduce the behavior:
What I have done (below)
Hello Kevin
I have been requested to investigate the possibility of using Netflix Dispatch as a new Incident Management
solution in my organization. I have TWO Fyre Virtual machines server1, server2. The former is where the dispatch
server is being installed and the second hosts the Postgres database that Dispatch relies on. I presume it is ok
to have the server and DB on two separate machines?
Both servers have Ubuntu OS. I have performed the following actions:
On server1, installed Docker (17.05.0) and Docker Compose (1.19.)
cloned the git repository and ran the install.sh. (no configuration changes made until later)
the install.sh produced the errors in attachment "Install_Dispatch.out", .. (this would be expected)
Setting up database...
No JWT secret specified, this is required if you are using basic authentication.
NCIDENT_DAILY_SUMMARY_ONCALL_SERVICE_ID has been deprecated. Please use INCIDENT_ONCALL_SERVICE_ID instead.
No metric providers specified metrics will not be sent.
ERROR:dispatch.common.utils.cli:Something went wrong with creating plugin rows, is the database setup correctly?
:
:
On server2, installed PostgreSQL 12.3
created a new role called 'dispatch' :
su - postgres
createuser --interactive --pwprompt
Enter name of role to add: dispatch
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
and then imported the sample .dump file from the Git repository to populate the database 'dispatch_db'
drop database dispatch_db
create database dispatch_db
sudo -u postgres -i psql -h 127.0.0.1 -U postgres -p 5432 dispatch_db < /root/dispatch-sample-data.dump
This was successful. and postgres is listening on 5432
Finally I made some configuration changes on server1
modified the .env file to include the Database information
NOTE: Ensure that DATABASE_CREDENTIALS match the values passed to POSTGRES_USER and POSTGRES_PASSWORD
DATABASE_CREDENTIALS=postgres:
DATABASE_HOSTNAME=server2.fyre.ibm.com
DATABASE_NAME=dispatch_db
DATABASE_PORT=5432
Used by postgres docker
POSTGRES_DB=dispatch_db
POSTGRES_PASSWORD=
POSTGRES_USER=postgres
Modified the. docker-compose.yml. file (this line)
I tried running the ./install.sh again.... but I still get the same error in the UI... the views are not getting populated.
I investigated further and used a small java application on server1 to connect to 'dispatch_db' and run a query on the database.
e.g SELECT ID,NAME,DESCRIPTION FROM INCIDENT_PRIORITY
java -cp ./postgresql-42.2.14.jre7.jar:. Testserver1 //server2.fyre.ibm.com:5432/dispatch_db postgres
This worked and output the query data , but ONLY after making these necessary changes on the Postgres side:
Insert line
listen_addresses = '*'
in postgresql.conf
Insert line
host dispatch_db all /24 md5
in pg_hba.conf . This is to allow connections from clients
then restart postgres service
so at this point it is possible to connect and retrieve the data from Postgres to remote computers
However I still cannot see the data coming across in the UI..
QUESTIONS:
As far as I can see the database is ok..
Is there some other change I need to make to get the data across to the dispatch machine?
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: