Skip to content

Instantly share code, notes, and snippets.

View clarsonneur's full-sized avatar

christophe larsonneur clarsonneur

  • SFEIR
  • Paris - France
View GitHub Profile

Keybase proof

I hereby claim:

  • I am clarsonneur on github.
  • I am clarsonneur (https://keybase.io/clarsonneur) on keybase.
  • I have a public key ASBGC7678t_SIl4puapdf2GZx_4U6ySvPt8B6uLKX-aS7go

To claim this, I am signing this object:

@clarsonneur
clarsonneur / gist:d35332c6bfbecfc66e4c
Created April 28, 2015 16:36
st2auth message/response
Host: 15.50.137.65:9100
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,fr;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Origin: http://15.50.137.65:9101
Access-Control-Request-Method: POST
Access-Control-Request-Headers: authorization,content-type
Connection: keep-alive
[Mon Apr 27 15:32:39.145625 2015] [:error] [pid 20302:tid 140109699139328] [remote 127.0.0.1:11740] mod_wsgi (pid=20302): Exception occurred processing WSGI script '/src/st2/st2auth/st2auth/wsgi.py'.
[Mon Apr 27 15:32:39.145665 2015] [:error] [pid 20302:tid 140109699139328] [remote 127.0.0.1:11740] Traceback (most recent call last):
[Mon Apr 27 15:32:39.145692 2015] [:error] [pid 20302:tid 140109699139328] [remote 127.0.0.1:11740] File "/src/st2/st2auth/st2auth/wsgi.py", line 28, in <module>
[Mon Apr 27 15:32:39.145776 2015] [:error] [pid 20302:tid 140109699139328] [remote 127.0.0.1:11740] username=username, password=password)
[Mon Apr 27 15:32:39.145790 2015] [:error] [pid 20302:tid 140109699139328] [remote 127.0.0.1:11740] File "/src/st2/st2common/st2common/models/db/__init__.py", line 29, in db_setup
[Mon Apr 27 15:32:39.145878 2015] [:error] [pid 20302:tid 140109699139328] [remote 127.0.0.1:11740] username=username, password=password)
[Mon Apr 27 15:32:39.145891 2015] [:error] [pid 20302:tid 1
@clarsonneur
clarsonneur / gist:0b299003788f40668c99
Created April 27, 2015 12:56
apache st2auth.conf
<VirtualHost *:9100>
ServerName myhost.mydomain.com:9100
WSGIScriptAlias / /usr/lib/python2.7/dist-packages/st2auth/wsgi.py
WSGIDaemonProcess st2auth user=stanley group=stanley processes=2 threads=25 python-path=/usr/lib/python2.7/dist-packages/st2auth:/usr/lib/python2.7/dist-packages/st2common:/usr/lib/python2.7/dist-packages
#/path/to/virtualenv/local/lib/python2.7/site-packages
WSGIProcessGroup st2auth
SSLEngine on
@clarsonneur
clarsonneur / gist:aa5ebe0236a15aa7a913
Created March 20, 2015 12:58
sensor container crash
2015-03-20 12:56:02,971 140331965379760 INFO __init__ [-] Connecting to database "st2" @ "0.0.0.0:27017" as user "None".
2015-03-20 12:56:03,640 140331965379760 INFO utils [-] Registering exchanges...
2015-03-20 12:56:03,968 140331965379760 INFO utils [-] registered exchange st2.execution.
2015-03-20 12:56:03,969 140331965379760 INFO utils [-] registered exchange st2.liveaction.
2015-03-20 12:56:03,970 140331965379760 INFO utils [-] registered exchange st2.trigger.
2015-03-20 12:56:03,970 140331965379760 INFO utils [-] registered exchange st2.trigger_instances_dispatch.
2015-03-20 12:56:04,737 140331965379760 INFO sensormanager [-] Found 3 sensors.
2015-03-20 12:56:04,756 140331965379760 INFO manager [-] Setting up container to run 3 sensors.
2015-03-20 12:56:04,757 140331965379760 INFO manager [-] (PID:3804) SensorContainer started.
2015-03-20 12:56:04,775 140331965379760 INFO process_container [-] Running sensor HelloSensor
# System-wide configuration
[api]
# Host and port to bind the API server.
host = 0.0.0.0
port = 9101
logging = /etc/st2api/logging.conf
serve_webui_files = True
# allow_origin is required for handling CORS in st2 web UI.
# allow_origin = http://myhost1.example.com:3000,http://myhost2.example.com:3000
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.
st2 --debug rule delete 550a9548e9720f11330cf940
# -------- begin 50764816 request ----------
curl -X GET -H 'Connection: keep-alive' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-requests/2.5.3 CPython/2.7.5 Linux/3.11.10-301.fc20.x86_64' 'http://localhost:9101/v1/rules/?name=550a9548e9720f11330cf940'
# -------- begin 50764816 response ----------
[]
# -------- end 50764816 response ------------
# -------- begin 50764816 request ----------
curl -X GET -H 'Connection: keep-alive' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-requests/2.5.3 CPython/2.7.5 Linux/3.11.10-301.fc20.x86_64' http://localhost:9101/v1/rules/550a9548e9720f11330cf940
# -------- begin 50764816 response ----------
$ st2 rule list
ERROR: 500 Server Error: Internal Server Error
MESSAGE: Missing TriggerDB object for rule 550a9548e9720f11330cf940
$ mongo st2 --eval "db.rule_d_b.find().forEach(function(x){printjson(x);})"
MongoDB shell version: 2.4.6
connecting to: st2
{
"_id" : ObjectId("54fecf0ee9720f0c5d9de0a0"),
"name" : "examples.webhook_file",