Skip to content

Conversation

@cased
Copy link

@cased cased bot commented Nov 9, 2025

Problem

Fixes Sentry issue #7010783498: Docker network creation fails with 'invalid name: name is empty' when CARDINAL_NAMESPACE is not set in the config.

Root Cause:

  • In client.go:122, the Start() method reads cfg.DockerEnv["CARDINAL_NAMESPACE"] and passes it directly to createNetworkIfNotExists()
  • When CARDINAL_NAMESPACE is empty/unset, this results in an empty string being passed to Docker's NetworkCreate API
  • The fallback logic in build.go and service.go doesn't help because it runs AFTER the network creation attempt in different code paths

Solution

Added a check in client.go Start() and Purge() methods to set a default namespace ("defaultnamespace") if empty, matching the behavior in:

  • commands/cardinal/build.go:73-75
  • common/docker/service/service.go:68-72

This ensures consistency across all Docker operations and prevents the empty network name error.

Testing

  1. Create a config without CARDINAL_NAMESPACE set
  2. Run world cardinal start command
  3. Verify network is created with default namespace
  4. Verify no "invalid name: name is empty" error occurs

Related to parent session: https://app.cased.com/agents/35FhUgNSJoBCbdFF67ejXwUMVIW


Generated by Cased Agent

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 9, 2025

How to use the Graphite Merge Queue

Add the label graphite/merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@cased cased bot changed the title Fix Docker network creation failure when CARDINAL_NAMESPACE is empty fix: Docker network creation failure when CARDINAL_NAMESPACE is empty Nov 9, 2025
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.

1 participant