hashicorp/vagrant · error · Vagrant::Errors::UploadSourceMissing
The source path provided for upload cannot be found. Please
Error message
The source path provided for upload cannot be found. Please validate
the source location for upload an try again.
Source Path: %{source} What it means
`vagrant upload` requires the source path to exist on the HOST. After stripping one possibly-escaped trailing quote, the command tests File.file? then File.directory?; when both fail it raises UploadSourceMissing with the exact path it tried. The failure happens before any guest communication, so it is purely a host-filesystem problem.
Source
Thrown at plugins/commands/upload/command.rb:68
else
destination = argv[1]
end
else
raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp
end
# NOTE: We do this to handle paths on Windows like: "..\space dir\"
# because the final separator acts to escape the quote and ends up
# in the source value.
source = source.sub(/["']$/, "")
destination ||= File.basename(source)
if File.file?(source)
type = :file
elsif File.directory?(source)
type = :directory
else
raise Vagrant::Errors::UploadSourceMissing,
source: source
end
with_target_vms(guest, single_target: true) do |machine|
if options[:temporary]
if !machine.guest.capability?(:create_tmp_path)
raise Vagrant::Errors::UploadMissingTempCapability
end
extension = File.extname(source) if type == :file
destination = machine.guest.capability(:create_tmp_path, type: type, extension: extension)
end
if options[:compress]
compression_setup!(machine, options)
@env.ui.info(I18n.t("vagrant.commands.upload.compress",
source: source,
type: options[:compression_type]
))View on GitHub (pinned to 35f3160f4a)
Solutions
- Read the printed 'Source Path:' — it is the literal string Vagrant tested; fix typos, casing, or quoting
- Use an absolute path, or run vagrant from the directory containing the source
- On Windows, quote the path and drop any trailing backslash before the closing quote
Example fix
# before vagrant upload ./bulid/app.zip /tmp/app.zip # typo 'bulid' # after vagrant upload ./build/app.zip /tmp/app.zip
Defensive patterns
Strategy: validation
Validate before calling
abort "source not found on host: #{src}" unless File.exist?(src)
system('vagrant', 'upload', src, dst) Type guard
def uploadable_source?(path) File.file?(path) || File.directory?(path) end
Try / catch
begin
command.execute
rescue Vagrant::Errors::UploadSourceMissing => e
warn "missing source: #{e.extra_data[:source]}"
exit 1
end Prevention
- Check File.exist? on the host before invoking upload
- Use absolute source paths in CI to avoid cwd-dependent failures
- Ensure the artifact-producing step runs before the upload step
When it happens
Trigger: A nonexistent or typo'd source path; a relative path evaluated from a different working directory; a glob or tilde the shell did not expand; on Windows, a mangled quoted path the one-character strip cannot fully repair.
Common situations: Uploading `./build/artifact.zip` before the build step produced it; CI launched from another cwd; unquoted paths containing spaces; case mismatches on case-sensitive filesystems.
Related errors
- This command was not invoked properly. The help for this com
- The file you are attempting to upload does not exist. Please
- This command was not invoked properly. The help for this com
- The compression type requested for upload (`%{type}`) is not
- You requested to remove the box '%{name}' version '%{version
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/00ed5113ee6c0132.
Report an issue: GitHub.