Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ members = ["crates/*"]
default-members = [".", "crates/*"]

[workspace.package]
version = "4.1.0"
version = "4.1.1"
edition = "2024"
rust-version = "1.89"
license = "LicenseRef-EXA-SL-1.0"
repository = "https://github.com/execution-associates/isb"
homepage = "https://github.com/execution-associates/isb"

[workspace.dependencies]
isb-core = { path = "crates/isb-core", version = "=4.1.0" }
isb-server = { path = "crates/isb-server", version = "=4.1.0" }
isb-apps = { path = "crates/isb-apps", version = "=4.1.0" }
isb-daemon = { path = "crates/isb-daemon", version = "=4.1.0" }
isb-tui = { path = "crates/isb-tui", version = "=4.1.0" }
isb-egress = { path = "crates/isb-egress", version = "=4.1.0" }
isb-core = { path = "crates/isb-core", version = "=4.1.1" }
isb-server = { path = "crates/isb-server", version = "=4.1.1" }
isb-apps = { path = "crates/isb-apps", version = "=4.1.1" }
isb-daemon = { path = "crates/isb-daemon", version = "=4.1.1" }
isb-tui = { path = "crates/isb-tui", version = "=4.1.1" }
isb-egress = { path = "crates/isb-egress", version = "=4.1.1" }

serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
33 changes: 33 additions & 0 deletions crates/isb-core/src/ipam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ pub struct Claim {
pub recorded: Option<String>,
/// Its IPv4 addresses on the bridge's subnet (running instances only).
pub addrs: Vec<Ipv4Addr>,
/// Running, but incus has lost the NIC's host side name
/// (`volatile.<nic>.host_name`): incus cannot change the NIC until the
/// instance restarts, and an org project may not set the name back.
pub veth_lost: bool,
pub running: bool,
/// The NIC as the instance has it (expanded: from a profile or its own).
pub props: Props,
Expand Down Expand Up @@ -168,6 +172,7 @@ fn claim(i: &Value, project: &str, dev: &str, d: &Value, subnet: &Subnet) -> Cla
Vec::new()
},
running,
veth_lost: running && cfg[format!("volatile.{dev}.host_name")].is_null(),
props: d
.as_object()
.map(|m| {
Expand Down Expand Up @@ -309,6 +314,10 @@ pub fn plan(
}
continue;
}
if c.veth_lost {
findings.push(veth_lost(c));
continue;
}
let ip = match (c.running, c.addrs.as_slice()) {
// Its own address, unless another instance holds it too (a
// conflict, reported above): pinning it would keep it.
Expand Down Expand Up @@ -347,6 +356,30 @@ pub fn plan(
(fixes, findings)
}

/// An unpinned instance whose NIC incus cannot change while it runs
/// (2026-11-09, analytics-capture in org exa): what to do about it.
fn veth_lost(c: &Claim) -> Finding {
let (i, d, p) = (&c.instance, &c.device, &c.project);
Finding::about(
c,
format!("veth {p} {i} {d}"),
format!(
"{i}'s {d} cannot be pinned while it runs: incus lost its host side name \
(volatile.{d}.host_name), and an org project may not set it. isb pins it after its \
next restart; until then {} can be given to another instance once its lease lapses. \
To pin it without a restart: incus project set {p} restricted.containers.lowlevel=allow, \
incus config set {i} volatile.{d}.host_name=<the host_name `incus query \
/1.0/instances/{i}/state?project={p}` gives {d}>, incus project unset {p} \
restricted.containers.lowlevel; the next check pins it",
if c.addrs.is_empty() {
"its address".to_string()
} else {
join(&c.addrs)
}
),
)
}

fn join(ips: &[Ipv4Addr]) -> String {
ips.iter()
.map(Ipv4Addr::to_string)
Expand Down
37 changes: 36 additions & 1 deletion crates/isb-core/src/ipam/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ fn inst(name: &str, pin: Option<&str>, addr: Option<&str>, created: &str) -> Val
json!({
"name": name, "project": "isb-exa", "created_at": created,
"status": if addr.is_some() { "Running" } else { "Stopped" },
"config": {"volatile.eth0.hwaddr": "10:66:6a:00:00:01", "user.isb.stack": "analytics",
"config": {"volatile.eth0.hwaddr": "10:66:6a:00:00:01", "volatile.eth0.host_name": "veth1234",
"user.isb.stack": "analytics",
"user.isb.service": "postgres"},
"expanded_devices": {"root": {"type": "disk"}, "eth0": nic},
"state": state,
Expand Down Expand Up @@ -285,3 +286,37 @@ fn the_diff_ignores_and_never_prunes_isbs_pin() {
assert!(!is_pin("eth0", &actual, &Props::new()));
assert!(!is_pin("eth0", &desired, &config));
}

#[test]
fn a_nic_incus_lost_the_host_side_of_is_reported_not_retried() {
// 2026-11-09: analytics-capture had no volatile.eth0.host_name, and
// incus refused to change its NIC ("Unknown or missing host side veth
// device") on every pass.
let mut v = inst("capture", None, Some("10.83.115.175"), "1");
v["config"]
.as_object_mut()
.unwrap()
.remove("volatile.eth0.host_name");
let (fixes, found) = plan_of(std::slice::from_ref(&v));
assert!(fixes.is_empty(), "{fixes:?}");
assert_eq!(found.len(), 1);
assert!(found[0].key.starts_with("veth "), "{}", found[0].key);
assert!(
found[0].message.contains("10.83.115.175"),
"{}",
found[0].message
);
assert!(found[0].message.contains("restricted.containers.lowlevel"));
// Stopped, it has no host side at all, and is pinned as any other.
v["status"] = json!("Stopped");
v["state"] = json!(null);
let (fixes, found) = plan_of(&[v]);
assert!(found.is_empty(), "{found:?}");
assert!(matches!(fixes.as_slice(), [Fix::Pin { .. }]), "{fixes:?}");
// With the name back, it is pinned in place.
let (fixes, _) = plan_of(&[inst("capture", None, Some("10.83.115.175"), "1")]);
assert!(
matches!(fixes.as_slice(), [Fix::Pin { running: true, .. }]),
"{fixes:?}"
);
}
5 changes: 5 additions & 0 deletions docs/concepts/orgs.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ instance has another one, or when it cannot pin one; it moves no instance
itself. An instance with an [egress policy](../guides/egress.md) has a
bridge of its own and is left to DHCP.

incus cannot change a running instance's NIC once it has lost the NIC's
host side name (`volatile.eth0.host_name`), and an org project may not set
that key. isb reports such an instance (`net.failed`) and pins it after its
next restart; the message says how to pin it without one.

A host with a default-deny firewall (ufw) needs `sudo isb host setup` once,
so org bridges get DHCP, DNS and egress while staying apart from each other:
see [Host firewall](../operations/host-setup.md#host-firewall).
Expand Down
1 change: 1 addition & 0 deletions docs/operations/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ More in [isb on macOS](../getting-started/macos.md).
| Published ports pause during a daemon restart | The load balancer and ingress live in the daemon; apps do not. | Expected; they return within seconds. |
| Apps cannot reach each other by name | Service names need an org with its own network: the `default` org on a host whose incus `default` project held workloads first has none. On a fresh org, the host may lack the service-name directory. | Use an org of its own; run `sudo isb host setup`, after which a running `isb serve` turns names on within a minute (`isb org create ORG` again does it without the daemon) ([Setting up a host](host-setup.md#service-names)). |
| `net.failed`: an address is held by two instances | Two instances on the org bridge have one address, so traffic for one reaches the other. isb moves neither. | Pin the one that should move elsewhere (`incus config device set INSTANCE eth0 ipv4.address=FREE`) and restart it ([Addresses](../concepts/orgs.md#addresses)). |
| `net.failed`: an instance `cannot be pinned while it runs` | incus lost the host side name of its NIC (`volatile.eth0.host_name`), so it cannot change the NIC until a restart, and an org project may not set the key. | Restart it, or without a restart: `incus project set isb-ORG restricted.containers.lowlevel=allow`, `incus config set INSTANCE volatile.eth0.host_name=VETH` (the `host_name` that `incus query /1.0/instances/INSTANCE/state?project=isb-ORG` gives eth0), `incus project unset isb-ORG restricted.containers.lowlevel`; the next check pins it ([Addresses](../concepts/orgs.md#addresses)). |
| A new org's instances get no address or no internet | A default-deny firewall drops DHCP, DNS and forwarding on new bridges. | `sudo isb host setup` ([Host firewall](host-setup.md#host-firewall)). |
| A builder image build stops with `got no IPv4 address on incusbr0` | The same firewall drops DHCP and forwarding on incus' own bridge, where those builds run. | `sudo isb host setup`, then build again. |
| `isb serve` or `isb host setup` warns that incus is too old for OCI images | The incus package is older than 6.3 (Ubuntu 24.04's is 6.0), so `docker:` images cannot run. | Install incus from the Zabbly stable repository ([Install isb](../getting-started/install.md#1-incus)). |
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ it; relative paths resolve against that directory.
When it starts, the server writes one hello line:

```json
{"isb": "4.1.0", "protocol": 1}
{"isb": "4.1.1", "protocol": 1}
```

A client checks `protocol` and refuses versions it does not know.
Expand Down Expand Up @@ -205,7 +205,7 @@ All take `files` (default `./isb.yaml` plus `./isb.override.yaml` if present),
## Example session

```text
<- {"isb":"4.1.0","protocol":1}
<- {"isb":"4.1.1","protocol":1}
-> {"id":1,"method":"sandbox.ensure","params":{"spec":{"name":"web","image":"dev-base","cpus":2}}}
<- {"id":1,"event":"progress","data":"web: creating from dev-base"}
<- {"id":1,"event":"progress","data":"web: starting"}
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "isb-sdk"
version = "4.1.0"
version = "4.1.1"
description = "Python SDK for isb: declarative incus sandboxes (containers and VMs)"
readme = "README.md"
license = "MIT AND LicenseRef-EXA-SL-1.0"
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/src/isb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def main():
from ._util import Duration
from .volumes import Volumes

__version__ = "4.1.0"
__version__ = "4.1.1"

__all__ = [
"PROTOCOL",
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ async def test_death_fails_pending_requests(self) -> None:
path = fake_server(
self.tmp.name,
"""\
echo '{"isb":"4.1.0","protocol":1}'
echo '{"isb":"4.1.1","protocol":1}'
read line
echo "boom" >&2
exit 3
Expand All @@ -243,7 +243,7 @@ async def test_close_fails_pending(self) -> None:
path = fake_server(
self.tmp.name,
"""\
echo '{"isb":"4.1.0","protocol":1}'
echo '{"isb":"4.1.1","protocol":1}'
cat >/dev/null
""",
)
Expand All @@ -261,7 +261,7 @@ async def test_events_and_out_of_order_replies(self) -> None:
path = fake_server(
self.tmp.name,
"""\
echo '{"isb":"4.1.0","protocol":1}'
echo '{"isb":"4.1.1","protocol":1}'
read a
read b
echo 'not json'
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/typescript/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/typescript/npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@execution-associates/isb-linux-arm64",
"version": "4.1.0",
"version": "4.1.1",
"description": "The static isb binary for Linux arm64 (aarch64-unknown-linux-musl), used by @execution-associates/isb",
"license": "SEE LICENSE IN LICENSE",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/typescript/npm/linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@execution-associates/isb-linux-x64",
"version": "4.1.0",
"version": "4.1.1",
"description": "The static isb binary for Linux x64 (x86_64-unknown-linux-musl), used by @execution-associates/isb",
"license": "SEE LICENSE IN LICENSE",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions sdk/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@execution-associates/isb",
"version": "4.1.0",
"version": "4.1.1",
"description": "TypeScript SDK for isb: declarative incus sandboxes (containers and VMs)",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -51,8 +51,8 @@
"prepack": "bun run build"
},
"optionalDependencies": {
"@execution-associates/isb-linux-arm64": "4.1.0",
"@execution-associates/isb-linux-x64": "4.1.0"
"@execution-associates/isb-linux-arm64": "4.1.1",
"@execution-associates/isb-linux-x64": "4.1.1"
},
"devDependencies": {
"@biomejs/biome": "^2.2.0",
Expand Down
Loading
Loading