hashicorp/vagrant · error

Host path `%{host}` exists as a `volumes` key and is a folde

Error message

Host path `%{host}` exists as a `volumes` key and is a folder on disk. Vagrant
will not expand this key like it used to and instead leave it as is defined.
If this folder is intended to be used, make sure its full path is defined
in your `volumes` config. More information can be found on volumes in the
docker compose documentation.

What it means

Error "Host path `%{host}` exists as a `volumes` key and is a folder on disk. Vagrant will not expand this key like it used to and instead leave it as is defined. If this folder is intended to be used, make sure its full path is defined in your `volumes` config. More information can be found on volumes in the docker compose documentation." thrown in hashicorp/vagrant.

Source

Thrown at plugins/providers/docker/driver/compose.rb:120

          end
          ports   = Array(params[:ports])
          volumes = Array(params[:volumes]).map do |v|
            v = v.to_s
            host, guest = v.split(":", 2)
            if v.include?(":") && (Vagrant::Util::Platform.windows? || Vagrant::Util::Platform.wsl?)
              host = Vagrant::Util::Platform.windows_path(host)
              # NOTE: Docker does not support UNC style paths (which also
              # means that there's no long path support). Hopefully this
              # will be fixed someday and the gsub below can be removed.
              host.gsub!(/^[^A-Za-z]+/, "")
            end
            # if host path is a volume key, don't expand it.
            # if both exist (a path and a key) show warning and move on
            # otherwise assume it's a realative path and expand the host path
            compose_config = get_composition
            if compose_config["volumes"] && compose_config["volumes"].keys.include?(host)
              if File.directory?(@machine.env.cwd.join(host).to_s)
                @machine.env.ui.warn(I18n.t("docker_provider.volume_path_not_expanded",
                                           host: host))
              end
            else
              @logger.debug("Path expanding #{host} to current Vagrant working dir instead of docker-compose config file directory")
              host = @machine.env.cwd.join(host).to_s
            end
            "#{host}:#{guest}"
          end
          cmd     = Array(params.fetch(:cmd))
          env     = Hash[*params.fetch(:env).flatten.map(&:to_s)]
          expose  = Array(params[:expose])
          @logger.debug("Creating container `#{name}`")
          begin
            update_args = [:apply]
            update_args.push(:detach) if params[:detach]
            update_args << block
            update_composition(*update_args) do |composition|
              services = composition["services"] ||= {}

View on GitHub (pinned to 35f3160f4a)

When it happens

Trigger: Thrown at plugins/providers/docker/driver/compose.rb:120 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/fb54d54b714e2afa. Report an issue: GitHub.