looker-open-source / gzr

A Command Line Tool for Looker Content Management
MIT License
124 stars 36 forks source link

Dashboard Import fails: "Must provide either a look_id, query_id, or result_maker_id for non-text dashboard element" #30

Closed raolivei closed 5 years ago

raolivei commented 5 years ago

gazer=v.0.2.13 ruby=v2.3.1p112

  1. I am setting up a looker instance script that is supposed to create a new ec2 instance if existing looker instance fails.

  2. The internal database was migrated to MySQL on RDS.

  3. We only have dashboards made on LookML Dashboards.

  4. In the existing instance, I run: gzr space export lookml --host <source_host> --no-verify-ssl --dir <directory> and space/dashboards are exported successfully (it looks like).

  5. In the new instance, I run: gzr dashboard import "<dashboard_name>" <space_id> --host <dest_host> --no-verify-ssl

But validation fails. Possibly trying to find look_id, query_id, or result_maker_id:

Error creating dashboard_element({
  "type": "vis",
  "refresh_interval": null,
  "note_text": "This is the top-level number, representing how close we are to 100% sustainable services - given however we define sustainable in terms of various metrics.",
  "note_display": "below",
  "note_state": "expanded",
  "title_hidden": false,
  "title_text": null,
  "title": "Service Sustainability",
  "subtitle_text": null,
  "body_text": null,
  "query_id": null,
  "look_id": null,
  "merge_result_id": null,
  "dashboard_id": 2,
  "result_maker": {
    "filterables": [
      {
        "model": "engineering",
        "view": "services",
        "name": null,
        "listen": [

        ]
      }
    ]
  }
})
Validation Failed
{:field=>"type", :code=>"invalid", :message=>"Must provide either a look_id, query_id, or result_maker_id for non-text dashboard element"}
amysouthwood commented 5 years ago

+1

We are trying to use Gzr on a LookML dashboard that has been converted to a UDD dashboard. Same error as example above.

Gzr v0.2.14 ruby 2.5.1p57

davidtamaki commented 5 years ago

+1

Same issues as above for importing a dashboard json file based off a LookML dashboard. Full error message:

