Install local pack fails

Hi,

I have some issues when i try to install a local pack:

st2 pack install

st2 pack install file:///my/pack/path

It seems st2 try to download the pack on the ‘git’ repository :

fatal /my/pack/path does not appear to be a git repository
fatal: Could not read from remote repository.
  1. I don’t understand why st2 try to download from a git repo, I just want install my own pack
  2. /my/pack/path is a git repository

st2 --version
st2 2.8.1, on Python 2.7.5

(i can’t update this version)

Regards,

User42

StackStorm pack install expects pack to be a git repository. file:// shortcut is just a helper, allowing you to bypass normal remote repo-based installation.

As a workaround you can git init in you local pack to make it a git repository.

i have a directory own_pack wich is a repository git. All my pack are in this directory and so be a part of my repository git.

own_pack (master)
|_test
|… |_pack.yaml
|_toto
|… |_pack.yaml

[user42~]$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
    new_file:  test/pack.yaml

toto/pack.yaml already pushed. But I have the same message when I try to install the toto pack.

Regards,

User42

You need to make sure every pack is a git repository, eg .git should exist in test/ or toto/ dirs.
This sounds like a limitation, however using pack install with file:/// is hack as well.

okay thx, another issue during (install pack dependencies | packs.setup_virtualenv)

Exception: Failed to install requirement "six>=1.9.0,<2.0": Collecting six<2.0,>=1.9.0

I already have python-six-1.9.0-2

Which OS/flavor is that? You’re running really old st2 version v2.8.1. This might be fixed in latest st2 versions. Try to run pack install for the same packs with latest st2 to verify if it’s version-specific or not. Spinning a quick Vagrant environment for that might help: Vagrant & Virtual Appliance — StackStorm 3.1.0 documentation

To help you to debug it more: which pack you’re trying to install? Is it something from StackStorm exchange? Are you seeing this behavior for every pack or only some of them? What do you have in pack requirements for failing pack? Did it work before?

I try to install my own pack without internet network. I see this behavior for all my pack.

st2 try to run:
/opt/stackstorm/virtualenvs/my_pack/pip install six
Could not fetch URL https://pypi.python.org/simple/six/

This command try to install six from internet… but I already have six on my system.

I just try with a test pack :

git repository test contains only pack.yaml:

cat pack.yaml
---
name : toto
description : toto
version : 0.0.1
author : toto titi
email : toto@titi.fr

The same problem:
st2 pack install file:///path/to/test
failed (29s elapsed) | install pack dependencies | packs.setup_virtualenv
Exception: Failed to install requirement "six>=1.9.0,<2.0": Collecting six<2.0,>=1.9.0

Your system might have similar python packages installed, but six installation is required for every isolated pack virtualenv to work properly. It’s a base requirement that needs to be fetched.

I can however understand your issue with air-gapped environment. Can you please open a bug report in GitHub - StackStorm/st2: StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, security responses, troubleshooting, deployments, and more. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html. Questions? https://forum.stackstorm.com/. describing this limitation related to environments with no internet connections?