Metabase URL not updated dynamically

I have installed metabase server in AWS EC2 instance on Ubuntu OS.
I want to share the question to another server. (In my usecase ERPNext). I have configured everthing in ERPNext. But I am unable to display the chart in ERPNext. It is display the 400 Not Found Error. Becuase the METABASE_SITE_URL is mapped to older IP address of the EC2 instance.

Help to solve this problem.

Hi @rackymuthu
If you define the environment variable MB_SITE_URL, then you have to update that manually.
If you have not defined that environment variable, then you can change it in Admin > Settings > General.

Thanks for reply.
I have changed the URL in settings.

But the chart is still not shown in ERPNext. It show the 400 Not found Error.

@rackymuthu Well, that error must be coming from something else.

Error 400 is "Bad Request": https://httpstatuses.com/400

Post the full error, check the log for more details - Admin > Troubleshooting > Logs.

@flamber, I have post the error log here.

@rackymuthu

  1. Post "Diagnostic Info" from Admin > Troubleshooting.
  2. Post the full GET /api/embed/dashboard/... error - not a screenshot.
  3. Post the embed code you are using (without the secret token).

1.Diagnostic Info

{
"browser-info": {
"language": "en-US",
"platform": "Linux x86_64",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9-Ubuntu-0ubuntu2.20.04",
"java.vendor": "Ubuntu",
"java.vendor.url": "https://ubuntu.com/",
"java.version": "11.0.11",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9-Ubuntu-0ubuntu2.20.04",
"os.name": "Linux",
"os.version": "5.11.0-1017-aws",
"user.language": "en",
"user.timezone": "Etc/UTC"
},
"metabase-info": {
"databases": [
"h2",
"mysql"
],
"hosting-env": "unknown",
"application-database": "h2",
"run-mode": "prod",
"version": {
"date": "2020-01-13",
"tag": "v0.34.1",
"branch": "release-0.34.x",
"hash": "265695c"
},
"settings": {
"report-timezone": null
}
}
}

2.GET Url

http://ec2-13-235-8-20.ap-south-1.compute.amazonaws.com:3000/api/embed/dashboard/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZSI6eyJkYXNoYm9hcmQiOjEwNH0sInBhcmFtcyI6e30sImV4cCI6MTYzMjExNjA1MH0.cmq7O3a2sdXo9fOqpnmavHLlIym1_Sa7C2R6Q72ISaI

and please tell me where I can find out the embed code?

@rackymuthu

  1. I would highly recommend that you upgrade. You are using a version that is almost 2 years old.
    https://github.com/metabase/metabase/releases/latest
    And you should migrate away from H2 if you are using Metabase in production:
    https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
  2. Does dashboard ID 104 exist?
  3. The embed code is how you implement it. I don't know where you have that code.
    https://www.metabase.com/docs/latest/administration-guide/13-embedding.html

@flamber

I have installed the latest version of Metabase.
But, Still not able to see the chart in ERPNext.

Here I have attached the URL For /api/embed/dashboard.

[dcf5a8e9-1219-413f-8153-9bb3fe72f0c0] 2021-09-22T11:12:46+05:30 DEBUG metabase.server.middleware.log GET /api/embed/dashboard/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZSI6eyJkYXNoYm9hcmQiOjF9LCJwYXJhbXMiOnt9LCJleHAiOjE2MzIyOTA1NjR9.3M1d_XC_wef-ihXav3Ch0uDIrW8FeuZiU1_PdNfCKvs 400 8.8 ms (1 DB calls)
"Not found."

@rackymuthu Does dashboard ID 1 exists and have embedding enabled? Seems like the problem is with whatever you are using to embed Metabase into ERPNext.

@flamber
The issue solved.

The problem is, i am not create a dashboard. instead of this, I just try to share a chart without add it in dashboard. So, once I add the chart in dashboard, It wokrs properly and the dashboard is visible in ERPNext.

Thanks for your support.