openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
822 stars 252 forks source link

Grafana Installation Error - Failed to update user password #921

Closed Goldich closed 4 years ago

Goldich commented 4 years ago

Hi, I have waited for #915 and used the recommended steps in #920. After reinstalling (entirely new) influx and Grafana I have encountered a new issue. As you can see at the end of the log, the Grafana users could not be changed. I'm not sure how to solve this issue now, since the default Grafana admin user neither accepting my set password nor de default one admin.

Attached the log:

[11:03:57] openhabian@openhab:/var/lib$ sudo openhabian-config
2020-05-27_11:04:12_CEST [openHABian] Checking for root privileges... OK
2020-05-27_11:04:12_CEST [openHABian] Updating Linux package information ... 2020-05-27_11:04:12_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2020-05-27_11:04:12_CEST [openHABian] openHABian configuration tool version: [master]v1.5-610(918e20c)
2020-05-27_11:04:12_CEST [openHABian] Checking for changes in origin... OK
2020-05-27_11:04:19_CEST [openHABian] Updating Linux package information ... 2020-05-27_11:04:19_CEST [openHABian] Setting up InfluxDB and Grafana...
CANCELED
2020-05-27_11:05:03_CEST [openHABian] Updating Linux package information ... 2020-05-27_11:05:03_CEST [openHABian] Setting up InfluxDB and Grafana...
openHAB is not running. InfluxDB and Grafana openHAB integration is skipped...

