{"record":{"id":"e01d973334cc8cc6","repo":"hashicorp/vagrant","slug":"the-docker-provider-was-unable-to-configure-networ","errorCode":null,"errorMessage":"The Docker provider was unable to configure networking using the\nprovided network name `%{network_name}`. Please ensure the network\nname is correct and exists, then try again.","messagePattern":"The Docker provider was unable to configure networking using the\nprovided network name `%(.+?)`\\. Please ensure the network\nname is correct and exists, then try again\\.","errorType":"exception","errorClass":"VagrantPlugins::DockerProvider::Errors::NetworkNameUndefined","httpStatus":null,"severity":"error","filePath":"plugins/providers/docker/action/prepare_networks.rb","lineNumber":53,"sourceCode":"        end\n\n        # @return [Array<Socket::Ifaddr>] interface list\n        def list_interfaces\n          Socket.getifaddrs.find_all do |i|\n            !i.addr.nil? && i.addr.ip? && !i.addr.ipv4_loopback? &&\n              !i.addr.ipv6_loopback? && !i.addr.ipv6_linklocal?\n          end\n        end\n\n        # Validates that a network name exists. If it does not\n        # exist, an exception is raised.\n        #\n        # @param [String] network_name Name of existing network\n        # @param [Hash] env Local call env\n        # @return [Boolean]\n        def validate_network_name!(network_name, env)\n          if !env[:machine].provider.driver.existing_named_network?(network_name)\n            raise Errors::NetworkNameUndefined,\n              network_name: network_name\n          end\n          true\n        end\n\n        # Validates that the provided options are compatible with a\n        # pre-existing network. Raises exceptions on invalid configurations\n        #\n        # @param [String] network_name Name of the network\n        # @param [Hash] root_options Root networking options\n        # @param [Hash] network_options Docker scoped networking options\n        # @param [Driver] driver Docker driver\n        # @return [Boolean]\n        def validate_network_configuration!(network_name, root_options, network_options, driver)\n          if root_options[:ip] &&\n              driver.network_containing_address(root_options[:ip]) != network_name\n            raise Errors::NetworkAddressInvalid,\n              address: root_options[:ip],","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/docker/action/prepare_networks.rb#L35-L71","documentation":"validate_network_name! - used by process_private_network and process_public_network in the Docker provider's PrepareNetworks action - requires that a network referenced by name already exist in the docker engine (driver.existing_named_network? wraps `docker network ls`). A name the engine does not know raises NetworkNameUndefined.","triggerScenarios":"config.vm.network \"private_network\", name: \"mynet\" (or the same via docker_network/docker_connect scoped overrides) when no docker network named mynet exists in the engine Vagrant talks to.","commonSituations":"Typos in network names; the network deleted out-of-band between ups; DOCKER_HOST or a docker context pointing at a different engine than the one holding the network.","solutions":["List networks with `docker network ls` and fix the name: option to match exactly","Create the network before starting: docker network create --subnet 10.9.8.0/24 mynet","If using a remote daemon/docker context, confirm you are querying the engine that actually owns the network"],"exampleFix":"# before\nconfig.vm.network \"private_network\", name: \"my_net\"  # typo; engine has \"mynet\"\n\n# after\nconfig.vm.network \"private_network\", name: \"mynet\", ip: \"10.9.8.42\"","handlingStrategy":"validation","validationCode":"# ensure the named network exists (or create it) before vagrant up\ndocker network inspect mynet >/dev/null 2>&1 \\\n  || docker network create --subnet 10.9.8.0/24 mynet\nvagrant up","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create named networks as a provisioning step before `vagrant up`","Verify docker context/DOCKER_HOST when sharing Vagrantfiles across machines","Use exact names from `docker network ls`; avoid renaming networks out-of-band"],"tags":["vagrant","docker","network","provider","precondition"],"backgroundTag":"docker-network-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}