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

Grafana doesn't get any data (synology/docker) #246

Closed
escuco opened this issue Jun 6, 2022 · 15 comments
Closed

Grafana doesn't get any data (synology/docker) #246

escuco opened this issue Jun 6, 2022 · 15 comments

Comments

@escuco
Copy link

escuco commented Jun 6, 2022

I've installed the latest docker container vwsfriend and vwsfriend-grafana on my Synology NAS and configured vwsfriend like described in the wiki: https://github.com/tillsteinbach/VWsFriend/wiki/Install#install-on-synology-docker-native-synology-ui-no-docker-compose

I can now login to vwsfriend on my NAS on ip_adress:4000 and I get the Vehicle Status for my ID.3 without any problems.

After that I configured also vwsfriend-grafana, but after log in on ip_adress:3000 I get only some blank "no data" controls and a warning "You have to set the URL for the VWsFriend user interface correctly: Go to the user interface on port 4000 and select "Database" > ”Connection Settings"".

Back on the user interface from vwsfriend I can not find any Database settings. Only the status page, where I can pick my car and view the informations and status from the car.

Back on the Synology docker settings for vwsfriend-grafana I've checked the VWSFRIEND_HOSTNAME setting and it seems ok:

Screenshot_20220606_173252

Is there anything I have to configure for Grafana?

Thank you!

@tillsteinbach
Copy link
Owner

In the VWsFriend UI go to database connection settings

@tillsteinbach
Copy link
Owner

Did you also Setup the postgres container?

@escuco
Copy link
Author

escuco commented Jun 6, 2022

I can't find any database connection setting in the VWsFriend UI - only the status for my car is showing up (which is working fine).

Because I followed the Synology docker instructions from your wiki, I didn't setup any postgres container.
Will try that tomorrow. Will VWsFriend-Grafana use it automatically?

@tillsteinbach
Copy link
Owner

Ah yes, the wiki entry is from a user. I think this is just for HomeKit. I will try to make that more clear.

@escuco
Copy link
Author

escuco commented Jun 7, 2022

I installed and set up the postgres container and configured the hosts IP in the docker settings for the grafana docker (DB_HOSTNAME). But for now, without any further access.

I've taken some screenshots from the container settings - maybe this helps.

Postgres Container Settings
Screenshot_Postgres

VWsFriends Container Settings
Screenshot_VWsFriends

VWsFriends-Grafana Container Settings
Screenshot_VWsFriends-Grafana01

Screenshot_VWsFriends-Grafana02

Screenshot_VWsFriends-Grafana03

Web UI
Screenshot_web_ui_01

WEB UI after clicking the two gears
Screenshot_web_ui_02

Web UI after clicking on my car
Screenshot_web_ui_03

Web UI Grafana with errors
Screenshot_Grafana

@tillsteinbach
Copy link
Owner

Do you have the connection settings environment variable:
DATABASE_URL=postgresql://${DB_USER-admin}:${DB_PASSWORD-secret}@${DB_HOSTNAME-postgresdbbackend}:${DB_PORT-5432}/${DB_NAME-vwsfriend}
and
—with-database In the ADDITIONAL_PARAMETERS?

@escuco
Copy link
Author

escuco commented Jun 8, 2022

After adding the ADDITIONAL_PARAMETER and the string for DATABASE_URL:

Screenshot_20220608_112614

the VWsFriends container doesn't start and the log throws this output:

Screenshot_20220608_112751

I think it has to do with Synologys own Docker implementation (and editing) of the .env file with the Disk Station Manager.

Maybe I'm now going to cancel the installation with Synologys DSM and try it with docker compose on the console.

@tillsteinbach
Copy link
Owner

Ah yes I think the variables are only substituted in docker compose. So you have to replace the variables the real values. e.g. ${DB_USER-admin} with the database password you configured in postgres.

@escuco
Copy link
Author

escuco commented Jun 8, 2022

That will be the reason.

Still in Synology DSM I've changed the string in DATABASE_URL to this:
postgresql://postgres:my_password@192.168.2.100:5433/vwsfriend

The log throws out this:
ERROR:agent_connector:Could not establish a connection to database, will try again after 10 seconds: (psycopg2.OperationalError) connection to server at "192.168.2.100", port 5433 failed: Connection refused

The port 5433 is correct because Synology uses its own postgres db on standard port 5432.
I've checked the docker postgres db server on port 5433 with a database client from my linux client and I can successfully connect to it.

But what about the database vwsfriend, that you named in the DATABASE_URL string? I'm wondering, that the vwsfriends container wants connect to it, but this DB doesn't exist at the start from the vwsfriends docker container.
At which point the DB vwsfriend should be created normally?

Thanks for your patience!

@tillsteinbach
Copy link
Owner

The error looks like there is no connection at all possible to the database. It is sometimes a bit tricky to allow connections between the containers. Maybe you have to configure something in the UI for it to work?

Regarding the database. The database should exist if you put the Variable POSTGRES_DB=vwsfriend to the postgres container. It then creates it when starting the first time.

@escuco
Copy link
Author

escuco commented Jun 9, 2022

Yes! Putting the variable POSTGRES_DB=vwsfriend to the Synology DSM settings for the postgres Container did the trick.

Now there are the database and the backup links available in the vwsfriends web UI and no error messages in the Grafana Web UI.

One last question: What is the difference between "Usable battery capacity (net)" and "Total battery capacity (gross)" in the vehicle parameters form?

Thanks for your support and patience. Now that I've all informations to set up vwsfriends on a Synology NAS via the DSM web UI, I'm thinking about to write a blog post about it for other Synology users. There are some specific things that you have to know (and to do manually) in opposite to the installation via docker compose.

Will keep you informed.

@escuco
Copy link
Author

escuco commented Jun 9, 2022

One last question: What is the difference between "Usable battery capacity (net)" and "Total battery capacity (gross)" in the vehicle parameters form?

Ah, I found it by myself.

@tillsteinbach
Copy link
Owner

Great that it works now!
If you would write a small manual for the DSM setup I would be very happy adding it to the wiki for other users.

@escuco escuco closed this as completed Jun 9, 2022
@escuco
Copy link
Author

escuco commented Jun 23, 2022

I'll write a documentation for the installation with DSM and ssh (which also works fine with synology), when I find some time.

@piridium
Copy link

@escuco Did you find time to write the documentation? I'm stuck at the same problem.

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

No branches or pull requests

3 participants