siyuan-note/siyuan · error
attribute view [ ] is not bound
Error message
attribute view [%s] is not bound
What it means
When reordering bound attribute views (e.g. detaching or moving a view within a block's bound-views list), the kernel searches the current binding list for the given avID. If the attribute view is not actually bound to that block, it cannot be unbound/reordered and this error is returned.
Solutions
- Re-fetch the block's bound attribute views and confirm the avID is in the list before unbinding/moving
- Use the correct avID for the target block
- Make the unbind operation idempotent: skip the call when the view is already absent
- Refresh UI state after any unbind so stale IDs are not reused
Example fix
// before
await fetchPost("/api/av/removeAttributeView", {avID: staleAvID, blockID})
// after
const bound = await getBoundAvIDs(blockID);
if (bound.includes(avID)) await fetchPost("/api/av/removeAttributeView", {avID, blockID}); Defensive patterns
Strategy: validation
Validate before calling
const bound = await getBoundAvIDs(blockID);
if (!bound.includes(avID)) throw new Error(`attribute view ${avID} is not bound to ${blockID}`); Try / catch
try { await unbindAttributeView({avID, blockID}); } catch (e) { if (String(e).includes("is not bound")) { /* treat as already unbound; refresh state */ } else { throw e; } } Prevention
- Refresh bound-view lists after every unbind/delete operation
- Make unbind calls idempotent by pre-checking the binding list
- Avoid caching avIDs across sessions
When it happens
Trigger: Calling the unbind/move attribute view API with operation.AvID that is not present in the block's bound attribute view ID list; operating on a stale avID after the view was already unbound or the block deleted.
Common situations: Plugin holding an outdated list of bound views; double-invocation of an unbind action; copying an avID from a different block; view deleted in another client between fetch and call.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- previous attribute view
- attribute view not found
- attribute view [ ] not found in box [ ]
- attribute view [ ] view [ ] not found
- attribute view [ ] visible view [ ] not found
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/7cf78ebcaaa6507e.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/attribute_view.go:8597
}
return
}
func sortAttrViewBindingIDs(avIDs []string, avID, previousAvID string) (ret []string, err error) {
ret = append([]string(nil), avIDs...)
if avID == previousAvID {
return
}
index := -1
for i, id := range ret {
if id == avID {
index = i
break
}
}
if 0 > index {
return nil, fmt.Errorf("attribute view [%s] is not bound", avID)
}
ret = append(ret[:index], ret[index+1:]...)
previousIndex := -1
if "" != previousAvID {
for i, id := range ret {
if id == previousAvID {
previousIndex = i
break
}
}
if 0 > previousIndex {
return nil, fmt.Errorf("previous attribute view [%s] is not bound", previousAvID)
}
}
ret = util.InsertElem(ret, previousIndex+1, avID)
returnView on GitHub (pinned to 9f775e8a12)