Hello,
I am trying to change the default password for the “admin” using the new “grafana-cli admin reset-admin-password passwd_name” feature. First time i ran the command i got the following error message:
“ubuntu@hostname:~$ sudo grafana-cli admin reset-admin-password test123test
Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath”
Then i change the homepath after looking at the “/etc/init.d/grafana-server” ( GRAFANA_HOME=/usr/share/grafana
). First time i ran the command i got:
ubuntu@hostname:/usr/share/grafana$ sudo grafana-cli admin reset-admin-password test123test
INFO[03-24|10:17:17] Initializing DB logger=sqlstore dbtype=sqlite3
INFO[03-24|10:17:17] Starting DB migration logger=migrator
INFO[03-24|10:17:17] Executing migration logger=migrator id="create migration_log table"
INFO[03-24|10:17:17] Executing migration logger=migrator id="create user table"
INFO[03-24|10:17:17] Executing migration logger=migrator id="add unique index user.login"
INFO[03-24|10:17:17] Executing migration logger=migrator id="add unique index user.email"
INFO[03-24|10:17:18] Executing migration logger=migrator id="drop index UQE_user_login - v1"
INFO[03-24|10:17:18] Executing migration logger=migrator id="drop index UQE_user_email - v1"
INFO[03-24|10:17:18] Executing migration logger=migrator id="Rename table user to user_v1 - v1"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create user table v2"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create index UQE_user_login - v2"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create index UQE_user_email - v2"
INFO[03-24|10:17:18] Executing migration logger=migrator id="copy data_source v1 to v2"
INFO[03-24|10:17:18] Executing migration logger=migrator id="Drop old table user_v1"
INFO[03-24|10:17:18] Executing migration logger=migrator id="Add column help_flags1 to user table"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create temp user table v1-7"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create index IDX_temp_user_email - v1-7"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create index IDX_temp_user_org_id - v1-7"
INFO[03-24|10:17:18] Executing migration logger=migrator id="create index IDX_temp_user_code - v1-7"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create index IDX_temp_user_status - v1-7"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create star table"
INFO[03-24|10:17:19] Executing migration logger=migrator id="add unique index star.user_id_dashboard_id"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create org table v1"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create index UQE_org_name - v1"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create org_user table v1"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create index IDX_org_user_org_id - v1"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create index UQE_org_user_org_id_user_id - v1"
INFO[03-24|10:17:19] Executing migration logger=migrator id="copy data account to org"
INFO[03-24|10:17:19] Skipping migration condition not fulfilled logger=migrator id="copy data account to org"
INFO[03-24|10:17:19] Executing migration logger=migrator id="copy data account_user to org_user"
INFO[03-24|10:17:19] Skipping migration condition not fulfilled logger=migrator id="copy data account_user to org_user"
INFO[03-24|10:17:19] Executing migration logger=migrator id="Drop old table account"
INFO[03-24|10:17:19] Executing migration logger=migrator id="Drop old table account_user"
INFO[03-24|10:17:19] Executing migration logger=migrator id="create dashboard table"
INFO[03-24|10:17:19] Executing migration logger=migrator id="add index dashboard.account_id"
INFO[03-24|10:17:19] Executing migration logger=migrator id="add unique index dashboard_account_id_slug"
INFO[03-24|10:17:20] Executing migration logger=migrator id="create dashboard_tag table"
INFO[03-24|10:17:20] Executing migration logger=migrator id="add unique index dashboard_tag.dasboard_id_term"
INFO[03-24|10:17:20] Executing migration logger=migrator id="drop index UQE_dashboard_tag_dashboard_id_term - v1"
INFO[03-24|10:17:20] Executing migration logger=migrator id="Rename table dashboard to dashboard_v1 - v1"
INFO[03-24|10:17:20] Executing migration logger=migrator id="create dashboard v2"
INFO[03-24|10:17:20] Executing migration logger=migrator id="create index IDX_dashboard_org_id - v2"
INFO[03-24|10:17:20] Executing migration logger=migrator id="create index UQE_dashboard_org_id_slug - v2"
INFO[03-24|10:17:20] Executing migration logger=migrator id="copy dashboard v1 to v2"
INFO[03-24|10:17:21] Executing migration logger=migrator id="drop table dashboard_v1"
INFO[03-24|10:17:21] Executing migration logger=migrator id="alter dashboard.data to mediumtext v1"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add column updated_by in dashboard - v2"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add column created_by in dashboard - v2"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add column gnetId in dashboard"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add index for gnetId in dashboard"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add column plugin_id in dashboard"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add index for plugin_id in dashboard"
INFO[03-24|10:17:21] Executing migration logger=migrator id="Add index for dashboard_id in dashboard_tag"
INFO[03-24|10:17:21] Executing migration logger=migrator id="create data_source table"
INFO[03-24|10:17:21] Executing migration logger=migrator id="add index data_source.account_id"
INFO[03-24|10:17:21] Executing migration logger=migrator id="add unique index data_source.account_id_name"
INFO[03-24|10:17:22] Executing migration logger=migrator id="drop index IDX_data_source_account_id - v1"
INFO[03-24|10:17:22] Executing migration logger=migrator id="drop index UQE_data_source_account_id_name - v1"
INFO[03-24|10:17:22] Executing migration logger=migrator id="Rename table data_source to data_source_v1 - v1"
INFO[03-24|10:17:22] Executing migration logger=migrator id="create data_source table v2"
INFO[03-24|10:17:22] Executing migration logger=migrator id="create index IDX_data_source_org_id - v2"
INFO[03-24|10:17:22] Executing migration logger=migrator id="create index UQE_data_source_org_id_name - v2"
INFO[03-24|10:17:22] Executing migration logger=migrator id="copy data_source v1 to v2"
INFO[03-24|10:17:22] Executing migration logger=migrator id="Drop old table data_source_v1 #2"
INFO[03-24|10:17:22] Executing migration logger=migrator id="Add column with_credentials"
INFO[03-24|10:17:22] Executing migration logger=migrator id="Add secure json data column"
INFO[03-24|10:17:22] Executing migration logger=migrator id="create api_key table"
INFO[03-24|10:17:22] Executing migration logger=migrator id="add index api_key.account_id"
INFO[03-24|10:17:22] Executing migration logger=migrator id="add index api_key.key"
INFO[03-24|10:17:23] Executing migration logger=migrator id="add index api_key.account_id_name"
INFO[03-24|10:17:23] Executing migration logger=migrator id="drop index IDX_api_key_account_id - v1"
INFO[03-24|10:17:23] Executing migration logger=migrator id="drop index UQE_api_key_key - v1"
INFO[03-24|10:17:23] Executing migration logger=migrator id="drop index UQE_api_key_account_id_name - v1"
INFO[03-24|10:17:23] Executing migration logger=migrator id="Rename table api_key to api_key_v1 - v1"
INFO[03-24|10:17:23] Executing migration logger=migrator id="create api_key table v2"
INFO[03-24|10:17:23] Executing migration logger=migrator id="create index IDX_api_key_org_id - v2"
INFO[03-24|10:17:23] Executing migration logger=migrator id="create index UQE_api_key_key - v2"
INFO[03-24|10:17:23] Executing migration logger=migrator id="create index UQE_api_key_org_id_name - v2"
INFO[03-24|10:17:23] Executing migration logger=migrator id="copy api_key v1 to v2"
INFO[03-24|10:17:23] Executing migration logger=migrator id="Drop old table api_key_v1"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create dashboard_snapshot table v4"
INFO[03-24|10:17:24] Executing migration logger=migrator id="drop table dashboard_snapshot_v4 #1"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create dashboard_snapshot table v5 #2"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create index UQE_dashboard_snapshot_key - v5"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create index UQE_dashboard_snapshot_delete_key - v5"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create index IDX_dashboard_snapshot_user_id - v5"
INFO[03-24|10:17:24] Executing migration logger=migrator id="alter dashboard_snapshot to mediumtext v2"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create quota table v1"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create index UQE_quota_org_id_user_id_target - v1"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create plugin_setting table"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create index UQE_plugin_setting_org_id_plugin_id - v1"
INFO[03-24|10:17:24] Executing migration logger=migrator id="Add column plugin_version to plugin_settings"
INFO[03-24|10:17:24] Executing migration logger=migrator id="create session table"
INFO[03-24|10:17:25] Executing migration logger=migrator id="Drop old table playlist table"
INFO[03-24|10:17:25] Executing migration logger=migrator id="Drop old table playlist_item table"
INFO[03-24|10:17:25] Executing migration logger=migrator id="create playlist table v2"
INFO[03-24|10:17:25] Executing migration logger=migrator id="create playlist item table v2"
INFO[03-24|10:17:25] Executing migration logger=migrator id="drop preferences table v2"
INFO[03-24|10:17:25] Executing migration logger=migrator id="drop preferences table v3"
INFO[03-24|10:17:25] Executing migration logger=migrator id="create preferences table v3"
INFO[03-24|10:17:25] Executing migration logger=migrator id="create alert table v1"
INFO[03-24|10:17:25] Executing migration logger=migrator id="add index alert org_id & id "
INFO[03-24|10:17:25] Executing migration logger=migrator id="add index alert state"
INFO[03-24|10:17:25] Executing migration logger=migrator id="add index alert dashboard_id"
INFO[03-24|10:17:25] Executing migration logger=migrator id="create alert_notification table v1"
INFO[03-24|10:17:26] Executing migration logger=migrator id="Add column is_default"
INFO[03-24|10:17:26] Executing migration logger=migrator id="add index alert_notification org_id & name"
INFO[03-24|10:17:26] Executing migration logger=migrator id="Drop old annotation table v4"
INFO[03-24|10:17:26] Executing migration logger=migrator id="create annotation table v5"
INFO[03-24|10:17:26] Executing migration logger=migrator id="add index annotation 0 v3"
INFO[03-24|10:17:26] Executing migration logger=migrator id="add index annotation 1 v3"
INFO[03-24|10:17:26] Executing migration logger=migrator id="add index annotation 2 v3"
INFO[03-24|10:17:26] Executing migration logger=migrator id="add index annotation 3 v3"
INFO[03-24|10:17:26] Executing migration logger=migrator id=“add index annotation 4 v3”
Error: Could not read user from database. Error: User not found
NAME:
Grafana cli admin reset-admin-password - reset-admin-password
USAGE:
Grafana cli admin reset-admin-password [arguments…]
Then every time i try to rerun the same command i get the following:
"
ubuntu@hostname:/usr/share/grafana$ sudo grafana-cli admin reset-admin-password test123test
INFO[03-24|11:09:35] Initializing DB logger=sqlstore dbtype=sqlite3
INFO[03-24|11:09:35] Starting DB migration logger=migrator
INFO[03-24|11:09:35] Executing migration logger=migrator id="copy data account to org"
INFO[03-24|11:09:35] Skipping migration condition not fulfilled logger=migrator id="copy data account to org"
INFO[03-24|11:09:35] Executing migration logger=migrator id="copy data account_user to org_user"
INFO[03-24|11:09:35] Skipping migration condition not fulfilled logger=migrator id=“copy data account_user to org_user”
Error: Could not read user from database. Error: User not found
NAME:
Grafana cli admin reset-admin-password - reset-admin-password
USAGE:
Grafana cli admin reset-admin-password [arguments…]
"
I tried to change the ubuntu user to “grafana” and execute the command but i don’t seem to succeed.
I tried on these versions: “4.1.1-1484211277” “4.1.2-1486989747” “4.2.0” “4.3.0-7355pre1”
What am i doing wrong?
Thank you