Database not found

Hi all i hope you can help me, I setup a geiger counter and want to use balena to collect the data, I followed the setup from this post : Build a simple radiation monitor using a Raspberry Pi, InfluxDB and Grafana
but I keep getting error:
InfluxDB Error: database not found: balena-sense

When I loolk at the logs I see the counter service always restarting
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:08 +0000] “GET /query?db=balena-sense&epoch=ms&q=%3BSELECT+moving_average%28%22cpm%22%2C+120%29+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c8dadf7a-9973-11ed-8bcd-0242ac110003 28837
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:08 +0000] “GET /query?db=balena-sense&epoch=ms&q=SELECT+%22cpm%22+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c8e0f6e1-9973-11ed-8bce-0242ac110003 15481
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:08 +0000] “GET /query?db=balena-sense&epoch=ms&q=SELECT+%22usvh%22+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c8e6181d-9973-11ed-8bcf-0242ac110003 28985
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:08 +0000] “GET /query?db=balena-sense&epoch=ms&q=SELECT+moving_average%28%22cpm%22%2C+120%29+%2A+0.00812037037037+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c8e89be6-9973-11ed-8bd0-0242ac110003 30009
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:09 +0000] “GET /query?db=balena-sense&epoch=ms&q=%3BSELECT+moving_average%28%22cpm%22%2C+120%29+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c90c2fd1-9973-11ed-8bd1-0242ac110003 12540
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:09 +0000] “GET /query?db=balena-sense&epoch=ms&q=SELECT+%22usvh%22+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c91c2165-9973-11ed-8bd2-0242ac110003 44487
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:09 +0000] “GET /query?db=balena-sense&epoch=ms&q=SELECT+moving_average%28%22cpm%22%2C+120%29+%2A+0.00812037037037+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c9253c0c-9973-11ed-8bd3-0242ac110003 27401
influxdb [httpd] 52.4.252.97, 52.4.252.97,172.17.0.2 - - [21/Jan/2023:10:10:09 +0000] “GET /query?db=balena-sense&epoch=ms&q=SELECT+%22cpm%22+FROM+%22balena-sense%22+WHERE+time+%3E%3D+now%28%29±+12h HTTP/1.1” 200 96 “-” “Grafana/7.0.3” c92e377d-9973-11ed-8bd4-0242ac110003 26597
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Restarting service ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’
Service exited ‘counter sha256:f49b385c0b04a5ca6cf619189c71ffb033f9bf39dbea6285c495ecd8f7964160’

Hello @blazinfatherted this is weird! Could you please confirm if there is any issue from the counter service?

I see here that the balena-sense table should have been created from this service → background-radiation-monitor/counter.py at 2f7c5f71771a6f78d75bef6c4e3f139cd099ae5c · chrisys/background-radiation-monitor · GitHub

Let us know if you discover anything!

Running the command from infuxdb
/# influx -execute ‘SHOW DATABASES’
name: databases
name

_internal

Proof really the database isn’t being created, I confirm the data source is being created with the name balena-sense but “test” fails with “Database not found”

So it does appear the when the scripts get deployed the database isn’t being setup.

Any help to find out why I would be very greatful. I tried releasing a new build I see the three services update but always resulting in the couter service restarting

I think the problem is with the name, I am able to create databases ut not a DB with hyphen in it
CREATE DATABASE balena-sense
ERR: error parsing query: found -, expected ; at line 1, char 23
Warning: It is possible this error is due to not setting a database.
Please set a database with the command “use ”.

I was able to create a database called balena2sense with out issues Char 23 is “-”

now if I run SHOW DATABASES

SHOW DATABASES
name: databases
name

_internal
TEST
balena2sense

When i create a new datasoruce for balena2sense it connects

I think its as simple as that

Hey there, I’ve just tested this on mine and couldn’t reproduce it, although I did find an issue where the Influx data wasn’t being redirected to the shared volume (persistent storage) correctly. I’ve pushed a new version to the repo to resolve that.

Even after doing that I’ve tried deploying it again and clearing all my data and am not finding the issue with a database name with a -. I’m wondering if it’s an issue that only is present with a specific version of Influx. I found the documentation states that it’s OK to use dashes: InfluxDB frequently asked questions | InfluxDB OSS 1.8 Documentation

But then I also found a GH issue saying it isn’t (in v0.9): Unable to create database with name including dashes · Issue #2284 · influxdata/influxdb · GitHub

Screenshot 2023-01-27 at 12.24.20

Either way, I’m glad you figured it out!

Thanks for that the command CREATE DATABASE “balena-sense” Worked!

Thanks every one double quotes did the trick

1 Like

if the database has become corrupted, you may not able to access it. try to restore a backup of database or consult a database adminstrator for assistance. if its not work then you need to consult the documentation for application or software you are using.