Skip to content

Instantly share code, notes, and snippets.

@clarsonneur
Created March 19, 2015 16:54
Show Gist options
  • Save clarsonneur/ec6589696873275ad564 to your computer and use it in GitHub Desktop.
Save clarsonneur/ec6589696873275ad564 to your computer and use it in GitHub Desktop.
sensor container
Typical log.
2015-03-19 16:43:19,258 INFO [-] Connecting to database "st2" @ "0.0.0.0:27017" as user "None".
2015-03-19 16:43:19,299 INFO [-] Registering exchanges...
2015-03-19 16:43:19,476 INFO [-] registered exchange st2.execution.
2015-03-19 16:43:19,477 INFO [-] registered exchange st2.liveaction.
2015-03-19 16:43:19,477 INFO [-] registered exchange st2.trigger.
2015-03-19 16:43:19,478 INFO [-] registered exchange st2.trigger_instances_dispatch.
2015-03-19 16:43:19,520 INFO [-] Found 3 sensors.
2015-03-19 16:43:19,522 INFO [-] Setting up container to run 0 sensors.
2015-03-19 16:43:19,522 INFO [-] (PID:13580) SensorContainer started.
2015-03-19 16:43:19,522 INFO [-] Container has no active sensors running.
2015-03-19 16:43:19,523 INFO [-] (PID:13580) SensorContainer stopped. Reason - run ended.
[root@st2-dev-fc20 ~]# sensor_container --config-file=/etc/st2/st2.conf --sensor-name=EverySixty
2015-03-19 16:43:59,664 INFO [-] Connecting to database "st2" @ "0.0.0.0:27017" as user "None".
2015-03-19 16:43:59,697 INFO [-] Registering exchanges...
2015-03-19 16:43:59,820 INFO [-] registered exchange st2.execution.
2015-03-19 16:43:59,821 INFO [-] registered exchange st2.liveaction.
2015-03-19 16:43:59,821 INFO [-] registered exchange st2.trigger.
2015-03-19 16:43:59,822 INFO [-] registered exchange st2.trigger_instances_dispatch.
2015-03-19 16:43:59,871 INFO [-] Found 3 sensors.
2015-03-19 16:43:59,872 INFO [-] Setting up container to run 1 sensors.
2015-03-19 16:43:59,872 INFO [-] (PID:13596) SensorContainer started.
2015-03-19 16:43:59,873 INFO [-] Running sensor EverySixty
2015-03-19 16:43:59,873 WARNING [-]
Virtual environment for pack "ChangeRecord" doesn't exist. If you haven't installed a pack using
"packs.install" command, you can create a new virtual environment using
"st2 run packs.setup_virtualenv packs=ChangeRecord" command'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/st2reactor/container/process_container.py", line 152, in _run_all_sensors
self._spawn_sensor_process(sensor=sensor_obj)
File "/usr/lib/python2.7/site-packages/st2reactor/container/process_container.py", line 175, in _spawn_sensor_process
raise Exception(msg)
Exception:
Virtual environment for pack "ChangeRecord" doesn't exist. If you haven't installed a pack using
"packs.install" command, you can create a new virtual environment using
"st2 run packs.setup_virtualenv packs=ChangeRecord" command'
I tried the st2 run packs.setup_virtualenv packs=ChangeRecord
It returns this:
st2 run packs.setup_virtualenv packs=ChangeRecord
.
+-----------------+--------------------------------------------------------------+
| Property | Value |
+-----------------+--------------------------------------------------------------+
| id | 550afce1e9720f5d51e1a0d4 |
| action.ref | packs.setup_virtualenv |
| context.user | stanley |
| parameters | { |
| | "packs": [ |
| | "ChangeRecord" |
| | ] |
| | } |
| status | failed |
| start_timestamp | Thu, 19 Mar 2015 16:44:17 UTC |
| end_timestamp | Thu, 19 Mar 2015 16:44:18 UTC |
| result | { |
| | "result": null, |
| | "exit_code": 1, |
| | "stderr": |
| | "st2.actions.python.SetupVirtualEnvironmentAction: DEBUG |
| | Setting up virtualenv for pack "ChangeRecord" |
| | Traceback (most recent call last): |
| | File "/usr/lib/python2.7/site- |
| | packages/st2actions/runners/python_action_wrapper.py", line |
| | 106, in <module> |
| | obj.run() |
| | File "/usr/lib/python2.7/site- |
| | packages/st2actions/runners/python_action_wrapper.py", line |
| | 57, in run |
| | output = action.run(**self._parameters) |
| | File "/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_ |
| | virtualenv.py", line 46, in run |
| | self._setup_pack_virtualenv(pack_name=pack_name) |
| | File "/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_ |
| | virtualenv.py", line 70, in _setup_pack_virtualenv |
| | raise Exception('Pack "%s" is not installed' % |
| | (pack_name)) |
| | Exception: Pack "ChangeRecord" is not installed |
| | ", |
| | "stdout": "" |
| | } |
+-----------------+--------------------------------------------------------------+
the HelloSensor provide the same.
st2 run packs.setup_virtualenv packs=HelloSensor
.
+-----------------+--------------------------------------------------------------+
| Property | Value |
+-----------------+--------------------------------------------------------------+
| id | 550afdafe9720f5d51e1a0d6 |
| action.ref | packs.setup_virtualenv |
| context.user | stanley |
| parameters | { |
| | "packs": [ |
| | "HelloSensor" |
| | ] |
| | } |
| status | failed |
| start_timestamp | Thu, 19 Mar 2015 16:47:42 UTC |
| end_timestamp | Thu, 19 Mar 2015 16:47:43 UTC |
| result | { |
| | "result": null, |
| | "exit_code": 1, |
| | "stderr": |
| | "st2.actions.python.SetupVirtualEnvironmentAction: DEBUG |
| | Setting up virtualenv for pack "HelloSensor" |
| | Traceback (most recent call last): |
| | File "/usr/lib/python2.7/site- |
| | packages/st2actions/runners/python_action_wrapper.py", line |
| | 106, in <module> |
| | obj.run() |
| | File "/usr/lib/python2.7/site- |
| | packages/st2actions/runners/python_action_wrapper.py", line |
| | 57, in run |
| | output = action.run(**self._parameters) |
| | File "/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_ |
| | virtualenv.py", line 46, in run |
| | self._setup_pack_virtualenv(pack_name=pack_name) |
| | File "/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_ |
| | virtualenv.py", line 70, in _setup_pack_virtualenv |
| | raise Exception('Pack "%s" is not installed' % |
| | (pack_name)) |
| | Exception: Pack "HelloSensor" is not installed |
| | ", |
| | "stdout": "" |
| | } |
+-----------------+--------------------------------------------------------------+
And the sensor_container process is then down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment