grafana / grafana/database-migrator

awk error

Open
#10 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
126
Forks
15
PR merge metrics
No merged PRs in 30d

Description

When running the script I'm getting messages like: `awk: escape.awk: line 4: syntax error at or near ,`

In dump `grafana.sql` only this:
```sql
TRUNCATE TABLE alert;
TRUNCATE TABLE alert_configuration;
TRUNCATE TABLE ngalert_configuration;
TRUNCATE TABLE alert_image;
TRUNCATE TABLE org;
TRUNCATE TABLE alert_instance;
TRUNCATE TABLE org_user;
TRUNCATE TABLE alert_notification;
TRUNCATE TABLE permission;
TRUNCATE TABLE alert_notification_state;
TRUNCATE TABLE playlist;
TRUNCATE TABLE alert_rule;
TRUNCATE TABLE playlist_item;
TRUNCATE TABLE alert_rule_tag;
TRUNCATE TABLE plugin_setting;
TRUNCATE TABLE alert_rule_version;
TRUNCATE TABLE preferences;
TRUNCATE TABLE annotation;
TRUNCATE TABLE provenance_type;
TRUNCATE TABLE annotation_tag;
TRUNCATE TABLE query_history;
TRUNCATE TABLE api_key;
TRUNCATE TABLE query_history_star;
TRUNCATE TABLE builtin_role;
TRUNCATE TABLE quota;
TRUNCATE TABLE cache_data;
TRUNCATE TABLE role;
TRUNCATE TABLE correlation;
TRUNCATE TABLE secrets;
TRUNCATE TABLE dashboard;
TRUNCATE TABLE seed_assignment;
TRUNCATE TABLE dashboard_acl;
TRUNCATE TABLE server_lock;
TRUNCATE TABLE dashboard_provisioning;
TRUNCATE TABLE session;
TRUNCATE TABLE dashboard_public;
TRUNCATE TABLE short_url;
TRUNCATE TABLE dashboard_snapshot;
TRUNCATE TABLE star;
TRUNCATE TABLE dashboard_tag;
TRUNCATE TABLE tag;
TRUNCATE TABLE dashboard_version;
TRUNCATE TABLE team;
TRUNCATE TABLE data_keys;
TRUNCATE TABLE team_member;
TRUNCATE TABLE data_source;
TRUNCATE TABLE team_role;
TRUNCATE TABLE entity_event;
TRUNCATE TABLE temp_user;
TRUNCATE TABLE file;
TRUNCATE TABLE test_data;
TRUNCATE TABLE file_meta;
TRUNCATE TABLE user;
TRUNCATE TABLE kv_store;
TRUNCATE TABLE user_auth;
TRUNCATE TABLE library_element;
TRUNCATE TABLE user_auth_token;
TRUNCATE TABLE library_element_connection;
TRUNCATE TABLE user_role;
TRUNCATE TABLE login_attempt
```
Grafana 9.2.3
SQLite 3.27.2
MySQL Ver 8.0.29-21 for Linux on x86_64 (Percona Server (GPL), Release '21', Revision 'c59f87d2854')

Method from this issue https://github.com/grafana/database-migrator/issues/3 didn`t help ((

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported failure with the migration script and the provided grafana.sql dump, then inspect escape.awk at line 4. Compare the behavior with the stated Grafana, SQLite, and MySQL versions. Done means the script completes without the awk syntax error and produces the expected migration SQL.

Written by the indexing model from the issue text.

Assessment

Tech stack
awk, mysql, shell, sqlite
Domain
cli, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.