Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing copy_dashboard for Metabase hosted in Heroku #38

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CesarVigario
Copy link

When the dashboard contains too many cards/questions, the function copy_dashboard fails.

What happens is: the variable "res" does not return a json and therefore the variable "dup_dashboard_id" raises a TypeError.
Despite of "res" returns false, the dashboard was indeed created in Metabase.

Therefore, if we could obtain the "dup_dashboard_id", we could move on inside the function and do a deep_copy.

The solution I found was to get all dashboards and pick the last one we created and select the id.

This error happens when res returns false, with a 503 error, when using an Heroku instance. 
It will depend on the number and size of Heroku dynos. In my case this issue happened if the Dashboard contained more than 24 cards/questions.
However the dashboard was created. We just need to pick the new dashboard id.
copy_dashboard function variable dup_dashboard_id
@vvaezian
Copy link
Owner

vvaezian commented Nov 3, 2022

Hi @CesarVigario, thanks for the contribution. I'll review it soon.

@vvaezian
Copy link
Owner

vvaezian commented Nov 5, 2022

I believe the root cause of the issue needs to be explored further. Maybe there is a simpler and more general solution to the issue.
You mentioned

When the dashboard contains too many cards/questions, the function copy_dashboard fails.

Have you found a threshold that if the number of cards is more than that threshold then the dashboard copy task fails? I need to reproduce the issue first.

@cesar-vigario-knok
Copy link

Hello @vvaezian , I agree that a simpler solution can be found.

Regarding the threshold, in my case, it is 24 cards. However, I'm using a hosted Metabase in Heroku, and therefore this threshold may change, depending on the number of dynos.

Remembering that, despite of the empty response when doing a post, the dashboard was in fact created. That's why I could pick the dashboard id and do a deep copy. I think this issue is caused by the Metabase API itself, not by your code.

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 8, 2022
@github-actions
Copy link

This PR was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this Dec 23, 2022
@vvaezian vvaezian reopened this Dec 23, 2022
@vvaezian
Copy link
Owner

Keeping this open.
The proposed solution is too ad-hoc.
Need a more general approach.

@vvaezian vvaezian self-assigned this Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants