fix: installer permission error on macOS #4091
Closed
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.
Summary
Fixes issue #4005 where the one-line installer was failing on macOS with a PermissionError when attempting to create a directory named "None".
Root Cause
The error occurred because when
external_providers_dirwasNone, the code was converting it to the string "None" viastr(None), then attempting to create a directory with that name, resulting in:Changes
1. Fix external_providers_dir None handling
File:
src/llama_stack/cli/stack/run.pyis not Nonecheckstr()conversion to avoid converting None to the string "None"2. Improve type conversion documentation
File:
src/llama_stack/core/stack.pystr(None)creating the literal string "None"Testing Performed
Unit Tests
tests/unit/cli/test_stack_config.pypasstest_parse_and_maybe_upgrade_config_sets_external_providers_dirtest_parse_and_maybe_upgrade_config_preserves_custom_external_providers_dirPre-commit Hooks
Manual Testing
Logic Verification
str(None)produces the literal string "None"is not Nonecheck prevents the bugImpact
This fix resolves the installer failure on macOS by preventing the PermissionError when
external_providers_diris not set.Closes #4005