Skip to content

cvd: Handle broken symlinks in default custom action config#2700

Merged
rmuthiah merged 1 commit into
google:mainfrom
rmuthiah:fix-symlink
Jun 16, 2026
Merged

cvd: Handle broken symlinks in default custom action config#2700
rmuthiah merged 1 commit into
google:mainfrom
rmuthiah:fix-symlink

Conversation

@rmuthiah

Copy link
Copy Markdown
Collaborator

When launching older Android trees, the host tools might contain a broken symlink for cuttlefish_example_action_config.json (pointing to a non-existent /usr/lib/cuttlefish-common/... path on the host).

Previously, DefaultCustomActionConfig() only checked if the parent directory existed and returned the first .json file found, without verifying if the file itself was accessible. This caused assemble_cvd to abort when trying to read the broken symlink.

This change adds a FileExists() check before returning the detected config path. If the file is not accessible (e.g., a broken symlink), it logs a warning and safely ignores it, falling back to an empty custom action configuration and allowing the launch to proceed.

Test: Local launch of older tree (simulated with broken symlink)
TAG=agy
CONV=9c0d5aa1-08b9-492f-a8dd-54472559c2d3

@rmuthiah rmuthiah requested a review from Databean June 12, 2026 00:00
@rmuthiah rmuthiah force-pushed the fix-symlink branch 2 times, most recently from e50f773 to 409bceb Compare June 15, 2026 18:20
@rmuthiah rmuthiah enabled auto-merge June 15, 2026 18:21
When launching older Android trees, the host tools might contain a
broken symlink for cuttlefish_example_action_config.json (pointing to
a non-existent /usr/lib/cuttlefish-common/... path on the host).

Previously, DefaultCustomActionConfig() only checked if the parent
directory existed and returned the first .json file found, without
verifying if the file itself was accessible. This caused
assemble_cvd to abort when trying to read the broken symlink.

This change adds a FileExists() check before returning the detected
config path. If the file is not accessible (e.g., a broken symlink),
it logs a warning and safely ignores it, falling back to an empty
custom action configuration and allowing the launch to proceed.

Test: Local launch of older tree (simulated with broken symlink)
TAG=agy
CONV=9c0d5aa1-08b9-492f-a8dd-54472559c2d3
@rmuthiah rmuthiah added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Jun 15, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Jun 15, 2026
@rmuthiah rmuthiah added this pull request to the merge queue Jun 15, 2026
Merged via the queue into google:main with commit acabd6f Jun 16, 2026
31 checks passed
@rmuthiah rmuthiah deleted the fix-symlink branch June 17, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants