looker-open-source/gzr

Gazer failing to import Dashboards

Closed this issue · 5 comments

We are seeing failures in importing dashboards with the below error message we found in logs.

existing_dashboard object nil
slug MOWP2rFThYeDJNTZCMeqFO already used for dashboard Check Register in folder 1010
dashboard will be imported with new slug
................
............
Error creating query({
"view": "checkregister",
"fields": [
"checkregister.BankAccountName",
"checkregister.PaymentDate_date",
"checkregister.ReferenceNumber",
"checkregister.CheckNumber",
"checkregister.PayerName",
"checkregister.CheckExportNumber",
"checkregister.TotalAmount",
"checkregister.IsExported",
"checkregister.OrgName"
],
"pivots": null,
"fill_fields": null,
"filters": null,
"filter_expression": null,
"sorts": [
"checkregister.BankAccountName"
],
"limit": "500",
"column_limit": "50",
"total": true,
"row_total": null,
"subtotals": null,
"vis_config": {
"show_view_names": false,
"show_row_numbers": false,
"truncate_column_names": false,
"hide_totals": false,
"hide_row_totals": false,
"table_theme": "unstyled",
"limit_displayed_rows": false,
"enable_conditional_formatting": false,
"conditional_formatting_include_totals": false,
"conditional_formatting_include_nulls": false,
"series_labels": {
"checkregister.BankAccountName": "Bank Account",
"checkregister.PaymentDate_date": "Payment Date",
"checkregister.PayerName": "Payee Name",
"checkregister.CheckExportNumber": "Export Number",
"checkregister.OrgName": "Branch",
"checkregister.TotalAmount": "Amount",
"checkregister.IsExported": "Is Exported?"
},
"hidden_pivots": {
},
"type": "table",
"defaults_version": 1,
"series_types": {
}
},
"filter_config": {
},
"visible_ui_sections": null,
"model": "ezl_Accounting",
"dynamic_fields": "[]",
"query_timezone": "UTC"
})
POST https://appliedsystems.cloud.looker.com/api/4.0/queries: 404 - The resource you're looking for could not be found.
/var/lib/gems/2.7.0/gems/looker-sdk-0.1.6/lib/looker-sdk/response/raise_error.rb:37:in on_complete' /var/lib/gems/2.7.0/gems/faraday-2.7.12/lib/faraday/middleware.rb:18:in block in call'
/var/lib/gems/2.7.0/gems/faraday-2.7.12/lib/faraday/response.rb:42:in on_complete' /var/lib/gems/2.7.0/gems/faraday-2.7.12/lib/faraday/middleware.rb:17:in call'
/var/lib/gems/2.7.0/gems/faraday-2.7.12/lib/faraday/rack_builder.rb:153:in build_response' /var/lib/gems/2.7.0/gems/faraday-2.7.12/lib/faraday/connection.rb:444:in run_request'
/var/lib/gems/2.7.0/gems/faraday-2.7.12/lib/faraday/connection.rb:280:in post' /var/lib/gems/2.7.0/gems/sawyer-0.9.2/lib/sawyer/agent.rb:99:in call'
/var/lib/gems/2.7.0/gems/looker-sdk-0.1.6/lib/looker-sdk/client.rb:316:in request' /var/lib/gems/2.7.0/gems/looker-sdk-0.1.6/lib/looker-sdk/client.rb:112:in post'
/var/lib/gems/2.7.0/gems/looker-sdk-0.1.6/lib/looker-sdk/client/dynamic.rb:147:in invoke_remote' /var/lib/gems/2.7.0/gems/looker-sdk-0.1.6/lib/looker-sdk/client/dynamic.rb:107:in method_missing'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/command.rb:90:in create_query' /var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/modules/look.rb:173:in create_fetch_query'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard/import.rb:233:in process_dashboard_element' /var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard/import.rb:85:in block (3 levels) in execute'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard/import.rb:81:in map' /var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard/import.rb:81:in block (2 levels) in execute'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/modules/filehelper.rb:89:in read_file' /var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard/import.rb:54:in block in execute'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/modules/session.rb:306:in with_session' /var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard/import.rb:50:in execute'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/lib/gzr/commands/dashboard.rb:80:in import' /var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor/command.rb:28:in run'
/var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in invoke_command' /var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor.rb:527:in dispatch'
/var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor/invocation.rb:116:in invoke' /var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor.rb:338:in block in subcommand'
/var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor/command.rb:28:in run' /var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in invoke_command'
/var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor.rb:527:in dispatch' /var/lib/gems/2.7.0/gems/thor-1.3.0/lib/thor/base.rb:584:in start'
/var/lib/gems/2.7.0/gems/gazer-0.3.12/exe/gzr:36:in <top (required)>' /usr/local/bin/gzr:23:in load'
/usr/local/bin/gzr:23:in `

'
logout
ERROR: The resource you're looking for could not be found

We see blank dasboards because of this error. There were 18 dasboards failed from importing due to above issue occurred for every one of 18 dashboards.

I appreciate someone assist in this. TIA

The most common issue here would be that the explore checkregister does not exist, or one of the referenced fields in checkregister doesn't exist. Can you check all that?

I could find the checkregister explore and could query it as well.

I'm still looking into this. Can you confirm that all the fields are available as well? Thanks

Any updates on the issue? We are also seeing this issue while importing any dashboard.

/usr/lib/ruby/2.7.0/json/common.rb:156:in `parse': 783: unexpected token at 'Error querying query(11896376) (JSON::ParserError)
GET [MASKED]/api/4.0/queries/11896376: 404 - Not found
 // See: https://cloud.google.com/looker/docs/r/err/4.0/404/get/queries/:query_id
 // And: https://marketplace-api.looker.com/errorcodes/404.md
ERROR: Not found
'
	from /usr/lib/ruby/2.7.0/json/common.rb:156:in `parse'
	from /var/lib/gems/2.7.0/gems/gazer-0.3.9/lib/gzr/modules/filehelper.rb:83:in `read_file'
	from /var/lib/gems/2.7.0/gems/gazer-0.3.9/lib/gzr/commands/dashboard/import.rb:54:in `block in execute'
	from /var/lib/gems/2.7.0/gems/gazer-0.3.9/lib/gzr/modules/session.rb:306:in `with_session'
	from /var/lib/gems/2.7.0/gems/gazer-0.3.9/lib/gzr/commands/dashboard/import.rb:50:in `execute'
	from /var/lib/gems/2.7.0/gems/gazer-0.3.9/lib/gzr/commands/dashboard.rb:80:in `import'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor/invocation.rb:116:in `invoke'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor.rb:243:in `block in subcommand'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
	from /var/lib/gems/2.7.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
	from /var/lib/gems/2.7.0/gems/gazer-0.3.9/exe/gzr:36:in `<top (required)>'
	from /usr/local/bin/gzr:23:in `load'
	from /usr/local/bin/gzr:23:in `<main>

For exporting we are doing

gzr dashboard cat 12718 --host dashboard.bdp.xxx.com --port 19999 --client_id $LOOKERSDK_CLIENT_ID --client_secret $LOOKERSDK_CLIENT_SECRET > dashboard12718.json

For import
gzr dashboard import /Users/xxx/workspace/thor-xx/looker/dashboards/dashboard_12718.json 4559 --host looker-bolt.bdp.xxxx.com --port 19999 --client_id $LOOKERSDK_CLIENT_ID --client_secret $LOOKERSDK_CLIENT_SECRET --force

That issue should be resolved by upgrading Gazer to the latest version. gem upgrade gazer.