← Back to issue list

Using default compatibility tag can cause DNS name conflicts

View original Github issue

Metadata

Project
craft-providers
Number
#454
Type
issue
State
open
Author
mr-cal
Labels
Type: Bug
Created
Updated
Closed
—

Current evaluation

Missing compatibility tags still produce identical LXD base-instance names across projects, causing DNS conflicts and failed launches; the proposed warning and API redesign remain unimplemented.

Suggested action: keep open

Reason: The issue has a maintainer-filed Type: Bug label, an exact two-project reproducer, and a concrete DNS collision error. Current code still accepts compatibility_tag=None, only overrides BuilddBase's default when a tag is supplied, and derives the LXD base name from that tag, so the failure remains valid; the warning is easy, while the required-tag redesign involves major-release compatibility work.

Evaluated by: mr-cal-bot

Impact: 56 Quick Win: 28 Complexity: 43 Confidence: 96 Actionability: 89

Issue body

### Bug Description The `Base` class can accept an optional [`compatibility_tag`](https://github.com/canonical/craft-providers/blob/03704c107b3d88132a33453302c79da1dc9619c5/craft_providers/base.py#L107). If a `compatibility_tag` is not provided and craft-providers launches LXD instances for 2 different projects, LXD will fail because the two base instances have identical names. Source: https://github.com/canonical/craft-application/issues/139 ### Quick fix craft-providers should log a warning if a compatibility tag is not provided: ``` Warning: Compatibilty tag not provided. This may cause a name collision when launching LXD instances. ``` ### Long term fix As part of a major release, the `compatibility_tag` should be easier to use. It should be required and prepended to the base's compatibility tag. This simply the usage from: ```python from craft_providers import bases base = bases.BuilddBase(compatibility_tag=f"testcraft-{bases.BuildBase.compatibility_tag}", ...) ``` to: ```python from craft_providers import bases base = bases.BuilddBase(compatibility_tag="testcraft", ...) ``` ### To Reproduce ```python #! /usr/bin/env python3 from pathlib import Path import logging from craft_providers import bases, lxd logging.basicConfig(level="DEBUG") provider_a = lxd.LXDProvider(lxd_project="project1") provider_a.ensure_provider_is_available() alias = bases.BuilddBaseAlias.JAMMY my_base = bases.BuilddBase(alias=alias) with provider_a.launched_environment( project_name = "hello-world", project_path = Path().absolute(), base_configuration=my_base, build_base=alias.value, instance_name = "test-instance", ) as instance: instance.execute_run(["ls"]) provider_b = lxd.LXDProvider(lxd_project="project2") provider_b.ensure_provider_is_available() alias = bases.BuilddBaseAlias.JAMMY my_base = bases.BuilddBase(alias=alias) with provider_b.launched_environment( project_name = "hello-world", project_path = Path().absolute(), base_configuration=my_base, build_base=alias.value, instance_name = "test-instance", ) as instance: instance.execute_run(["ls"]) ``` ### part yaml _No response_ ### Relevant log output ```shell * Command standard error output: b'Error: Failed start validation for device "eth0": Instance DNS name "base-instance-buildd-base-v3-craft-comub-523148486bd0c6cc722c" already used on network\nTry `lxc info --show-log local:base-instance-buildd-base-v3-craft-comub-523148486bd0c6cc722c` for more info\n' ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 56
Quick Win: 28
Complexity: 43
Confidence: 96
Actionability: 89
keep open Missing compatibility tags still produce identical LXD base-instance names across projects, causing DNS conflicts and failed launches; the proposed warning and API redesign remain unimplemented.
stealth/space-bunny-alpha
Impact: 55
Quick Win: 28
Complexity: 45
Confidence: 97
Actionability: 92
keep open Missing compatibility tags give different projects identical LXD base instance names, causing DNS conflicts and failed launches. A warning is proposed for now; a required-tag API change is deferred to a major release.
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 35
Staleness: 75
Complexity: 30
Confidence: 60
Support Request: 10
needs triage Bug: missing compatibility_tag causes LXD DNS name conflicts when launching instances for multiple projects. Open for ~3 years with no maintainer comments or assignee.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 20
Confidence: 80
Support Request: 5
close stale Bug report detailing DNS name conflicts in LXD when craft-providers launches instances without a compatibility tag. Includes reproduction steps and proposed warning/long-term fix. Unaddressed for over two years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 20
Confidence: 85
Support Request: 0
keep open Bug where omitting the compatibility_tag in craft-providers causes LXD instance DNS name collisions. Includes reproduction steps and proposed warning/fix. Currently open with no maintainer follow-up.

Update history

No update history recorded yet.

Related work

Related issues

No related issues found above the similarity threshold.