{"record":{"id":"00ed5113ee6c0132","repo":"hashicorp/vagrant","slug":"the-source-path-provided-for-upload-cannot-be-foun","errorCode":null,"errorMessage":"The source path provided for upload cannot be found. Please validate\nthe source location for upload an try again.\n\n  Source Path: %{source}","messagePattern":"The source path provided for upload cannot be found\\. Please validate\nthe source location for upload an try again\\.\n\n  Source Path: %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::UploadSourceMissing","httpStatus":null,"severity":"error","filePath":"plugins/commands/upload/command.rb","lineNumber":68,"sourceCode":"          else\n            destination = argv[1]\n          end\n        else\n          raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp\n        end\n\n        # NOTE: We do this to handle paths on Windows like: \"..\\space dir\\\"\n        # because the final separator acts to escape the quote and ends up\n        # in the source value.\n        source = source.sub(/[\"']$/, \"\")\n        destination ||= File.basename(source)\n\n        if File.file?(source)\n          type = :file\n        elsif File.directory?(source)\n          type = :directory\n        else\n          raise Vagrant::Errors::UploadSourceMissing,\n            source: source\n        end\n\n        with_target_vms(guest, single_target: true) do |machine|\n          if options[:temporary]\n            if !machine.guest.capability?(:create_tmp_path)\n              raise Vagrant::Errors::UploadMissingTempCapability\n            end\n            extension = File.extname(source) if type == :file\n            destination = machine.guest.capability(:create_tmp_path, type: type, extension: extension)\n          end\n\n          if options[:compress]\n            compression_setup!(machine, options)\n            @env.ui.info(I18n.t(\"vagrant.commands.upload.compress\",\n              source: source,\n              type: options[:compression_type]\n            ))","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/upload/command.rb#L50-L86","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nvagrant upload ./bulid/app.zip /tmp/app.zip   # typo 'bulid'\n\n# after\nvagrant upload ./build/app.zip /tmp/app.zip","handlingStrategy":"validation","validationCode":"abort \"source not found on host: #{src}\" unless File.exist?(src)\nsystem('vagrant', 'upload', src, dst)","typeGuard":"def uploadable_source?(path)\n  File.file?(path) || File.directory?(path)\nend","tryCatchPattern":"begin\n  command.execute\nrescue Vagrant::Errors::UploadSourceMissing => e\n  warn \"missing source: #{e.extra_data[:source]}\"\n  exit 1\nend","preventionTips":["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"],"tags":["vagrant","upload","file-not-found","paths","cli"],"backgroundTag":"source-path-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}