Installing InfluxDB...
--2020-05-27 11:05:38--  https://repos.influxdata.com/influxdb.key
Resolving repos.influxdata.com (repos.influxdata.com)... 2600:9000:2156:5e00:7:7790:e740:93a1, 2600:9000:2156:7800:7:7790:e740:93a1, 2600:9000:2156:d400:7:7790:e740:93a1, ...
Connecting to repos.influxdata.com (repos.influxdata.com)|2600:9000:2156:5e00:7:7790:e740:93a1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3108 (3.0K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                                  100%[==============================================================>]   3.04K  --.-KB/s    in 0s

2020-05-27 11:05:38 (94.6 MB/s) - written to stdout [3108/3108]

OK

$ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:2 http://archive.raspberrypi.org/debian buster InRelease [25.1 kB]
Hit:3 https://repos.influxdata.com/debian buster InRelease
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:5 https://packages.grafana.com/oss/deb stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Fetched 31.2 kB in 2s (19.5 kB/s)
Reading package lists... Done

$ apt-get -y install influxdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
influxdb is already the newest version (1.8.0-1).
The following packages were automatically installed and are no longer required:
  rpi.gpio-common triggerhappy
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

$ sed -i s/auth-enabled = true/# auth-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl daemon-reload

$ systemctl enable influxdb.service

$ systemctl restart influxdb.service
OK Configure InfluxDB admin account... {"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
OK Configure listen on localhost only...
$ sed -i -e /# Determines whether HTTP endpoint is enabled./ { n ; s/# enabled = true/enabled = true/ } /etc/influxdb/influxdb.conf

$ sed -i s/# bind-address = ":8086"/bind-address = "localhost:8086"/g /etc/influxdb/influxdb.conf

$ sed -i s/# auth-enabled = false/auth-enabled = true/g /etc/influxdb/influxdb.conf

$ sed -i s/# store-enabled = true/store-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl restart influxdb.service
OK Waiting for InfluxDB service... OK
Setup of inital influxdb database and InfluxDB users... {"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
OK Installing Grafana... --2020-05-27 11:05:54--  https://packages.grafana.com/gpg.key
Resolving packages.grafana.com (packages.grafana.com)... 2a04:4e42:3::729, 151.101.14.217
Connecting to packages.grafana.com (packages.grafana.com)|2a04:4e42:3::729|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/x-iwork-keynote-sffkey]
Saving to: ‘STDOUT’

-                                  100%[==============================================================>]   1.65K  --.-KB/s    in 0s

2020-05-27 11:05:55 (5.99 MB/s) - written to stdout [1694/1694]

OK

$ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:2 http://archive.raspberrypi.org/debian buster InRelease [25.1 kB]
Hit:3 https://repos.influxdata.com/debian buster InRelease
Hit:4 https://packages.grafana.com/oss/deb stable InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Fetched 31.2 kB in 2s (17.4 kB/s)
Reading package lists... Done

$ apt-get -y install grafana
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  rpi.gpio-common triggerhappy
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  grafana
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/41.7 MB of archives.
After this operation, 121 MB of additional disk space will be used.
Selecting previously unselected package grafana.
(Reading database ... 47738 files and directories currently installed.)
Preparing to unpack .../grafana_7.0.1_armhf.deb ...
Unpacking grafana (7.0.1) ...
Setting up grafana (7.0.1) ...
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Updating FireMotD available updates count ...

$ systemctl daemon-reload

$ systemctl enable grafana-server.service
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server

$ systemctl start grafana-server.service
OK
Wait for Grafana to start... OK
Resetting Grafana admin password...
$ grafana-cli admin reset-admin-password admin
INFO[05-27|11:06:28] Connecting to DB                         logger=sqlstore dbtype=sqlite3
INFO[05-27|11:06:28] Starting DB migration                    logger=migrator
INFO[05-27|11:06:28] Executing migration                      logger=migrator id="create migration_log table"
INFO[05-27|11:06:28] Executing migration                      logger=migrator id="create user table"
INFO[05-27|11:06:28] Executing migration                      logger=migrator id="add unique index user.login"
INFO[05-27|11:06:28] Executing migration                      logger=migrator id="add unique index user.email"
INFO[05-27|11:06:28] Executing migration                      logger=migrator id="drop index UQE_user_login - v1"
INFO[05-27|11:06:28] Executing migration                      logger=migrator id="drop index UQE_user_email - v1"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Rename table user to user_v1 - v1"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="create user table v2"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="create index UQE_user_login - v2"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="create index UQE_user_email - v2"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="copy data_source v1 to v2"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Drop old table user_v1"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Add column help_flags1 to user table"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Update user table charset"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Add last_seen_at column to user"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Add missing user data"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Add is_disabled column to user"
INFO[05-27|11:06:29] Executing migration                      logger=migrator id="Add index user.login/user.email"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create temp user table v1-7"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index IDX_temp_user_email - v1-7"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index IDX_temp_user_org_id - v1-7"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index IDX_temp_user_code - v1-7"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index IDX_temp_user_status - v1-7"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="Update temp_user table charset"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create star table"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="add unique index star.user_id_dashboard_id"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create org table v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index UQE_org_name - v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create org_user table v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index IDX_org_user_org_id - v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index UQE_org_user_org_id_user_id - v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="Update org table charset"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="Update org_user table charset"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="Migrate all Read Only Viewers to Viewers"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create dashboard table"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="add index dashboard.account_id"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="add unique index dashboard_account_id_slug"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create dashboard_tag table"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="add unique index dashboard_tag.dasboard_id_term"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="drop index UQE_dashboard_tag_dashboard_id_term - v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="Rename table dashboard to dashboard_v1 - v1"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create dashboard v2"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index IDX_dashboard_org_id - v2"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="create index UQE_dashboard_org_id_slug - v2"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="copy dashboard v1 to v2"
INFO[05-27|11:06:30] Executing migration                      logger=migrator id="drop table dashboard_v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="alter dashboard.data to mediumtext v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column updated_by in dashboard - v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column created_by in dashboard - v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column gnetId in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add index for gnetId in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column plugin_id in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add index for plugin_id in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add index for dashboard_id in dashboard_tag"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update dashboard table charset"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update dashboard_tag table charset"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column folder_id in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column isFolder in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column has_acl in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column uid in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update uid column values in dashboard"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add unique index dashboard_org_id_uid"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Remove unique index org_id_slug"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update dashboard title length"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add unique index for dashboard_org_id_title_folder_id"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create dashboard_provisioning"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Rename table dashboard_provisioning to dashboard_provisioning_tmp_qwerty - v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create dashboard_provisioning v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create index IDX_dashboard_provisioning_dashboard_id - v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create index IDX_dashboard_provisioning_dashboard_id_name - v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="copy dashboard_provisioning v1 to v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="drop dashboard_provisioning_tmp_qwerty"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add check_sum column"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add index for dashboard_title"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create data_source table"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="add index data_source.account_id"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="add unique index data_source.account_id_name"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="drop index IDX_data_source_account_id - v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="drop index UQE_data_source_account_id_name - v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Rename table data_source to data_source_v1 - v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create data_source table v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create index IDX_data_source_org_id - v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create index UQE_data_source_org_id_name - v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="copy data_source v1 to v2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Drop old table data_source_v1 #2"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add column with_credentials"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add secure json data column"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update data_source table charset"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update initial version to 1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add read_only data column"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Migrate logging ds to loki ds"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update json_data with nulls"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add uid column"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Update uid value"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="Add unique index datasource_org_id_uid"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="create api_key table"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="add index api_key.account_id"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="add index api_key.key"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="add index api_key.account_id_name"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="drop index IDX_api_key_account_id - v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="drop index UQE_api_key_key - v1"
INFO[05-27|11:06:31] Executing migration                      logger=migrator id="drop index UQE_api_key_account_id_name - v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Rename table api_key to api_key_v1 - v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create api_key table v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index IDX_api_key_org_id - v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index UQE_api_key_key - v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index UQE_api_key_org_id_name - v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="copy api_key v1 to v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Drop old table api_key_v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update api_key table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add expires to api_key table"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create dashboard_snapshot table v4"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="drop table dashboard_snapshot_v4 #1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create dashboard_snapshot table v5 #2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index UQE_dashboard_snapshot_key - v5"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index UQE_dashboard_snapshot_delete_key - v5"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index IDX_dashboard_snapshot_user_id - v5"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="alter dashboard_snapshot to mediumtext v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update dashboard_snapshot table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column external_delete_url to dashboard_snapshots table"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create quota table v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index UQE_quota_org_id_user_id_target - v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update quota table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create plugin_setting table"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create index UQE_plugin_setting_org_id_plugin_id - v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column plugin_version to plugin_settings"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update plugin_setting table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create session table"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Drop old table playlist table"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Drop old table playlist_item table"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create playlist table v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create playlist item table v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update playlist table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update playlist_item table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="drop preferences table v2"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="drop preferences table v3"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create preferences table v3"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update preferences table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column team_id in preferences"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update team_id column values in preferences"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create alert table v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="add index alert org_id & id "
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="add index alert state"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="add index alert dashboard_id"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Create alert_rule_tag table v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add unique index alert_rule_tag.alert_id_tag_id"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create alert_notification table v1"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column is_default"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column frequency"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column send_reminder"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Add column disable_resolve_message"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="add index alert_notification org_id & name"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update alert table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="Update alert_notification table charset"
INFO[05-27|11:06:32] Executing migration                      logger=migrator id="create notification_journal table v1"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index notification_journal org_id & alert_id & notifier_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="drop alert_notification_journal"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="create alert_notification_state table v1"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index alert_notification_state org_id & alert_id & notifier_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add for to alert table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add column uid in alert_notification"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Update uid column values in alert_notification"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add unique index alert_notification_org_id_uid"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Remove unique index org_id_name"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Drop old annotation table v4"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="create annotation table v5"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index annotation 0 v3"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index annotation 1 v3"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index annotation 2 v3"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index annotation 3 v3"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index annotation 4 v3"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Update annotation table charset"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add column region_id to annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Drop category_id index"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add column tags to annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Create annotation_tag table v2"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add unique index annotation_tag.annotation_id_tag_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Update alert annotations and set TEXT to empty"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add created time to annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add updated time to annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add index for created in annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add index for updated in annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Convert existing annotations from seconds to milliseconds"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add epoch_end column"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add index for epoch_end"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Make epoch_end the same as epoch"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Move region to single row"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Remove index org_id_epoch from annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Remove index org_id_dashboard_id_panel_id_epoch from annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add index for org_id_dashboard_id_epoch_end_epoch on annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add index for org_id_epoch_end_epoch on annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Remove index org_id_epoch_epoch_end from annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add index for alert_id on annotation table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="create test_data table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="create dashboard_version table v1"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index dashboard_version.dashboard_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add unique index dashboard_version.dashboard_id and dashboard_version.version"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Set dashboard version to 1 where 0"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="save existing dashboard data in dashboard_version table v1"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="alter dashboard_version.data to mediumtext v1"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="create team table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index team.org_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add unique index team_org_id_name"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="create team member table"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add index team_member.org_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="add unique index team_member_org_id_team_id_user_id"
INFO[05-27|11:06:33] Executing migration                      logger=migrator id="Add column email to team table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add column external to team_member table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add column permission to team_member table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create dashboard acl table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add index dashboard_acl_dashboard_id"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add unique index dashboard_acl_dashboard_id_user_id"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add unique index dashboard_acl_dashboard_id_team_id"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="save default acl rules in dashboard_acl table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create tag table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add index tag.key_value"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create login attempt table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add index login_attempt.username"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="drop index IDX_login_attempt_username - v1"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Rename table login_attempt to login_attempt_tmp_qwerty - v1"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create login_attempt v2"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create index IDX_login_attempt_username - v2"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="copy login_attempt v1 to v2"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="drop login_attempt_tmp_qwerty"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create user auth table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create index IDX_user_auth_auth_module_auth_id - v1"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="alter user_auth.auth_id to length 190"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add OAuth access token to user_auth"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add OAuth refresh token to user_auth"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add OAuth token type to user_auth"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add OAuth expiry to user_auth"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="Add index to user_id column in user_auth"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create server_lock table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add index server_lock.operation_uid"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create user auth token table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add unique index user_auth_token.auth_token"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add unique index user_auth_token.prev_auth_token"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="create cache_data table"
INFO[05-27|11:06:34] Executing migration                      logger=migrator id="add unique index cache_data.cache_key"
INFO[05-27|11:06:34] Created default admin                    logger=sqlstore user=admin

Admin password changed successfully ✔

OK
Updating Grafana admin password... Warning: Transient problem: HTTP error Will retry in 1 seconds. 7 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 2 seconds. 6 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 4 seconds. 5 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 8 seconds. 4 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 16 seconds. 3 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 32 seconds. 2 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 64 seconds. 1 retries
Warning: left.
{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}OK
Updating Grafana configuration...
$ sed -i -e /^# disable user signup \/ registration/ { n ; s/^;allow_sign_up = true/allow_sign_up = false/ } /etc/grafana/grafana.ini

$ sed -i -e /^# enable anonymous access/ { n ; s/^;enabled = false/enabled = true/ } /etc/grafana/grafana.ini
OK
$ systemctl restart grafana-server.service
Waiting for Grafana service... OK
Connection Grafana to InfluxDB...{"message":"Invalid username or password"}Adding openHAB dashboard tile for Grafana... 2020-05-27_11:08:47_CEST [openHABian] Adding an openHAB dashboard tile for 'grafana'... Replacing... OK

and here the Grafana log (/var/log/grafana/grafana.log)

t=2020-05-27T11:12:03+0200 lvl=info msg="Starting Grafana" logger=server version=7.0.1 commit=ef5b586d7d branch=HEAD compiled=2020-05-26T10:05:56+0200
t=2020-05-27T11:12:03+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2020-05-27T11:12:03+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2020-05-27T11:12:03+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2020-05-27T11:12:03+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2020-05-27T11:12:03+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2020-05-27T11:12:03+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2020-05-27T11:12:03+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2020-05-27T11:12:03+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2020-05-27T11:12:03+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2020-05-27T11:12:03+0200 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2020-05-27T11:12:03+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2020-05-27T11:12:03+0200 lvl=info msg="App mode production" logger=settings
t=2020-05-27T11:12:03+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/grafana-server.pid pid=570
t=2020-05-27T11:12:03+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2020-05-27T11:12:03+0200 lvl=info msg="Starting DB migration" logger=migrator
t=2020-05-27T11:12:03+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2020-05-27T11:12:04+0200 lvl=info msg="Registering plugin" logger=plugins name="Direct Input"
t=2020-05-27T11:12:05+0200 lvl=eror msg="failed to lock and execute cleanup of expired auth token" logger=auth error="attempt to write a readonly database"
t=2020-05-27T11:12:05+0200 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=

I have also tried to reset the default password with both methods described in https://codesposts.com/Wg04jK59 but neither worked.

holgerfriedrich commented 4 years ago

Hi @Goldich, did you try to run the installation a second time (without purging)? The internal db should have settled now....

Goldich commented 4 years ago

Hi @holgerfriedrich, I have just tried it again. This time no deinstallation straid to install. So I choose the option Install locally.

The error sticks at the end.

[12:50:20] openhabian@openhab:~$ sudo openhabian-config
[sudo] password for openhabian:
2020-05-27_12:50:30_CEST [openHABian] Checking for root privileges... OK
2020-05-27_12:50:30_CEST [openHABian] Updating Linux package information ... 2020-05-27_12:50:30_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2020-05-27_12:50:30_CEST [openHABian] openHABian configuration tool version: [master]v1.5-610(918e20c)
2020-05-27_12:50:30_CEST [openHABian] Checking for changes in origin... OK
2020-05-27_12:50:36_CEST [openHABian] Updating Linux package information ... 2020-05-27_12:50:36_CEST [openHABian] Setting up InfluxDB and Grafana...
CANCELED
2020-05-27_12:51:32_CEST [openHABian] Updating Linux package information ... 2020-05-27_12:51:32_CEST [openHABian] Setting up InfluxDB and Grafana...

Installing InfluxDB...
--2020-05-27 12:52:58--  https://repos.influxdata.com/influxdb.key
Resolving repos.influxdata.com (repos.influxdata.com)... 2600:9000:2156:5200:7:7790:e740:93a1, 2600:9000:2156:f400:7:7790:e740:93a1, 2600:9000:2156:ae00:7:7790:e740:93a1, ...
Connecting to repos.influxdata.com (repos.influxdata.com)|2600:9000:2156:5200:7:7790:e740:93a1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3108 (3.0K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                                                           100%[========================================================================================================================================>]   3.04K  --.-KB/s    in 0s

2020-05-27 12:52:58 (13.8 MB/s) - written to stdout [3108/3108]

OK

$ apt-get update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [25.1 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 https://repos.influxdata.com/debian buster InRelease
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:5 https://packages.grafana.com/oss/deb stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Fetched 31.2 kB in 2s (17.6 kB/s)
Reading package lists... Done

$ apt-get -y install influxdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
influxdb is already the newest version (1.8.0-1).
The following packages were automatically installed and are no longer required:
  rpi.gpio-common triggerhappy
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

$ sed -i s/auth-enabled = true/# auth-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl daemon-reload

$ systemctl enable influxdb.service

$ systemctl restart influxdb.service
OK Configure InfluxDB admin account... {"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
OK Configure listen on localhost only...
$ sed -i -e /# Determines whether HTTP endpoint is enabled./ { n ; s/# enabled = true/enabled = true/ } /etc/influxdb/influxdb.conf

$ sed -i s/# bind-address = ":8086"/bind-address = "localhost:8086"/g /etc/influxdb/influxdb.conf

$ sed -i s/# auth-enabled = false/auth-enabled = true/g /etc/influxdb/influxdb.conf

$ sed -i s/# store-enabled = true/store-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl restart influxdb.service
OK Waiting for InfluxDB service... OK
Setup of inital influxdb database and InfluxDB users... {"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0,"error":"user already exists"}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
OK Installing Grafana... --2020-05-27 12:53:15--  https://packages.grafana.com/gpg.key
Resolving packages.grafana.com (packages.grafana.com)... 2a04:4e42:3::729, 151.101.14.217
Connecting to packages.grafana.com (packages.grafana.com)|2a04:4e42:3::729|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/x-iwork-keynote-sffkey]
Saving to: ‘STDOUT’

-                                                           100%[========================================================================================================================================>]   1.65K  --.-KB/s    in 0s

2020-05-27 12:53:15 (12.0 MB/s) - written to stdout [1694/1694]

OK

$ apt-get update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [25.1 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 https://repos.influxdata.com/debian buster InRelease
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:5 https://packages.grafana.com/oss/deb stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Fetched 31.2 kB in 2s (17.6 kB/s)
Reading package lists... Done

$ apt-get -y install grafana
Reading package lists... Done
Building dependency tree
Reading state information... Done
grafana is already the newest version (7.0.1).
The following packages were automatically installed and are no longer required:
  rpi.gpio-common triggerhappy
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

$ systemctl daemon-reload

$ systemctl enable grafana-server.service
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server

$ systemctl start grafana-server.service
OK
Wait for Grafana to start... OK
Resetting Grafana admin password...
$ grafana-cli admin reset-admin-password admin
INFO[05-27|12:53:34] Connecting to DB                         logger=sqlstore dbtype=sqlite3
INFO[05-27|12:53:34] Starting DB migration                    logger=migrator

Admin password changed successfully ✔

OK
Updating Grafana admin password... Warning: Transient problem: HTTP error Will retry in 1 seconds. 7 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 2 seconds. 6 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 4 seconds. 5 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 8 seconds. 4 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 16 seconds. 3 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 32 seconds. 2 retries
Warning: left.
Warning: Transient problem: HTTP error Will retry in 64 seconds. 1 retries
Warning: left.
{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}{"message":"Failed to update user password"}OK
Updating Grafana configuration...
$ sed -i -e /^# disable user signup \/ registration/ { n ; s/^;allow_sign_up = true/allow_sign_up = false/ } /etc/grafana/grafana.ini

$ sed -i -e /^# enable anonymous access/ { n ; s/^;enabled = false/enabled = true/ } /etc/grafana/grafana.ini
OK
$ systemctl restart grafana-server.service
Waiting for Grafana service... OK
Connection Grafana to InfluxDB...{"message":"Invalid username or password"}Adding openHAB dashboard tile for Grafana... 2020-05-27_12:55:47_CEST [openHABian] Adding an openHAB dashboard tile for 'grafana'... Replacing... OK
Adding install InfluxDB with database configuration to openHAB
$ touch /etc/openhab2/services/influxdb.cfg
holgerfriedrich commented 4 years ago

Hello @Goldich, can you please re-check? I have added a restart of Grafana in between which will hopefully resolve the issue.

Goldich commented 4 years ago

Hi Holger, I have tested it and there was no change in the behavior.

holgerfriedrich commented 4 years ago

The problem is that I cannot reproduce it on my test install.... Will have a look again the next days.

suysh commented 4 years ago

Hello, I have the same problem here. Let me know if you want my logs or try something. When trying the installation via openhabian-config a second time it goes thru, but after a reboot influxdb is not started anymore at boot. Kind regards, Hans

suysh commented 4 years ago

I just installed my raspberry from scratch (to be sure I have the latest updates), and received the following log until the error. Kind regards, Hans

Linux openhab 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu May 28 14:08:48 2020 from 10.0.0.56

###############################################################################
###############  openhab  #####################################################
###############################################################################
##        Ip = 10.0.0.100
##   Release = Raspbian GNU/Linux 10 (buster)
##    Kernel = Linux 4.19.57-v7l+
##  Platform = Raspberry Pi 4 Model B Rev 1.2
##    Uptime = 0 day(s). 0:0:44
## CPU Usage = 52.12% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 2.73, 5m: 0.74, 15m: 0.25
##    Memory = Free: 3.56GB (92%), Used: 0.29GB (8%), Total: 3.86GB
##      Swap = Free: 0.09GB (100%), Used: 0.00GB (0%), Total: 0.09GB
##      Root = Free: 24.43GB (90%), Used: 2.49GB (10%), Total: 28.11GB
##   Updates = 0 apt updates available.
##  Sessions = 1 session(s)
## Processes = 126 running processes of 32768 maximum processes
###############################################################################

              Welcome to            __  _____    ____  _
            ____  ____  ___  ____  / / / /   |  / __ )(_)___ _____
           / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  / / __ `/ __ \
          / /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ / / /_/ / / / /
          \____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/_/\__,_/_/ /_/
              /_/
                  openHAB 2.5.5-1 (Release Build)

Looking for a place to get started? Check out 'sudo openhabian-config' and the
documentation at https://www.openhab.org/docs/installation/openhabian.html
The openHAB dashboard can be reached at http://openhab:8080
To interact with openHAB on the command line, execute: 'openhab-cli --help'

[14:11:05] openhabian@openhab:~$ sudo openhabian-config
[sudo] password for openhabian:
2020-05-28_14:11:21_CEST [openHABian] Checking for root privileges... OK
2020-05-28_14:11:24_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:11:24_CEST [openHABian] Loading confi                                     guration file '/etc/openhabian.conf'... OK
2020-05-28_14:11:24_CEST [openHABian] openHABian configuration tool version: [master]v1.5-611(2c4e0aa)
2020-05-28_14:11:24_CEST [openHABian] Checking for changes in origin... OK
2020-05-28_14:11:35_CEST [openHABian] Updating myself... OK - No remote changes detected. You are up to date!
2020-05-28_14:11:46_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:11:48_CEST [openHABian] Updating repo                                     sitories and upgrading installed packages...
$ apt-get --yes upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
The following packages have been kept back:
  binutils binutils-arm-linux-gnueabihf binutils-common libbinutils
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

$ java_install_or_update
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (Zulu 8.46.0.225-CA-linux_aarch32hf) (build 1.8.0_252-b225)
OpenJDK Client VM (Zulu 8.46.0.225-CA-linux_aarch32hf) (build 25.252-b225, mixed mode, Evaluation)

$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (Zulu 8.46.0.225-CA-linux_aarch32hf) (build 1.8.0_252-b225)
OpenJDK Client VM (Zulu 8.46.0.225-CA-linux_aarch32hf) (build 25.252-b225, mixed mode, Evaluation)
OK
2020-05-28_14:12:29_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:12:29_CEST [openHABian] Installing or                                      upgrading to latest openHAB release (stable)...
$ apt-key add /tmp/openhab-key.asc
OK

$ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Ign:3 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:4 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Fetched 6,051 B in 1s (5,651 B/s)
Reading package lists... Done

$ apt-get -y --allow-downgrades install openhab2=2.5.5-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
openhab2 is already the newest version (2.5.5-1).
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

$ adduser openhab gpio
The user `openhab' is already a member of `gpio'.

$ systemctl daemon-reload

$ systemctl enable --now openhab2
OK
Optimizing Java to run on low memory single board computers...
2020-05-28_14:13:00_CEST [openHABian] Adding an openHAB dashboard tile for 'openhabiandocs'... Replacing... OK
2020-05-28_14:13:05_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:13:05_CEST [openHABian] Installing ba                                     sic can't-be-wrong packages (screen, vim, ...)...
$ apt-get -y install screen vim nano mc vfu bash-completion htop curl wget multitail git util-linux bzip2 zip unzip xz-utils sof                                     tware-properties-common man-db whiptail acl usbutils dirmngr arping
Reading package lists... Done
Building dependency tree
Reading state information... Done
acl is already the newest version (2.2.53-4).
arping is already the newest version (2.19-6).
bash-completion is already the newest version (1:2.8-6).
bzip2 is already the newest version (1.0.6-9.2~deb10u1).
curl is already the newest version (7.64.0-4+deb10u1).
dirmngr is already the newest version (2.2.12-1+rpi1+deb10u1).
git is already the newest version (1:2.20.1-2+deb10u3).
htop is already the newest version (2.2.0-1).
man-db is already the newest version (2.8.5-2).
mc is already the newest version (3:4.8.22-1).
multitail is already the newest version (6.4.2-3).
nano is already the newest version (3.2-3).
screen is already the newest version (4.6.2-3).
software-properties-common is already the newest version (0.96.20.2-2).
unzip is already the newest version (6.0-23+deb10u1).
usbutils is already the newest version (1:010-3).
util-linux is already the newest version (2.33.1-0.1).
vfu is already the newest version (4.16+repack-1).
vim is already the newest version (2:8.1.0875-5).
wget is already the newest version (1.20.1-1.1).
whiptail is already the newest version (0.52.20-8).
xz-utils is already the newest version (5.2.4-1).
zip is already the newest version (3.0-11).
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
OK
2020-05-28_14:13:08_CEST [openHABian] Installing additional needed packages...
$ apt-get -y install apt-transport-https bc sysstat avahi-daemon python3 python3-pip avahi-autoipd fontconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.8.2.1).
avahi-autoipd is already the newest version (0.7-4+b1).
avahi-daemon is already the newest version (0.7-4+b1).
bc is already the newest version (1.07.1-2).
fontconfig is already the newest version (2.13.1-2).
python3 is already the newest version (3.7.3-1).
sysstat is already the newest version (12.0.3-2).
python3-pip is already the newest version (18.1-5+rpt1).
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
OK
2020-05-28_14:13:09_CEST [openHABian] Installing additional bluetooth packages...
$ apt-get -y install bluez python3-dev libbluetooth-dev raspberrypi-sys-mods pi-bluetooth python3-bluez
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-bluez is already the newest version (0.22+really0.22-1).
python3-dev is already the newest version (3.7.3-1).
bluez is already the newest version (5.50-1.2~deb10u1+rpt1).
libbluetooth-dev is already the newest version (5.50-1.2~deb10u1+rpt1).
pi-bluetooth is already the newest version (0.1.13).
raspberrypi-sys-mods is already the newest version (20200514).
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
OK
2020-05-28_14:13:14_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:13:14_CEST [openHABian] Adding slight                                     ly tuned bash config files to system... OK
2020-05-28_14:13:14_CEST [openHABian] Adding slightly tuned vim config file to system... OK
2020-05-28_14:13:14_CEST [openHABian] Adding openHAB syntax to vim editor...
$ wget -O /home/openhabian/.vim/syntax/openhab.vim https://raw.githubusercontent.com/cyberkov/openhab-vim/master/syntax/openhab.                                     vim
--2020-05-28 14:13:14--  https://raw.githubusercontent.com/cyberkov/openhab-vim/master/syntax/openhab.vim
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6065 (5.9K) [text/plain]
Saving to: ‘/home/openhabian/.vim/syntax/openhab.vim’

/home/openhabian/.vim/syntax/op 100%[=======================================================>]   5.92K  --.-KB/s    in 0.001s

2020-05-28 14:13:15 (5.54 MB/s) - ‘/home/openhabian/.vim/syntax/openhab.vim’ saved [6065/6065]

$ wget -O /home/openhabian/.vim/ftdetect/openhab.vim https://raw.githubusercontent.com/cyberkov/openhab-vim/master/ftdetect/open                                     hab.vim
--2020-05-28 14:13:15--  https://raw.githubusercontent.com/cyberkov/openhab-vim/master/ftdetect/openhab.vim
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 661 [text/plain]
Saving to: ‘/home/openhabian/.vim/ftdetect/openhab.vim’

/home/openhabian/.vim/ftdetect/ 100%[=======================================================>]     661  --.-KB/s    in 0s

2020-05-28 14:13:15 (9.54 MB/s) - ‘/home/openhabian/.vim/ftdetect/openhab.vim’ saved [661/661]

OK
2020-05-28_14:13:15_CEST [openHABian] Adding openHAB syntax to nano editor...
$ wget -O /usr/share/nano/openhab.nanorc https://raw.githubusercontent.com/airix1/openhabnano/master/openhab.nanorc
--2020-05-28 14:13:15--  https://raw.githubusercontent.com/airix1/openhabnano/master/openhab.nanorc
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2321 (2.3K) [text/plain]
Saving to: ‘/usr/share/nano/openhab.nanorc’

/usr/share/nano/openhab.nanorc  100%[=======================================================>]   2.27K  --.-KB/s    in 0s

2020-05-28 14:13:15 (10.5 MB/s) - ‘/usr/share/nano/openhab.nanorc’ saved [2321/2321]

OK
2020-05-28_14:13:15_CEST [openHABian] Adding openHAB scheme to multitail... OK
2020-05-28_14:13:19_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:13:19_CEST [openHABian] Preparing ope                                     nHAB folder mounts under /srv/...
$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=20f19ef7-01  /boot           vfat    defaults          0       2
PARTUUID=20f19ef7-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

/usr/share/openhab2          /srv/openhab2-sys           none bind 0 0
/etc/openhab2                /srv/openhab2-conf          none bind 0 0
/var/lib/openhab2            /srv/openhab2-userdata      none bind 0 0
/var/log/openhab2            /srv/openhab2-logs          none bind 0 0
/usr/share/openhab2/addons   /srv/openhab2-addons        none bind 0 0

$ mkdir -p /srv/openhab2-sys /srv/openhab2-conf /srv/openhab2-userdata /srv/openhab2-logs /srv/openhab2-addons

$ cp /opt/openhabian/includes/srv_readme.txt /srv/README.txt

$ chmod ugo+w /srv /srv/README.txt

$ mount --all --verbose
/proc                    : already mounted
/boot                    : already mounted
/                        : ignored
/srv/openhab2-sys        : already mounted
/srv/openhab2-conf       : already mounted
/srv/openhab2-userdata   : already mounted
/srv/openhab2-logs       : already mounted
/srv/openhab2-addons     : already mounted
OK
2020-05-28_14:13:19_CEST [openHABian] Applying miscellaneous system settings...
$ setcap cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep /opt/jdk/zulu8.46.0.225-ca-jdk8.0.252-linux_aarch32hf/bin/java

$ setcap cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep /usr/sbin/arping

$ echo Creating persistent systemd journal folder location: /var/log/journal
Creating persistent systemd journal folder location: /var/log/journal

$ echo Keeping at most 30 days of systemd journal entries
Keeping at most 30 days of systemd journal entries
OK
2020-05-28_14:13:24_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:13:24_CEST [openHABian] Applying file                                      permissions recommendations...
$ adduser openhab audio
The user `openhab' is already a member of `audio'.

$ adduser openhabian audio
The user `openhabian' is already a member of `audio'.

$ adduser openhab bluetooth
The user `openhab' is already a member of `bluetooth'.

$ adduser openhabian bluetooth
The user `openhabian' is already a member of `bluetooth'.

$ adduser openhab dialout
The user `openhab' is already a member of `dialout'.

$ adduser openhabian dialout
The user `openhabian' is already a member of `dialout'.

$ adduser openhab gpio
The user `openhab' is already a member of `gpio'.

$ adduser openhabian gpio
The user `openhabian' is already a member of `gpio'.

$ adduser openhab tty
The user `openhab' is already a member of `tty'.

$ adduser openhabian tty
The user `openhabian' is already a member of `tty'.

$ adduser openhabian openhab
The user `openhabian' is already a member of `openhab'.

$ chown openhab:openhab /srv /srv/README.txt /opt

$ chmod ugo+w /srv /srv/README.txt

$ chown -R openhab:openhab /etc/openhab2 /var/lib/openhab2 /var/log/openhab2 /usr/share/openhab2

$ chmod -R ug+wX /opt /etc/openhab2 /var/lib/openhab2 /var/log/openhab2 /usr/share/openhab2

$ chown -R openhabian:openhabian /home/openhabian

$ setfacl -R --remove-all /etc/openhab2 /var/lib/openhab2 /var/log/openhab2 /usr/share/openhab2

$ setfacl -R -m g::rwX /etc/openhab2 /var/lib/openhab2 /var/log/openhab2 /usr/share/openhab2

$ setfacl -R -m d:g::rwX /etc/openhab2 /var/lib/openhab2 /var/log/openhab2 /usr/share/openhab2
OK
2020-05-28_14:13:30_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:13:30_CEST [openHABian] Downloading a                                     nd setting up FireMotD...
$ apt-get -y install bc sysstat jq moreutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
bc is already the newest version (1.07.1-2).
jq is already the newest version (1.5+dfsg-2+b1).
moreutils is already the newest version (0.62-1+b1).
sysstat is already the newest version (12.0.3-2).
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

$ curl -s https://raw.githubusercontent.com/OutsideIT/FireMotD/master/FireMotD -o /tmp/FireMotD

$ /tmp/FireMotD -I
2020-05-28 14:13:36,211: FireMotD: Info: Attempting FireMotD installation
mkdir: cannot create directory '/usr/share/firemotd': File exists
mkdir: cannot create directory '/usr/share/firemotd/themes': File exists
mkdir: cannot create directory '/usr/share/firemotd/templates': File exists
2020-05-28 14:13:44,161: FireMotD: Info: Generating information
2020-05-28 14:13:44,219: FireMotD: Info: Debug mode
2020-05-28 14:13:44,230: FireMotD: Info: FireMotD action save started
2020-05-28 14:13:44,241: FireMotD: Info: Action "save"
2020-05-28 14:13:44,253: FireMotD: Info: Exportfile /usr/share/firemotd/data/FireMotD.json found.
2020-05-28 14:13:44,264: FireMotD: Info: Template type set to all. Overwriting..
2020-05-28 14:13:44,296: FireMotD: Info: Exploring HostIp
2020-05-28 14:13:46,904: FireMotD: Info: Exploring Release
2020-05-28 14:13:47,009: FireMotD: Info: Exploring Kernel
2020-05-28 14:13:47,066: FireMotD: Info: Exploring Platform
2020-05-28 14:13:47,157: FireMotD: Info: Exploring InstallDate
2020-05-28 14:13:47,212: FireMotD: Info: Exploring Updates
2020-05-28 14:14:30,581: FireMotD: Info: Exploring Httpd
2020-05-28 14:14:30,829: FireMotD: Info: Exploring Nginx
2020-05-28 14:14:30,934: FireMotD: Info: Exploring Mysql
2020-05-28 14:14:31,036: FireMotD: Info: Exploring Postgres
2020-05-28 14:14:31,114: FireMotD: Info: Exploring Php
2020-05-28 14:14:31,222: FireMotD: Info: Exploring Elasticsearch
2020-05-28 14:14:31,297: FireMotD: Info: Exploring Logstash
2020-05-28 14:14:31,373: FireMotD: Info: Exploring Kibana
2020-05-28 14:14:31,448: FireMotD: Info: Export system data to "/usr/share/firemotd/data/FireMotD.json" finished.
2020-05-28 14:14:31,477: FireMotD: Info: ExportFile: -rwxrw-rw- 1 root root 3230 May 28 14:14 /usr/share/firemotd/data/FireMotD.                                     json
2020-05-28 14:14:31,495: FireMotD: Info: FireMotD action save finished
2020-05-28 14:14:31,513: FireMotD: Info: Generating caches
2020-05-28 14:14:58,381: FireMotD: Info: Generating FireMotD
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
iiiiiiiiiiiiiii  openhab  iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
DD        Ip -> 10.0.0.100
DD   Release -> Raspbian GNU/Linux 10 (buster)
DD    Kernel -> Linux 4.19.118-v7l+
DD  Platform -> Raspberry Pi 4 Model B Rev 1.2
DD    Uptime -> 0 day(s). 0:4:50
DD CPU Usage -> 0% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
DD  CPU Load -> 1m: 2.44, 5m: 2.11, 15m: 0.98
DD    Memory -> Free: 3.16GB (82%), Used: 0.69GB (18%), Total: 3.86GB
DD      Swap -> Free: 0.09GB (100%), Used: 0.00GB (0%), Total: 0.09GB
DD      Root -> Free: 24.43GB (90%), Used: 2.49GB (10%), Total: 28.11GB
DD   Updates -> 0 apt updates available.
DD  Sessions -> 0 session(s)
DD Processes -> 134 running processes of 32768 maximum processes
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

$ FireMotD -G Gray

$ FireMotD -S
OK
2020-05-28_14:15:50_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:15:50_CEST [openHABian] Setting up th                                     e MQTT broker Eclipse Mosquitto...
$ apt-get -y install mosquitto mosquitto-clients
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libev4 libmosquitto1 libuv1 libwebsockets8
Suggested packages:
  apparmor
The following NEW packages will be installed:
  libev4 libmosquitto1 libuv1 libwebsockets8 mosquitto mosquitto-clients
0 upgraded, 6 newly installed, 0 to remove and 4 not upgraded.
Need to get 484 kB of archives.
After this operation, 1,054 kB of additional disk space will be used.
Get:1 http://mirror.nl.leaseweb.net/raspbian/raspbian buster/main armhf libev4 armhf 1:4.25-1 [34.5 kB]
Get:2 http://mirror.nl.leaseweb.net/raspbian/raspbian buster/main armhf libmosquitto1 armhf 1.5.7-1+deb10u1 [57.6 kB]
Get:3 http://mirror.nl.leaseweb.net/raspbian/raspbian buster/main armhf libuv1 armhf 1.24.1-1 [96.7 kB]
Get:4 http://mirror.nl.leaseweb.net/raspbian/raspbian buster/main armhf libwebsockets8 armhf 2.0.3-3 [85.6 kB]
Get:5 http://mirror.nl.leaseweb.net/raspbian/raspbian buster/main armhf mosquitto armhf 1.5.7-1+deb10u1 [143 kB]
Get:6 http://mirror.nl.leaseweb.net/raspbian/raspbian buster/main armhf mosquitto-clients armhf 1.5.7-1+deb10u1 [66.8 kB]
Fetched 484 kB in 3s (172 kB/s)
Selecting previously unselected package libev4:armhf.
(Reading database ... 47901 files and directories currently installed.)
Preparing to unpack .../0-libev4_1%3a4.25-1_armhf.deb ...
Unpacking libev4:armhf (1:4.25-1) ...
Selecting previously unselected package libmosquitto1:armhf.
Preparing to unpack .../1-libmosquitto1_1.5.7-1+deb10u1_armhf.deb ...
Unpacking libmosquitto1:armhf (1.5.7-1+deb10u1) ...
Selecting previously unselected package libuv1:armhf.
Preparing to unpack .../2-libuv1_1.24.1-1_armhf.deb ...
Unpacking libuv1:armhf (1.24.1-1) ...
Selecting previously unselected package libwebsockets8:armhf.
Preparing to unpack .../3-libwebsockets8_2.0.3-3_armhf.deb ...
Unpacking libwebsockets8:armhf (2.0.3-3) ...
Selecting previously unselected package mosquitto.
Preparing to unpack .../4-mosquitto_1.5.7-1+deb10u1_armhf.deb ...
Unpacking mosquitto (1.5.7-1+deb10u1) ...
Selecting previously unselected package mosquitto-clients.
Preparing to unpack .../5-mosquitto-clients_1.5.7-1+deb10u1_armhf.deb ...
Unpacking mosquitto-clients (1.5.7-1+deb10u1) ...
Setting up libmosquitto1:armhf (1.5.7-1+deb10u1) ...
Setting up libev4:armhf (1:4.25-1) ...
Setting up mosquitto-clients (1.5.7-1+deb10u1) ...
Setting up libuv1:armhf (1.24.1-1) ...
Setting up libwebsockets8:armhf (2.0.3-3) ...
Setting up mosquitto (1.5.7-1+deb10u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/mosquitto.service → /lib/systemd/system/mosquitto.service.
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Updating FireMotD available updates count ...

$ sed -i /password_file/d /etc/mosquitto/mosquitto.conf

$ sed -i /allow_anonymous/d /etc/mosquitto/mosquitto.conf

$ rm -f /etc/mosquitto/passwd

$ systemctl enable mosquitto.service
Synchronizing state of mosquitto.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mosquitto

$ systemctl restart mosquitto.service
OK
2020-05-28_14:16:44_CEST [openHABian] Updating Linux package information ... 2020-05-28_14:16:44_CEST [openHABian] Setting up In                                     fluxDB and Grafana...

Installing InfluxDB...
--2020-05-28 14:17:13--  https://repos.influxdata.com/influxdb.key
Resolving repos.influxdata.com (repos.influxdata.com)... 143.204.89.64, 143.204.89.40, 143.204.89.126, ...
Connecting to repos.influxdata.com (repos.influxdata.com)|143.204.89.64|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3108 (3.0K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                               100%[=======================================================>]   3.04K  --.-KB/s    in 0.001s

2020-05-28 14:17:13 (3.41 MB/s) - written to stdout [3108/3108]

OK

$ apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:3 https://repos.influxdata.com/debian buster InRelease [4,731 B]
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:5 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:6 https://repos.influxdata.com/debian buster/stable armhf Packages [929 B]
Fetched 11.7 kB in 1s (8,312 B/s)
Reading package lists... Done

$ apt-get -y install influxdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  influxdb
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 59.1 MB of archives.
After this operation, 151 MB of additional disk space will be used.
Get:1 https://repos.influxdata.com/debian buster/stable armhf influxdb armhf 1.8.0-1 [59.1 MB]
Fetched 59.1 MB in 13s (4,475 kB/s)
Selecting previously unselected package influxdb.
(Reading database ... 47964 files and directories currently installed.)
Preparing to unpack .../influxdb_1.8.0-1_armhf.deb ...
Unpacking influxdb (1.8.0-1) ...
Setting up influxdb (1.8.0-1) ...
Created symlink /etc/systemd/system/influxd.service → /lib/systemd/system/influxdb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/influxdb.service → /lib/systemd/system/influxdb.service.
Processing triggers for man-db (2.8.5-2) ...
Updating FireMotD available updates count ...

$ sed -i s/auth-enabled = true/# auth-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl daemon-reload

$ systemctl enable influxdb.service

$ systemctl restart influxdb.service
OK Configure InfluxDB admin account... {"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
OK Configure listen on localhost only...
$ sed -i -e /# Determines whether HTTP endpoint is enabled./ { n ; s/# enabled = true/enabled = true/ } /etc/influxdb/influxdb.c                                     onf

$ sed -i s/# bind-address = ":8086"/bind-address = "localhost:8086"/g /etc/influxdb/influxdb.conf

$ sed -i s/# auth-enabled = false/auth-enabled = true/g /etc/influxdb/influxdb.conf

$ sed -i s/# store-enabled = true/store-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl restart influxdb.service
OK Waiting for InfluxDB service... OK
Setup of inital influxdb database and InfluxDB users... {"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
{"results":[{"statement_id":0}]}
OK Installing Grafana... --2020-05-28 14:18:52--  https://packages.grafana.com/gpg.key
Resolving packages.grafana.com (packages.grafana.com)... 151.101.38.217, 2a04:4e42:9::729
Connecting to packages.grafana.com (packages.grafana.com)|151.101.38.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/x-iwork-keynote-sffkey]
Saving to: ‘STDOUT’

-                               100%[=======================================================>]   1.65K  --.-KB/s    in 0s

2020-05-28 14:18:53 (11.0 MB/s) - written to stdout [1694/1694]

OK

$ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Hit:4 https://repos.influxdata.com/debian buster InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:7 https://packages.grafana.com/oss/deb stable/main armhf Packages [16.6 kB]
Fetched 34.8 kB in 2s (22.3 kB/s)
Reading package lists... Done

$ apt-get -y install grafana
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  grafana
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 41.7 MB of archives.
After this operation, 121 MB of additional disk space will be used.
Get:1 https://packages.grafana.com/oss/deb stable/main armhf grafana armhf 7.0.1 [41.7 MB]
Fetched 41.7 MB in 10s (4,102 kB/s)
Selecting previously unselected package grafana.
(Reading database ... 47990 files and directories currently installed.)
Preparing to unpack .../grafana_7.0.1_armhf.deb ...
Unpacking grafana (7.0.1) ...
Setting up grafana (7.0.1) ...
Adding system user `grafana' (UID 112) ...
Adding new user `grafana' (UID 112) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using syst                                     emd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Updating FireMotD available updates count ...

$ systemctl daemon-reload

$ systemctl enable grafana-server.service
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.serv                                     ice.

$ systemctl start grafana-server.service
OK
Wait for Grafana to start... FAILED Connection Grafana to InfluxDB...curl: (7) Failed to connect to localhost port 3000: Connect                                     ion refused
Adding openHAB dashboard tile for Grafana... 2020-05-28_14:21:22_CEST [openHABian] Adding an openHAB dashboard tile for 'grafana                                     '... OK
Adding install InfluxDB with database configuration to openHAB
$ touch /etc/openhab2/services/influxdb.cfg

2020-05-28_14:22:13_CEST [openHABian] Checking for default openHABian username:password combination... FAILED
2020-05-28_14:22:15_CEST [openHABian] We hope you got what you came for! See you again soon ;)
[14:22:15] openhabian@openhab:~$
Goldich commented 4 years ago

I have tried now the following commands with the same result. sudo apt purge grafana sudo rm -fr /var/lib/grafana sudo apt purge influxdb

suysh commented 4 years ago

I did the installation today from scratch, and I received a successful installation message. But after a reboot influxdb is not started and when I try again the installation influxdb+grafana from openhabian-config it failed.

$ systemctl start grafana-server.service
OK
Wait for Grafana to start... FAILED Connection Grafana to InfluxDB...curl: (7) Failed to connect to localhost port 3000: Connection refused
Adding openHAB dashboard tile for Grafana... 2020-05-31_23:01:09_CEST [openHABian] Adding an openHAB dashboard tile for 'grafana'... Replacing... OK
Adding install InfluxDB with database configuration to openHAB
$ touch /etc/openhab2/services/influxdb.cfg
mstormi commented 4 years ago

just fyi https://community.openhab.org/t/update-upgrade-grafana/95299/43

holgerfriedrich commented 4 years ago

PR #927 is now under review. This hopefully fixes the installation issues. Installation works fine in Travis CI builds and also worked fine for me.

holgerfriedrich commented 4 years ago

@Goldich @suysh #927 is now merged to master branch. Please make sure that you switch to master branch before doing the installation. openhabian-config will anyway ask, if not use option 01 to switch to master.

Can you please re-check if the issue is resolved now?

Goldich commented 4 years ago

Hi @holgerfriedrich, I have changed to the master branch and pulled all updates until the latest PR. I have first purged Grafana & Influx DB with the following commands:

sudo apt purge grafana
sudo rm -fr /var/lib/grafana
sudo rm -fr /etc/grafana/
sudo apt purge influxdb
sudo rm -fr /var/lib/influxdb/

Then I installed via openhabian-config both new. At the end I have received 2 errors. The Grafana Admin Password could not be changed and Grafana could not connect to InfluxDB, displaying an access error.

I found in the Grafana log (/var/log/grafana/grafana.log) that the database is read-only as error message, why it could not change the admin password.

t=2020-06-01T14:37:29+0200 lvl=info msg="Created default admin" logger=sqlstore user=admin
t=2020-06-01T14:37:31+0200 lvl=info msg="Shutdown started" logger=server reason="System signal: terminated"
t=2020-06-01T14:37:31+0200 lvl=info msg="Stopped Stream Manager"
t=2020-06-01T14:37:31+0200 lvl=info msg="Starting Grafana" logger=server version=7.0.1 commit=ef5b586d7d branch=HEAD compiled=2020-05-26T10:05:56+0200
t=2020-06-01T14:37:31+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2020-06-01T14:37:31+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2020-06-01T14:37:31+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2020-06-01T14:37:31+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2020-06-01T14:37:31+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2020-06-01T14:37:31+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2020-06-01T14:37:31+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2020-06-01T14:37:31+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2020-06-01T14:37:31+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2020-06-01T14:37:31+0200 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2020-06-01T14:37:31+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2020-06-01T14:37:31+0200 lvl=info msg="App mode production" logger=settings
t=2020-06-01T14:37:31+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/grafana-server.pid pid=27867
t=2020-06-01T14:37:31+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2020-06-01T14:37:31+0200 lvl=info msg="Starting DB migration" logger=migrator
t=2020-06-01T14:37:31+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2020-06-01T14:37:31+0200 lvl=info msg="Registering plugin" logger=plugins name="Direct Input"
t=2020-06-01T14:37:31+0200 lvl=info msg="External plugins directory created" logger=plugins directory=/var/lib/grafana/plugins
t=2020-06-01T14:37:33+0200 lvl=eror msg="failed to lock and execute cleanup of expired auth token" logger=auth error="attempt to write a readonly database"
t=2020-06-01T14:37:33+0200 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
t=2020-06-01T14:37:41+0200 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=[::1] time_ms=1 size=29 referer=
t=2020-06-01T14:37:44+0200 lvl=eror msg="Failed to update last_seen_at" logger=context userId=1 orgId=1 uname=admin error="attempt to write a readonly database"
t=2020-06-01T14:37:44+0200 lvl=eror msg="Failed to update user password" logger=context userId=1 orgId=1 uname=admin error="attempt to write a readonly database"
t=2020-06-01T14:37:44+0200 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=PUT path=/api/admin/users/1/password status=500 remote_addr=[::1] time_ms=352 size=44 referer=
t=2020-06-01T14:37:44+0200 lvl=info msg="Shutdown started" logger=server reason="System signal: terminated"
t=2020-06-01T14:37:44+0200 lvl=info msg="Stopped Stream Manager"
t=2020-06-01T14:37:44+0200 lvl=info msg="Starting Grafana" logger=server version=7.0.1 commit=ef5b586d7d branch=HEAD compiled=2020-05-26T10:05:56+0200
t=2020-06-01T14:37:44+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2020-06-01T14:37:44+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2020-06-01T14:37:44+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2020-06-01T14:37:44+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2020-06-01T14:37:44+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2020-06-01T14:37:44+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2020-06-01T14:37:44+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2020-06-01T14:37:44+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2020-06-01T14:37:44+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2020-06-01T14:37:44+0200 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2020-06-01T14:37:44+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2020-06-01T14:37:44+0200 lvl=info msg="App mode production" logger=settings
t=2020-06-01T14:37:44+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/grafana-server.pid pid=27894
t=2020-06-01T14:37:44+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2020-06-01T14:37:44+0200 lvl=info msg="Starting DB migration" logger=migrator
t=2020-06-01T14:37:44+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2020-06-01T14:37:44+0200 lvl=info msg="Registering plugin" logger=plugins name="Direct Input"
t=2020-06-01T14:37:45+0200 lvl=eror msg="failed to lock and execute cleanup of expired auth token" logger=auth error="attempt to write a readonly database"
t=2020-06-01T14:37:45+0200 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
t=2020-06-01T14:37:46+0200 lvl=eror msg="Failed to save invalid login attempt" logger=login err="attempt to write a readonly database"
t=2020-06-01T14:37:46+0200 lvl=eror msg="Invalid username or password" logger=context error="Invalid Username or Password"
t=2020-06-01T14:37:46+0200 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=POST path=/api/datasources status=401 remote_addr=[::1] time_ms=162 size=42 referer=
t=2020-06-01T14:38:09+0200 lvl=eror msg="Error while signing in user" logger=context userId=0 orgId=1 uname= error="failed to create auth token: attempt to write a readonly database" remote_addr=[2003:e5:3f2b:1d00:4cd9:4fac:edeb:9a62]
t=2020-06-01T14:38:09+0200 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=POST path=/login status=500 remote_addr=[2003:e5:3f2b:1d00:4cd9:4fac:edeb:9a62] time_ms=224 size=41 referer="http://openhab:3000/login?redirect=%2F%3ForgId%3D1"
t=2020-06-01T14:38:17+0200 lvl=eror msg="Failed to save invalid login attempt" logger=login err="attempt to write a readonly database"
t=2020-06-01T14:38:17+0200 lvl=eror msg="Invalid username or password" logger=context userId=0 orgId=1 uname= error="Invalid Username or Password" remote_addr=[2003:e5:3f2b:1d00:4cd9:4fac:edeb:9a62]
t=2020-06-01T14:38:17+0200 lvl=info msg="Request Completed" logger=context userId=0 orgId=1 uname= method=POST path=/login status=401 remote_addr=[2003:e5:3f2b:1d00:4cd9:4fac:edeb:9a62] time_ms=223 size=42 referer="http://openhab:3000/login?redirect=%2F%3ForgId%3D1"
t=2020-06-01T14:39:47+0200 lvl=info msg="Shutdown started" logger=server reason="System signal: terminated"
t=2020-06-01T14:39:47+0200 lvl=info msg="Stopped Stream Manager"
t=2020-06-01T14:40:23+0200 lvl=info msg="Starting Grafana" logger=server version=7.0.1 commit=ef5b586d7d branch=HEAD compiled=2020-05-26T10:05:56+0200
t=2020-06-01T14:40:23+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2020-06-01T14:40:23+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2020-06-01T14:40:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2020-06-01T14:40:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2020-06-01T14:40:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2020-06-01T14:40:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2020-06-01T14:40:23+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2020-06-01T14:40:23+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2020-06-01T14:40:23+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2020-06-01T14:40:23+0200 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2020-06-01T14:40:23+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2020-06-01T14:40:23+0200 lvl=info msg="App mode production" logger=settings
t=2020-06-01T14:40:23+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/grafana-server.pid pid=577
t=2020-06-01T14:40:23+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2020-06-01T14:40:23+0200 lvl=info msg="Starting DB migration" logger=migrator
t=2020-06-01T14:40:23+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2020-06-01T14:40:24+0200 lvl=info msg="Registering plugin" logger=plugins name="Direct Input"
t=2020-06-01T14:40:25+0200 lvl=eror msg="failed to lock and execute cleanup of expired auth token" logger=auth error="attempt to write a readonly database"
t=2020-06-01T14:40:26+0200 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
t=2020-06-01T14:41:07+0200 lvl=eror msg="Error while signing in user" logger=context userId=0 orgId=1 uname= error="failed to create auth token: attempt to write a readonly database" remote_addr=10.20.0.47
t=2020-06-01T14:41:07+0200 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=POST path=/login status=500 remote_addr=10.20.0.47 time_ms=176 size=41 referer="http://openhab:3000/login?redirect=%2F%3ForgId%3D1"
t=2020-06-01T14:41:16+0200 lvl=eror msg="Failed to save invalid login attempt" logger=login err="attempt to write a readonly database"
t=2020-06-01T14:41:16+0200 lvl=eror msg="Invalid username or password" logger=context userId=0 orgId=1 uname= error="Invalid Username or Password" remote_addr=10.20.0.47
t=2020-06-01T14:41:16+0200 lvl=info msg="Request Completed" logger=context userId=0 orgId=1 uname= method=POST path=/login status=401 remote_addr=10.20.0.47 time_ms=182 size=42 referer="http://openhab:3000/login?redirect=%2F%3ForgId%3D1"

I saw, that the grafana.db is not in the grafana user/group.

[14:46:44] openhabian@openhab:/var/lib/grafana$ ls -all
total 492
drwxr-xr-x  4 grafana grafana   4096 Jun  1 14:37 .
drwxr-xr-x 33 root    root      4096 Jun  1 14:37 ..
-rw-r--r--  1 root    root    483328 Jun  1 14:37 grafana.db
drwxr-x---  2 grafana grafana   4096 Jun  1 14:37 plugins
drwx------  2 grafana grafana   4096 Jun  1 14:37 png

I used the following commands to correct the issue:

sudo chmod grafana:grafana /var/lib/grafana/grafana.db
sudo service grafana-server restart

When I now try to login to Grafana with admin:admin I received a message to change my password. Maybe you consider to explicitly change the owner rights of the grafana.db before setting passwords?

Just to clarify: I have added InfluxDB manually in Grafana and it works now for me. I would still recommend changing automaticly the grafana.db owner as part of the setup script.

holgerfriedrich commented 4 years ago

Hi, @Goldich, thank you for your really helpful error reports an testing! I cannot reproduce on my systems, but we can try different solutions.

Could you please try the following modification to /opt/openhabian/functions/influxdb+grafana.bash: replace

cond_redirect grafana-cli admin reset-admin-password admin || FAILED=2

by

cond_redirect su -s /bin/bash -c "grafana-cli admin reset-admin-password admin" grafana || FAILED=2

and see what happens?

Goldich commented 4 years ago

Shall I purge Grafana again for that?

holgerfriedrich commented 4 years ago

Yes, please. And please remove /var/lib/grafana to make sure the .db file is gone.

Goldich commented 4 years ago

It worked. No issues, no errors and everything setup. You can close this issue, when you have committed this change.

Thank you very much for your help ❤

suysh commented 4 years ago

@Goldich @suysh #927 is now merged to master branch. Please make sure that you switch to master branch before doing the installation. openhabian-config will anyway ask, if not use option 01 to switch to master.

Can you please re-check if the issue is resolved now?

I tried today again, but still same problems. I'm on the master branch (seen in title openHABian Config tool. There is some confusion about menu item '03 openHAB Stable' when the master branch is selected. Do I have to run this item or not? Typically after writing the image I run every step in the config tool.

mstormi commented 4 years ago

When you flash the image you don't have to manually run any of the menu options.

suysh commented 4 years ago

Aha, so only install mosquitto and influx+grafana with the tool?

mstormi commented 4 years ago

yes, or whatever external tool(s)

suysh commented 4 years ago

OK. Thanks for your help. I've just started another writing image to try the setup.

suysh commented 4 years ago

No success :-( Sorry. What I did: Write openhabian image, boot, wait for login prompt, start tool, install mosquitto, install influxdb+grafana. No errors received during installation. Reboot, try to place backup influxdb back : influxdb service was not started during boot. Start tool, install influxdb+grafana, then I get errors : see log below.

$ sed -i s/# auth-enabled = false/auth-enabled = true/g /etc/influxdb/influxdb.conf

$ sed -i s/# store-enabled = true/store-enabled = false/g /etc/influxdb/influxdb.conf

$ systemctl restart influxdb.service
FAILED Waiting for InfluxDB service... FAILED
Setup of inital influxdb database and InfluxDB users... curl: (7) Failed to connect to localhost port 8086: Connection refused
curl: (7) Failed to connect to localhost port 8086: Connection refused
curl: (7) Failed to connect to localhost port 8086: Connection refused
curl: (7) Failed to connect to localhost port 8086: Connection refused
curl: (7) Failed to connect to localhost port 8086: Connection refused
curl: (7) Failed to connect to localhost port 8086: Connection refused
curl: (7) Failed to connect to localhost port 8086: Connection refused
FAILED Installing Grafana... --2020-06-02 20:17:01--  https://packages.grafana.com/gpg.key
Resolving packages.grafana.com (packages.grafana.com)... 151.101.38.217, 2a04:4e42:9::729
Connecting to packages.grafana.com (packages.grafana.com)|151.101.38.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/x-iwork-keynote-sffkey]
Saving to: ‘STDOUT’

-                                             100%[================================================================================================>]   1.65K  --.-KB/s    in 0s

2020-06-02 20:17:01 (9.88 MB/s) - written to stdout [1694/1694]

OK

$ apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 https://packages.grafana.com/oss/deb stable InRelease
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:5 https://repos.influxdata.com/debian buster InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Fetched 6,051 B in 2s (2,745 B/s)
Reading package lists... Done

$ apt-get install --yes grafana
Reading package lists... Done
Building dependency tree
Reading state information... Done
grafana is already the newest version (7.0.1).
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

$ systemctl daemon-reload

$ systemctl enable grafana-server.service
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server

$ systemctl start grafana-server.service
OK
Wait for Grafana to start... -n (executing curl -s http://localhost:3000 >/dev/null)
OK
Resetting Grafana admin password...
$ su -s /bin/bash -c grafana-cli admin reset-admin-password admin grafana
INFO[06-02|20:17:27] Connecting to DB                         logger=sqlstore dbtype=sqlite3
INFO[06-02|20:17:27] Starting DB migration                    logger=migrator

Admin password changed successfully ✔

OK
Restarting Grafana...
$ systemctl restart grafana-server.service
OK -n (executing curl -s http://localhost:3000 >/dev/null)
.10.-n (executing curl -s http://localhost:3000 >/dev/null)
OK Updating Grafana admin password...
$ curl --user admin:admin --header Content-Type: application/json --request PUT --data {"password":"admin"} http://localhost:3000/api/admin/users/1/password
suysh commented 4 years ago

@mstormi Could it be that the dirs /var/lib/influxdb/meta and /var/lib/influxdb/data have the wrong permissions after default installation ? When I do sudo chmod -R +777 /var/lib/influxdb I can restore my database with the right permissions and influxdb start after reboot.