hashicorp/vagrant · info

No results found for `%{query}`

Error message

No results found for `%{query}`

What it means

Printed by `vagrant cloud search` when the query sent to the Vagrant Cloud API returns an empty box collection (result.boxes.empty?). It is the normal empty-outcome path: the command warns, returns exit code 0, and only a raised VagrantCloud::Error (auth, network, or API failure) produces the error output and exit code 1.

Source

Thrown at plugins/commands/cloud/search.rb:88

        #
        # @param [String] query Search query string
        # @param [Hash] options
        # @option options [String] :provider Filter by provider
        # @option options [String] :sort Field to sort results
        # @option options [Integer] :limit Number of results to display
        # @option options [Integer] :page Page of results to display
        # @param [String] access_token User access token
        # @return [Integer]
        def search(query, access_token, options={})
          account = VagrantCloud::Account.new(
            custom_server: api_server_url,
            access_token: access_token
          )
          params = {query: query}.merge(options.slice(:architecture, :provider, :sort, :order, :limit, :page))
          result = account.searcher.search(**params)

          if result.boxes.empty?
            @env.ui.warn(I18n.t("cloud_command.search.no_results", query: query))
            return 0
          end

          format_search_results(result.boxes, options[:short], options[:json], @env)
          0
        rescue VagrantCloud::Error => e
          @env.ui.error(I18n.t("cloud_command.errors.search.fail"))
          @env.ui.error(e.message)
          1
        end
      end
    end
  end
end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Fix the spelling and search the organization prefix first (e.g. `vagrant cloud search ubuntu/`)
  2. Drop narrowing filters (--provider, --architecture) or raise --limit to widen the match
  3. Retry with --page 1, since pages beyond the end return zero boxes
  4. Confirm the box exists with `vagrant cloud box info org/name` or the Vagrant Cloud web UI
  5. If you instead get error output and exit code 1, verify credentials with `vagrant cloud auth whoami`

Example fix

# before
vagrant cloud search -q ubnutu --provider virtualbox
# after
vagrant cloud search -q ubuntu --provider virtualbox
Defensive patterns

Strategy: fallback

Validate before calling

# Preflight for a known box name before searching broadly
vagrant cloud box info org/name >/dev/null 2>&1 || echo "no such box on Vagrant Cloud"

Try / catch

# Library users: the empty result is not an exception; only API failures raise
begin
  result = account.searcher.search(query: q)
  next if result.boxes.empty? # normal outcome
rescue VagrantCloud::Error => e
  warn e.message
end

Prevention

When it happens

Trigger: Running `vagrant cloud search -q <term>` (or with --provider/--architecture/--sort/--order/--limit/--page filters) where VagrantCloud::Account#searcher.search returns zero boxes: a misspelled term, a filter combination no box matches (e.g. an x86-only box searched with --architecture arm64), or a --page value past the last result page.

Common situations: Typos in box or organization names; narrowing filters that exclude everything; paginating beyond the end of results; searching for a box that was recently deleted or made private on Vagrant Cloud.

Related errors


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