Metabase fails to upgrade when installed in a Windows path containing spaces

We identified an issue when trying to upgrade and run Metabase on Windows. The application is installed under “Program Files“, and the process does not correctly execute Java when the installation path contains a space. We would appreciate it if path handling could be reviewed and corrected in the next version.

Program Files also has special permissions, so that has to be taken into account as well.

please send us the reproduction steps, we don’t test in Windows at all so it would be nice if we could see the entire step by step scenario here

what command line are you using to launch Metabase?

the
java -jar %path to metabase%\metabase.jar bit

As a service?

Chances are you’re not quoting something correctly.

Other possibility is that the account it’s using doesn’t have rights to create subfolders in program files.

I run Metabase on multiple Windows servers, but oddly always running the jar from a folder off root so not hit any problems.

1 Like

Hi there, I work alongside @cmonge . Here’s some additional information that may help.

{ "metabase-info": {    "databases": [      "sqlserver"    ],    "run-mode": "prod",    "plan-alias": "",    "version": {      "date": "2026-03-04",      "tag": "v0.58.8.4",      "hash": "cf6856f"    },    "settings": {      "report-timezone": "America/Chicago"    },    "hosting-env": "unknown",    "application-database": "mysql",    "application-database-details": {      "database": {        "name": "MySQL",        "version": "8.0.30"      },      "jdbc-driver": {        "name": "MariaDB Connector/J",        "version": "2.7.10"      }    }  },  "system-info": {    "file.encoding": "UTF-8",    "java.runtime.name": "OpenJDK Runtime Environment",    "java.runtime.version": "21.0.7+6-LTS",    "java.vendor": "Eclipse Adoptium",    "java.vendor.url": "https://adoptium.net/",    "java.version": "21.0.7",    "java.vm.name": "OpenJDK 64-Bit Server VM",    "java.vm.version": "21.0.7+6-LTS",    "os.name": "Windows Server 2022",    "os.version": "10.0",    "user.language": "en",    "user.timezone": "America/Chicago"  }

We were upgrading to the latest Metabase version. This same installation has previously been upgraded successfully across multiple earlier versions, so the migration process has worked before. We also ran the new JAR first (with the proper credentials) so it could create any required folders before replacing the existing version.

We run Metabase as a Windows service using WinSW. The service launches the following batch file:

@echo off"C:\Program Files\Eclipse Adoptium\jdk-21.0.7.6-hotspot\bin\java.exe" -DMB_DB_TYPE=mysql -DMB_DB_DBNAME=metabase -DMB_JETTY_PORT=3000 -DMB_DB_USER=user -DMB_DB_PASS=password -DMB_DB_HOST=localhost -jar "C:\Program Files\Metabase\metabase.jar"

Reproduction steps

  1. Install Metabase under C:\Program Files\Metabase\.

  2. Configure it to use MySQL as the application database.

  3. Launch it successfully using the command above.

  4. Replace the JAR with the newer version and start Metabase.

  5. The migration fails with the following error:

    Let us know if there’s any additional information or logs that would help.

It would help to have the entire exception traceback. It looks like the jar file path needs to be URL-encoded.

Hi, i have the same problem,

After upgrading to Metabase 0.63.13 on Windows Server 2019 with Java 21, Metabase no longer starts.

It is installed in:

C:\Program Files\Metabase

The startup fails with:

Metabase Initialization FAILED: Illegal character in opaque part at index 20: jar:file:/C:/Program Files/Metabase/metabase.jar!/

It seems the space in Program Files is not correctly escaped in the JAR URI.

Is this a known issue? Is there a workaround to keep Metabase installed under C:\Program Files\Metabase, or is moving it to a path without spaces currently required?

Thanks!

After upgrading to Metabase 0.63.13 on Windows Server 2019 with Java 21, Metabase no longer starts.

It is installed in:

C:\Program Files\Metabase

The startup fails with:

Metabase Initialization FAILED: Illegal character in opaque part at index 20: jar:file:/C:/Program Files/Metabase/metabase.jar!/

It seems the space in Program Files is not correctly escaped in the JAR URI.

Is this a known issue? Is there a workaround to keep Metabase installed under C:\Program Files\Metabase, or is moving it to a path without spaces currently required?

Thanks!

I don't see a bug on GitHub for this so please file one.

Placing the Metabase jar and/or start path in Program Files means it cannot write the plugins/ directory on startup unless you run the JVM with elevated privileges (which is a horrible, no good, very bad idea). This can cause problems on upgrades, especially to 63 where the Sample Database file is changing. It might be silently failing to write and running the file out of the jar directly which is a significant performance reduction.

Program Files was meant to be written to only by trusted installer applications or .msi’s. Users are not intended to put stuff there themselves. This provides protection against malware modifying installed applications.

I recommend creating a separate directory for Metabase (like C:\metabase), setting the permissions appropriately, and using that, or a subdirectory thereof, as the starting working directory.

2 Likes

As you suggested, I will probably create a C:\Metabase folder.

I just wanted to mention that I am experiencing exactly the same issue described in the post. Before this version, I had never had any problems upgrading Metabase, despite having performed around 30 upgrades of previous versions.

I’m mainly mentioning this as a possible area for improvement, so that other users don’t have to spend time troubleshooting and trying to identify the cause of the issue. :slight_smile: