Nil dashboard[:dashboard_layouts]
Closed this issue · 10 comments
Hi,
We are getting nil for dashboard[:dashboard_layouts] for couple of the dashboards.
Looker instance and example dashboard:
https://affinityembed.cloud.looker.com/dashboards/679
https://affinityembed.cloud.looker.com/dashboards/1129
Error message:
/usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:97:in `block (3 levels) in execute': undefined method `first' for nil:NilClass (NoMethodError)
layout_obj = get_dashboard_layout(dashboard[:dashboard_layouts].first.id)
^^^^^^
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:94:in `map'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:94:in `block (2 levels) in execute'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/modules/filehelper.rb:88:in `read_file'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:54:in `block in execute'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/modules/session.rb:249:in `with_session'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:50:in `execute'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard.rb:78:in `import'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:116:in `invoke'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:243:in `block in subcommand'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
from /usr/local/bundle/gems/gazer-0.2.54/exe/gzr:36:in `<top (required)>'
from /usr/local/bundle/bin/gzr:25:in `load'
from /usr/local/bundle/bin/gzr:25:in `<main>'
Thanks!
@jiepiao would it be possible for you to send me the dashboard exports? I haven't been able to recreate the error in my testing. If you could email them to byte-engineering@bytecode.io that would be great!
@michaelcramer Thanks for taking a look, I have sent the json file to the email you mentioned.
I noticed this can be resolved by edit/save the dashboard, seems like saving the dashboard again changing the dashboard to correct format?
Thanks!
@jiepiao Thanks for sending! Was that export after you edited/saved the dashboard? I was able to import it just fine.
Could you also tell me what version of Looker you're running?
Interesting, I am also able to import it now.. It might because of the script to calling the gazer. Please feel free to close the issue, I will cut another if I found any issue for gazer.
Glad you got it working - thanks for letting us know, @jiepiao!
Same issue happened again for dashboard: https://affinityembed2.cloud.looker.com/dashboards/902
May I re-open this issue?
/usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:97:in `block (3 levels) in execute': undefined method `first' for nil:NilClass (NoMethodError)
layout_obj = get_dashboard_layout(dashboard[:dashboard_layouts].first.id)
^^^^^^
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:94:in `map'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:94:in `block (2 levels) in execute'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/modules/filehelper.rb:88:in `read_file'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:54:in `block in execute'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/modules/session.rb:249:in `with_session'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard/import.rb:50:in `execute'
from /usr/local/bundle/gems/gazer-0.2.54/lib/gzr/commands/dashboard.rb:78:in `import'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:116:in `invoke'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:243:in `block in subcommand'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /usr/local/bundle/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
from /usr/local/bundle/gems/gazer-0.2.54/exe/gzr:36:in `<top (required)>'
from /usr/local/bundle/bin/gzr:25:in `load'
from /usr/local/bundle/bin/gzr:25:in `<main>
Hello @jiepiao,
Did the issue continue after trying to edited/saved the dashboard? ... also, would it be possible to send us the export?
Thank you.
Daniel
Hi @ddaugherty,
I was able to import the dashboard after edit/save, we should be able to manager the script to handle this now. I think we can close this issue.
Thanks a lot!
Hi,
I'm getting this same issue, was the cause ever figured out, or just a workaround? And is the workaround to edit / save the dashboard that we're updating, or the source dashboard?
Thanks!