Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: infinite loop when malformed symbolic link exists in VFolder #1665

Merged
merged 6 commits into from
Oct 30, 2023

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Oct 27, 2023

When opening the file browser in WebUI and the there is a symbolic link pointing to itself,
below error occurs and file browser doesn't appear.

2023-10-27 07:19:30.941 INFO ai.backend.manager.api.vfolder [570498] VFOLDER.LIST_FILES (email:[email protected], ak:AKIAIOSFODNN7EXAMPLE, vf:test, path:.)
2023-10-27 07:19:30.973 DEBUG ai.backend.manager.plugin.error_monitor [570498] collected an error log [ERROR] "ai.backend.manager.api.exceptions.InvalidAPIParameters: Missing or invalid API parameters. (Too many levels of symbolic links)
-> extra_data: {'errno': 40, 'paths': ['upstage']}" from manager

This PR resolves this error by leaving symlink_dst empty when an ELOOP error occurs.

🤖 Generated by Copilot at 77b4fec

This pull request fixes a bug that caused symbolic link loops in virtual folders to crash the _scandir function. It changes the logic of src/ai/backend/storage/vfs/__init__.py to avoid following symlinks when scanning directories and to handle the RuntimeError exception gracefully.

@github-actions github-actions bot added the comp:storage-proxy Related to Storage proxy component label Oct 27, 2023
@github-actions github-actions bot added the size:S 10~30 LoC label Oct 27, 2023
@jopemachine jopemachine marked this pull request as ready for review October 27, 2023 08:44
@jopemachine jopemachine added type:bug Reports about that are not working effort:easy Need to understand only a specific region of codes (good first issue, easy). labels Oct 27, 2023
@jopemachine jopemachine changed the title fix: symbolic link loop error of vfolder fix: Symbolic link loop error of vfolder Oct 28, 2023
@kyujin-cho kyujin-cho added this to the 23.09 milestone Oct 30, 2023
@kyujin-cho kyujin-cho changed the title fix: Symbolic link loop error of vfolder fix: infinite loop when malformed symbolic link exists in VFolder Oct 30, 2023
@kyujin-cho kyujin-cho enabled auto-merge October 30, 2023 06:21
@kyujin-cho kyujin-cho added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit febcc91 Oct 30, 2023
18 checks passed
@kyujin-cho kyujin-cho deleted the fix/symbolic-eloop branch October 30, 2023 06:26
kyujin-cho added a commit that referenced this pull request Nov 1, 2023
)

Co-authored-by: Kyujin Cho <[email protected]>
Backported-from: main
Backported-to: 23.09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:storage-proxy Related to Storage proxy component effort:easy Need to understand only a specific region of codes (good first issue, easy). size:S 10~30 LoC type:bug Reports about that are not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants