st2 icon indicating copy to clipboard operation
st2 copied to clipboard

Add Timeout Option for st2 pack install

Open docbyte86 opened this issue 7 months ago • 4 comments

Feature Request: Add Timeout Option for st2 pack install

Summary

Add a command-line option to st2 pack install that allows users to override the default action timeout. This would be especially helpful for installing large packs or packs with many dependencies on slow network connections.


Motivation

Currently, the st2 pack install <pack-name> command uses a fixed, internal timeout for the underlying action. This can cause the installation to fail with a timeout error if the download of the pack or its dependencies takes too long. This is a frequent problem in environments with limited bandwidth or for large packs.

As a user, I have no way to increase this timeout directly from the CLI. The only current workarounds are to install the pack manually or to change the global action timeout settings, which is not ideal, as it affects all actions and requires a deeper understanding of StackStorm's configuration.

Providing a --timeout or similar flag would give users the flexibility to handle these cases without altering global configurations, making the CLI more robust and user-friendly for pack management.


Proposed Implementation

  • Introduce a new optional command-line argument for the st2 pack install command, for example, --timeout <seconds>.
  • The value provided by this flag would be passed to the underlying packs.install action as an execution_timeout parameter, overriding the default.
  • The value should accept a number in seconds. If not specified, the system should use the default timeout.

Example Use Case

Instead of the command failing:

$ st2 pack install my-large-pack
...
ERROR: Action execution failed: Execution failed due to a timeout.

Gern geschehen. Hier ist der Feature-Request als Markdown-Code, den du direkt in ein GitHub-Issue kopieren kannst.

Markdown

### **Feature Request: Add Timeout Option for `st2 pack install`**

### **Summary**

Add a command-line option to `st2 pack install` that allows users to override the default action timeout. This would be especially helpful for installing large packs or packs with many dependencies on slow network connections.

---

### **Motivation**

Currently, the `st2 pack install <pack-name>` command uses a fixed, internal timeout for the underlying action. This can cause the installation to fail with a timeout error if the download of the pack or its dependencies takes too long. This is a frequent problem in environments with limited bandwidth or for large packs.

As a user, I have no way to increase this timeout directly from the CLI. The only current workarounds are to install the pack manually or to change the global action timeout settings, which is not ideal, as it affects all actions and requires a deeper understanding of StackStorm's configuration.

Providing a `--timeout` or similar flag would give users the flexibility to handle these cases without altering global configurations, making the CLI more robust and user-friendly for pack management.

---

### **Proposed Implementation**

* Introduce a new optional command-line argument for the `st2 pack install` command, for example, `--timeout <seconds>`.
* The value provided by this flag would be passed to the underlying `packs.install` action as an `execution_timeout` parameter, overriding the default.
* The value should accept a number in seconds. If not specified, the system should use the default timeout.

---

### **Example Use Case**

Instead of the command failing:

```bash
$ st2 pack install my-large-pack
...
ERROR: Action execution failed: Execution failed due to a timeout.

The user could specify a longer timeout:

$ st2 pack install my-large-pack --timeout 1800

This would allow the installation to complete successfully, even if it takes up to 30 minutes.

docbyte86 avatar Aug 20 '25 14:08 docbyte86

Hello, I'd like to work on this issue

Looking forward to :)

docbyte86 avatar Oct 22 '25 06:10 docbyte86

st2 packs install is a workflow. workflows don't have timeouts themselves, but they can have (and install does) have a parameter called "timeout" that is then being passed as an input to setup_virtualenv. If it's not setup_virtualenv you're having issues with, which operation in the workflow is timing out for you?

Ah I see. So, while the st2 packs install does not support a timeout value, the flow actually does. You can try to use "st2 run packs.install packs=your_big_pack timeout=1800"

fdrab avatar Oct 22 '25 16:10 fdrab

st2 packs install is a workflow. workflows don't have timeouts themselves, but they can have (and install does) have a parameter called "timeout" that is then being passed as an input to setup_virtualenv. If it's not setup_virtualenv you're having issues with, which operation in the workflow is timing out for you?

Ah I see. So, while the st2 packs install does not support a timeout value, the flow actually does. You can try to use "st2 run packs.install packs=your_big_pack timeout=1800"

Hi @fdrab ,

it is the task install_pack_requirements step [packs.setup_virtualenv]. Our custom pack has many dependencies and we are using a workaround to use st2 run pack.install instead of st2 pack install which supports the needed parameters.

st2 run packs.install \
                packs="****}" force=true timeout=3600

But i think it would be good to add this parameter to the st2 pack install command

docbyte86 avatar Oct 24 '25 06:10 docbyte86

Oh right, yeah, that makes sense.

fdrab avatar Oct 24 '25 07:10 fdrab