Repository navigation
[ZEPPELIN-5157]Fix Shiro initialization failure when install path has spaces - #5541
Draft
world970511 wants to merge 1 commit into
Draft
world970511 wants to merge 1 commit into
world970511 wants to merge 1 commit into
Conversation
…s spaces File#toURI() percent-encodes special characters (e.g. a space becomes %20) before the resulting string is set as the "shiroConfigLocations" init param. Shiro's ResourceUtils only strips the "file:" prefix and passes the remainder directly to FileInputStream without decoding any URI escaping, so an encoded path never resolves to the real file and startup fails with a ConfigurationException/FileNotFoundException. Build the init param from the raw filesystem path instead of going through toURI(), so no encoding is introduced in the first place.
world970511
marked this pull request as draft
October 5, 2026 12:08
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR for?
When Zeppelin initializes Shiro authentication,
shiroIniPathalready contains the actual filesystem path toshiro.ini.Previously, the path was converted using
new File(...).toURI(). This URI conversion percent-encodes special characters in the filesystem path. For example, a path containing a space such as:/opt/my zeppelin/conf/shiro.iniis converted to:
/opt/my%20zeppelin/conf/shiro.iniAs a result, Shiro may fail to locate the actual configuration file when the Zeppelin installation path contains spaces or other characters that are encoded during URI conversion.
This PR removes the unnecessary
toURI()conversion and constructs the Shiro configuration location by prefixing the original filesystem path withfile:.This preserves the filesystem path as-is and prevents unintended percent encoding.
What type of PR is it?
Bug Fix
Todos
file:locationWhat is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-5157
How should this be tested?
The issue can be reproduced by running Zeppelin from a directory whose path contains spaces.
For example:
/opt/my zeppelin/shiro.iniunder the Zeppelin configuration directory.Before this change, the filesystem path could be converted to a percent-encoded URI path such as
%20, causing Shiro to fail to locate the configuration file.After this change, the original filesystem path is passed to Shiro without URI percent encoding.
Screenshots (if appropriate)
N/A
Questions: