HewlettPackard / HewlettPackard/morpheus-cli

virtual-images download command times out on large images (30s hardcoded timeout not overridable)

Open
#72 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
20
Forks
8
Avg merge
57m
Merged PRs (30d)
7

Description

The `virtual-images download` subcommand fails with `RestClient::Exceptions::ReadTimeout: Timed out reading data from server` when downloading large virtual images (e.g. multi-GB Windows base templates). The root cause is that:

1. `Morpheus::RestClient.execute` applies a 30 second default timeout for all GET requests (`lib/morpheus/rest_client.rb` line 25)
2. `download_chunked` in `virtual_images_interface.rb` never passes a `:timeout` option to override this default
3. The `download` subcommand in `virtual_images.rb` uses `build_common_options(opts, options, [:dry_run, :quiet])` which does not include `:options`, so the hidden `--timeout` flag is parsed but never propagated to the HTTP request

Even though `setopts(options)` is called at line 1031, the `download_chunked` method constructs its own `opts` hash directly and never reads the timeout from `@options`.

## Expected Behavior

The `--timeout` option should be respected by the download command, or `download_chunked` should use a much longer default timeout (like the `upload` method does).

## Actual Behavior

```
Error Communicating with the remote appliance.
Timed out reading data from server

RestClient::Exceptions::ReadTimeout: Timed out reading data from server
```

## Environment

- Morpheus CLI version: 8.0.13 (also affects 9.0)
- Ruby: 3.1.2

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lib/morpheus/rest_client.rb, virtual_images_interface.rb, and virtual_images.rb, tracing how the download subcommand builds options and how download_chunked performs requests. Verify the existing --timeout path and compare it with upload; done means large virtual-image downloads can use an overridden timeout without the 30-second read timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.