Validation Failed
{:field=>"type", :code=>"invalid", :message=>"Must provide either a look_id, query_id, or result_maker_id for non-text dashboard element", :documentation_url=>"http://docs.looker.com/"}
/Users/David/.rvm/gems/ruby-2.3.0/gems/looker-sdk-0.0.6/lib/looker-sdk/response/raise_error.rb:15:in `on_complete'
/Users/David/.rvm/gems/ruby-2.3.0/gems/faraday-0.15.4/lib/faraday/response.rb:9:in `block in call'
/Users/David/.rvm/gems/ruby-2.3.0/gems/faraday-0.15.4/lib/faraday/response.rb:61:in `on_complete'
/Users/David/.rvm/gems/ruby-2.3.0/gems/faraday-0.15.4/lib/faraday/response.rb:8:in `call'
/Users/David/.rvm/gems/ruby-2.3.0/gems/faraday-0.15.4/lib/faraday/rack_builder.rb:143:in `build_response'
/Users/David/.rvm/gems/ruby-2.3.0/gems/faraday-0.15.4/lib/faraday/connection.rb:387:in `run_request'
/Users/David/.rvm/gems/ruby-2.3.0/gems/faraday-0.15.4/lib/faraday/connection.rb:175:in `post'
/Users/David/.rvm/gems/ruby-2.3.0/gems/sawyer-0.8.2/lib/sawyer/agent.rb:94:in `call'
/Users/David/.rvm/gems/ruby-2.3.0/gems/looker-sdk-0.0.6/lib/looker-sdk/client.rb:280:in `request'
/Users/David/.rvm/gems/ruby-2.3.0/gems/looker-sdk-0.0.6/lib/looker-sdk/client.rb:84:in `post'
/Users/David/.rvm/gems/ruby-2.3.0/gems/looker-sdk-0.0.6/lib/looker-sdk/client/dynamic.rb:97:in `invoke_remote'
/Users/David/.rvm/gems/ruby-2.3.0/gems/looker-sdk-0.0.6/lib/looker-sdk/client/dynamic.rb:63:in `method_missing'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/modules/dashboard.rb:107:in `create_dashboard_element'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/commands/dashboard/import.rb:178:in `sync_dashboard_element'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/commands/dashboard/import.rb:75:in `block (3 levels) in execute'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/command.rb:251:in `block in pairs'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/command.rb:251:in `collect'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/command.rb:251:in `pairs'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/commands/dashboard/import.rb:74:in `block (2 levels) in execute'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/modules/filehelper.rb:78:in `read_file'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/commands/dashboard/import.rb:54:in `block in execute'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/modules/session.rb:193:in `with_session'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/commands/dashboard/import.rb:50:in `execute'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/lib/gzr/commands/dashboard.rb:58:in `import'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
/Users/David/.rvm/gems/ruby-2.3.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
/Users/David/.rvm/gems/ruby-2.3.0/gems/gazer-0.2.14/exe/gzr:36:in `<top (required)>'
/Users/David/.rvm/gems/ruby-2.3.0/bin/gzr:23:in `load'
/Users/David/.rvm/gems/ruby-2.3.0/bin/gzr:23:in `<main>'
/Users/David/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:24:in `eval'
/Users/David/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:24:in `<main>'

gazer v0.2.14

drstrangelooker commented 5 years ago

Can anyone post the json of the dashboard they are attempting to import here so I can reproduce?

amysouthwood commented 5 years ago

@deangelo-llooker Error:

  "body_text": null,
  "note_display": null,
  "note_state": null,
  "note_text": null,
  "refresh_interval": null,
  "subtitle_text": null,
  "title": "rev wtd text",
  "title_hidden": false,
  "title_text": null,
  "type": "vis",
  "result_maker": {
    "filterables": [
      {
        "model": "digital_direct",
        "view": "ga_sessions",
        "name": null,
        "listen": [
          {
            "dashboard_filter_name": "Country",
            "field": "marketmaster.market_country"
          }
        ]
      }
    ]
  },
  "query_id": null,
  "look_id": null,
  "merge_result_id": null,
  "dashboard_id": 176
})
Validation Failed
{:field=>"type", :code=>"invalid", :message=>"Must provide either a look_id, query_id, or result_maker_id for non-text dashboard element", :documentation_url=>"http://docs.looker.com/"}

Filed attached: marketplaces.json.zip

amysouthwood commented 5 years ago

To note about the example I provided. This dashboard went through UDD > Lookml > UDD conversion. I was able to get rid of the gazer errors by editing every tile on the dashboard and where save was enabled with out making any changes resaving it. I do not know if this is the situation for the others who have experienced this but wanted to let you know

drstrangelooker commented 5 years ago

I just pushed gazer version 0.2.19. I believe that will fix this issue. If it does not fix we can reopen.

iamaziz commented 3 years ago

Hi, I'm having a similar problem while importing some dashboards. I tried the flag --force in gazer.

ruby 2.6.3p62 gazer v0.2.44


Error creating dashboard_element({
  "type": "vis",
  "refresh_interval": null,
  "note_text": null,
  "note_display": null,
  "note_state": null,
  "title_hidden": false,
  "title_text": null,
  "title": "Lowe's Survey Completion % by Service",
  "subtitle_text": null,
  "body_text": null,
  "result_maker": {
    "filterables": [
      {
        "model": "hy_dw",
        "view": "lowes_post_purchase_questions",
        "name": "Lowes Post Purchase Questions",
        "listen": [

        ]
      },
      {
        "model": "hy_dw",
        "view": "f_booking",
        "name": "Bookings",
        "listen": [

        ]
      }
    ]
  },
  "query_id": null,
  "look_id": null,
  "merge_result_id": null,
  "dashboard_id": 835
})
Validation Failed
{:field=>"type", :code=>"invalid", :message=>"Must provide either a look_id, query_id, or result_maker_id for non-text dashboard element", :documentation_url=>"http://docs.looker.com/"}
ERROR: Validation Failed
pioneer903 commented 2 years ago

I've seen this error when a look has been deleted from the folder. Best practice to verify that the dashboard has no errors

ice-ctrl commented 2 months ago

I have the same error. I updated gzr

drstrangelooker commented 2 months ago

@ice-ctrl Can you verify that the dashboard has no errors?