metabase / metabase

The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum:
https://metabase.com
Other
38.04k stars 5.05k forks source link

/admin/databases/:id with unknown ID shows 500 Internal Server Error #46886

Open devurandom opened 4 weeks ago

devurandom commented 4 weeks ago

Describe the bug

I open /admin/databases/:id on a Metabase instance, where :id is any integer that does not correspond to an existing database, and see raw HTML for a 500 Internal Server Error.

To Reproduce

  1. Go to /admin/databases and check what database IDs exist (on a pristine system only ID 1 would exist)
  2. Go to /admin/databases/100 (assuming ID 100 does not correspond to an existing database; any other non-existent ID also works)
  3. See the literal text <html> <head><title>500 Internal Server Error</title></head> <body> <center><h1>500 Internal Server Error</h1></center> <hr><center>nginx</center> </body> </html> (see screenshot below)
  4. In browser dev tools, see that this is the raw response from a GET /api/database/100 HTTP request

Expected behavior

I would expect to get a 404 Not Found page instead, similar to what I get when I go to /admin/gobbledegook.

Logs

No response

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0",
    "vendor": ""
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.24+8",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.24",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.24+8",
    "os.name": "Linux",
    "os.version": "5.10.220-209.869.amzn2.x86_64",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "postgres",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "14.10"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.7.3"
      }
    },
    "run-mode": "prod",
    "plan-alias": "starter",
    "version": {
      "date": "2024-08-14",
      "tag": "v1.50.20.3",
      "hash": "3fb0cf2"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity

Annoying

Additional context

screenshot

crisptrutski commented 4 weeks ago

Interestingly I'm seeing something slightly different on master (stats), but it's still not ideal - text returned for a JSON request.

Screenshot 2024-08-15 at 17 22 09
crisptrutski commented 4 weeks ago

It's also slightly different running master on my dev machine 🤷

Screenshot 2024-08-15 at 17 26 37