Tool Affected
openclaw
What Happened
Running apc sync --all --yes when ~/.openclaw/skills/test-skill exists as a symlink (from a previous apc install) crashes with:
✗ Failed to apply to openclaw: [Errno 17] File exists: '/Users/frank/.openclaw/skills/test-skill'
The entire openclaw sync fails — no skills written, no memory synced.
Steps to Reproduce
- Run
apc install <some-repo> --skill test-skill --target openclaw
→ Creates ~/.openclaw/skills/test-skill as a symlink to ~/.apc/skills/test-skill
- Run
apc sync --all --yes
→ Crashes with [Errno 17] File exists
Root Cause
In src/appliers/openclaw.py, apply_skills() does:
skill_dir = _openclaw_skills_dir() / name
skill_dir.mkdir(parents=True, exist_ok=True) # <-- fails if path is a symlink
Path.mkdir(exist_ok=True) raises FileExistsError (errno 17) when the path is an existing symlink pointing to a directory — it does not treat symlinks as directories. The symlink was created by link_skills() in base.py, and apply_skills() has no code to handle this case.
What Was Expected
apply_skills() should detect if the target path is a symlink and either:
- Skip it (if the linked content is current), or
- Remove the symlink and write the skill directory directly
Suggested Fix
skill_dir = _openclaw_skills_dir() / name
if skill_dir.is_symlink():
skill_dir.unlink() # remove symlink before mkdir
skill_dir.mkdir(parents=True, exist_ok=True)
Additional Context
After this crash, apc status still shows ● synced for openclaw — the manifest was not updated to reflect the failure.
Tool Affected
openclaw
What Happened
Running
apc sync --all --yeswhen~/.openclaw/skills/test-skillexists as a symlink (from a previousapc install) crashes with:The entire openclaw sync fails — no skills written, no memory synced.
Steps to Reproduce
apc install <some-repo> --skill test-skill --target openclaw→ Creates
~/.openclaw/skills/test-skillas a symlink to~/.apc/skills/test-skillapc sync --all --yes→ Crashes with
[Errno 17] File existsRoot Cause
In
src/appliers/openclaw.py,apply_skills()does:Path.mkdir(exist_ok=True)raisesFileExistsError(errno 17) when the path is an existing symlink pointing to a directory — it does not treat symlinks as directories. The symlink was created bylink_skills()inbase.py, andapply_skills()has no code to handle this case.What Was Expected
apply_skills()should detect if the target path is a symlink and either:Suggested Fix
Additional Context
After this crash,
apc statusstill shows● syncedfor openclaw — the manifest was not updated to reflect the failure.