<div dir="ltr"><div>Hi All ,<br><br></div>Would need help!<br><div><div><br>I tried executing the script present in the link <a href="https://github.com/openstack/barbican/blob/master/bin/barbican-api" target="_blank">https://github.com/openstack/barbican/blob/master/bin/barbican-api</a>  to  start the barbican instance but  the use cases of barbican are failing.<br>Please find the details of the investigations :<br>
<br>
Usecase for posting and retrieving the secret.<br>
<br>
[root@barbican-keystone2 ~]# curl -X POST -H 
'content-type:application/json' -H 'X-Project-Id:12345' -d '{"payload": 
"my-secret-here", "payload_content_type": "text/plain"}' 
<a href="http://localhost:9311/v1/secrets">http://localhost:9311/v1/secrets</a><br>
{"code": 406, "description": null, "title": "Not Acceptable"}[root@barbican-keystone2 ~]#<br>
<br>
[root@barbican-keystone2 ~]# curl -H 'Accept: application/json' -H 'X-Project-Id:12345' <a href="http://localhost:9311/v1/secrets">http://localhost:9311/v1/secrets</a><br>
{"code": 406, "description": null, "title": "Not Acceptable"}[root@barbican-keystone2 ~]#<br>
[root@barbican-keystone2 ~]#<br>
<br>
[root@barbican-keystone2 ~]#  curl -X POST -H 
'content-type:application/json' -H 'X-Project-Id:12345' -d '{"payload": 
"my-secret-here", "payload_content_type": "text/plain"}' 
<a href="http://127.0.0.1:9311/v1/secrets">http://127.0.0.1:9311/v1/secrets</a><br>
{"code": 406, "description": null, "title": "Not Acceptable"}[root@barbican-keystone2 ~]#<br>
<br>
The output of the ps command when the barbican instance is stood up using the python script as pointed in the above link<br>
We do not see the instance of uwsgi in the response:<br>
<br>
[root@barbican-keystone2 ~]# ps -ef | grep barbican<br>
avahi     2920     1  0 Apr22 ?        00:00:00 avahi-daemon: running [barbican-keystone2.local]<br>
root     14743 14554  2 14:54 pts/1    00:00:01 python bin/barbican-api<br>
root     14781 13975  0 14:55 pts/0    00:00:00 grep --color=auto barbican<br>
<br>
The output of the ps command when the barbican instance is stood up using the barbican.sh script<br>
[root@barbican-keystone2 ~]# ps -ef | grep barbican<br>
avahi     2920     1  0 Apr22 ?        00:00:00 avahi-daemon: running [barbican-                 keystone2.local]<br>
root     14577 14554  0 14:50 pts/1    00:00:00 /bin/bash bin/barbican.sh start<br>
<font color="FF0000"><b>root     14582 14577  0 14:50 pts/1    00:00:00 uwsgi --master --emperor /etc/barbican/vassals<br>
root     14583 14582  0 14:50 pts/1    00:00:00 uwsgi --master --emperor /etc/barbican/vassals<br>
root     14584 14583  0 14:50 pts/1    00:00:00 /usr/bin/uwsgi --ini barbican-admin.ini<br>
root     14585 14583  0 14:50 pts/1    00:00:00 /usr/bin/uwsgi --ini barbican-api.ini<br>
root     14586 14584 10 14:50 pts/1    00:00:01 /usr/bin/uwsgi --ini barbican-admin.ini<br>
root     14587 14585 12 14:50 pts/1    00:00:01 /usr/bin/uwsgi --ini barbican-api.ini</b></font><br>
root     14601 13975  0 14:50 pts/0    00:00:00 grep --color=auto barbican<br>
<br>
The barbican instance needs to be started on top of uswgi server 
instance since uwsgi is the webserver which serves the request for 
barbican services. The script does not start the uwsgi server<br>
<br>
Please correct me if I am wrong.<br></div><div>Any help would be highly appreciated.<br></div><div>
<br>
Thanks and Regards,<br>
Asha Seshagiri</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 11:27 AM, Asha Seshagiri <span dir="ltr"><<a href="mailto:asha.seshagiri@gmail.com" target="_blank">asha.seshagiri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>Thanks Adam for your response.</div><div>I am able to run the barbican-api script without SQLLite installation .I guess SQLLite comes configured with barbican installation .Please correct me if I am wrong.</div><div><br></div><div><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">[root@barbican-keystone2 barbican]# bin/barbican-api</span><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">2015-04-23 11:12:31.571 8265 INFO barbican.model.repositories [-] Setting up database engine and session factory</span><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">2015-04-23 11:12:31.640 8265 INFO barbican.model.repositories [-] Updating schema to latest version</span><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">2015-04-23 11:12:31.640 8265 WARNING barbican.model.migration.commands [-] !!! Limited support for migration commands using sqlite databases; This operation may not succeed.</span><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">2015-04-23 11:12:31.643 8265 INFO alembic.migration [-] Context impl SQLiteImpl.</span><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">2015-04-23 11:12:31.644 8265 INFO alembic.migration [-] Will assume non-transactional DDL.</span><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">serving on <a href="http://127.0.0.1:9311" target="_blank">http://127.0.0.1:9311</a></span><br></div><div><br></div><div>I would like to get confirmation from the team that barbican-api would be used only to standup the barbican instance , for installation of barbican ,debugging and stoping the barbican instance , we still need to use barbican.sh script .</div><div><br></div><div>Any help would highly be appreciated.</div><span class=""><div><br></div><div>Thanks and Regards,</div><div>Asha Seshagiri</div><div><br></div></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 10:28 AM, Adam Harwell <span dir="ltr"><<a href="mailto:adam.harwell@rackspace.com" target="_blank">adam.harwell@rackspace.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>
<div>Do you have sqlite installed on your system, and do you have config.py in the root of your barbican directory? The database is configured there (assuming it hasn’t changed since I last ran Barbican locally), and mine looks like this:</div>
<div><br>
</div>
<div>
<div>config = {</div>
<div>    'sqlalchemy': {</div>
<div>        'url': 'sqlite:////tmp/barbican.db',</div>
<div>        'echo': True,</div>
<div>        'echo_pool': False,</div>
<div>        'pool_recycle': 3600,</div>
<div>        'encoding': 'utf-8'</div>
<div>    }</div>
<div>}</div>
</div>
<div><br>
</div>
<div>
<div>
<div><span style="white-space:pre-wrap"></span>--Adam</div>
<div><br>
</div>
</div>
<div><a href="https://keybase.io/rm_you" target="_blank">https://keybase.io/rm_you</a></div>
<div><br>
</div>
</div>
</div>
</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>neetu jain <<a href="mailto:nutshi@gmail.com" target="_blank">nutshi@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, April 23, 2015 at 10:07 AM<br>
<span style="font-weight:bold">To: </span>Asha Seshagiri <<a href="mailto:asha.seshagiri@gmail.com" target="_blank">asha.seshagiri@gmail.com</a>><br>
<span style="font-weight:bold">Cc: </span>John Wood <<a href="mailto:john.wood@RACKSPACE.COM" target="_blank">john.wood@RACKSPACE.COM</a>>, openstack-dev <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>>, "Reller, Nathan S." <<a href="mailto:Nathan.Reller@jhuapl.edu" target="_blank">Nathan.Reller@jhuapl.edu</a>>,
 Douglas Mendizabal <<a href="mailto:douglas.mendizabal@RACKSPACE.COM" target="_blank">douglas.mendizabal@RACKSPACE.COM</a>>, Paul Kehrer <<a href="mailto:paul.kehrer@RACKSPACE.COM" target="_blank">paul.kehrer@RACKSPACE.COM</a>>, Adam Harwell <<a href="mailto:adam.harwell@rackspace.com" target="_blank">adam.harwell@rackspace.com</a>>,
 Alexis Lee <<a href="mailto:alexisl@hp.com" target="_blank">alexisl@hp.com</a>><br>
<span style="font-weight:bold">Subject: </span>Re: Barbican : Dependency of pyenv configuration in Barbican.sh script<br>
</div><div><div>
<div><br>
</div>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>
<div>
<div dir="ltr">
<div>
<div>
<div>Thanks John for you answer. <br>
</div>
I tried running the  script bin/barbican-api and ran into this issue (pasted at the end) . Seems like the script does not take care of the database side.
<br>
<br>
</div>
1) do we need to do something else to setup database? or its being worked on ?<br>
</div>
2) Can we help in the process of removing dependencies in these scripts? Should that be through the launchpad ?<br>
<div>
<div>
<div>
<div><br>
<br>
TASK: [barbican | install barbican] ******************************************* <br>
failed: [barbican-04] => {"changed": true, "cmd": "cd /root/barbican/; python bin/barbican-api", "delta": "0:00:00.553279", "end": "2015-04-23 14:56:45.773115", "rc": 1, "start": "2015-04-23 14:56:45.219836", "warnings": []}<br>
stderr: 2015-04-23 14:56:45.736 6984 CRITICAL barbican [-] BarbicanException: No SQL connection configured<br>
2015-04-23 14:56:45.736 6984 TRACE barbican Traceback (most recent call last):<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "bin/barbican-api", line 17, in <module><br>
2015-04-23 14:56:45.736 6984 TRACE barbican     run()<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "bin/barbican-api", line 12, in run<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     relative_to='.')<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     return loadobj(APP, uri, name=name, **kw)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     return context.create()<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     return self.object_type.invoke(self)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 144, in invoke<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     **context.local_conf)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     val = callable(*args, **kw)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib64/python2.7/site-packages/paste/urlmap.py", line 31, in urlmap_factory<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     app = loader.get_app(app_name, global_conf=global_conf)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 350, in get_app<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     name=name, global_conf=global_conf).create()<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     return self.object_type.invoke(self)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 203, in invoke<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     app = context.app_context.create()<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     return self.object_type.invoke(self)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     return fix_call(context.object, context.global_conf, **context.local_conf)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     val = callable(*args, **kw)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/root/barbican/barbican/api/app.py", line 89, in create_main_app<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     repositories.setup_database_engine_and_factory()<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/root/barbican/barbican/model/repositories.py", line 109, in setup_database_engine_and_factory<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     _ENGINE = _get_engine(_ENGINE)<br>
2015-04-23 14:56:45.736 6984 TRACE barbican   File "/root/barbican/barbican/model/repositories.py", line 170, in _get_engine<br>
2015-04-23 14:56:45.736 6984 TRACE barbican     u._('No SQL connection configured'))<br>
2015-04-23 14:56:45.736 6984 TRACE barbican BarbicanException: No SQL connection configured<br>
2015-04-23 14:56:45.736 6984 TRACE barbican <br>
<br>
FATAL: all hosts have already failed -- aborting<br>
<br>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Apr 22, 2015 at 11:50 PM, Asha Seshagiri <span dir="ltr">
<<a href="mailto:asha.seshagiri@gmail.com" target="_blank">asha.seshagiri@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks a lot John for your response.
<div>I appreciate for your time and effort in answering the queries and also pointing to the latest changes which you been always doing :)</div>
<span>
<div><br>
</div>
<div>Thanks and  Regards,</div>
<div>Asha Seshagiri</div>
</span></div>
<div class="gmail_extra">
<div>
<div><br>
<div class="gmail_quote">On Wed, Apr 22, 2015 at 6:09 PM, John Wood <span dir="ltr">
<<a href="mailto:john.wood@rackspace.com" target="_blank">john.wood@rackspace.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,255);font-size:14px;font-family:Calibri,sans-serif">
<div>Hello Asha,</div>
<div><br>
</div>
<div>The barbican.sh script was originally intended to be a convenient way to boot up a Barbican instance locally to quickly start evaluating its API and functionality. </div>
<div><br>
</div>
<div>It was not intended to be used as a production script, deferring instead to deployments utilizing packages such as RDO RPMs and so forth for that purpose.</div>
<div><br>
</div>
<div>That said, changes to that script have been discussed, including removing pyenv and uWSGI as dependencies, hence such changes would be good to consider.</div>
<div><br>
</div>
<div>I’d also note that a solution based on this recently added script [1] might be in order.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>John</div>
<div><br>
</div>
<div>[1] <a href="https://github.com/openstack/barbican/blob/master/bin/barbican-api" target="_blank">https://github.com/openstack/barbican/blob/master/bin/barbican-api</a></div>
<div><br>
</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>Asha Seshagiri <<a href="mailto:asha.seshagiri@gmail.com" target="_blank">asha.seshagiri@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Wednesday, April 22, 2015 at 4:57 PM<br>
<span style="font-weight:bold">To: </span>openstack-dev <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Cc: </span>John Wood <<a href="mailto:john.wood@rackspace.com" target="_blank">john.wood@rackspace.com</a>>, "Reller, Nathan S." <<a href="mailto:Nathan.Reller@jhuapl.edu" target="_blank">Nathan.Reller@jhuapl.edu</a>>, Douglas
 Mendizabal <<a href="mailto:douglas.mendizabal@RACKSPACE.COM" target="_blank">douglas.mendizabal@RACKSPACE.COM</a>>, Paul Kehrer <<a href="mailto:paul.kehrer@RACKSPACE.COM" target="_blank">paul.kehrer@RACKSPACE.COM</a>>, Adam Harwell <<a href="mailto:adam.harwell@RACKSPACE.COM" target="_blank">adam.harwell@RACKSPACE.COM</a>>,
 Alexis Lee <<a href="mailto:alexisl@hp.com" target="_blank">alexisl@hp.com</a>>, "<a href="mailto:nutshi@gmail.com" target="_blank">nutshi@gmail.com</a>" <<a href="mailto:nutshi@gmail.com" target="_blank">nutshi@gmail.com</a>><br>
<span style="font-weight:bold">Subject: </span>Barbican : Dependency of pyenv configuration in Barbican.sh script<br>
</div>
<div>
<div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Hi All,
<div><br>
</div>
<div>I would like to know the reason behind the dependency of the pyenv virtual environment and pyenv in the barbican.sh script.</div>
<div>Ideally in the production environment  , barbican would run on standalone virtual box with a particular python version .I feel that their dependecies needs to be removed from the script.</div>
<div><br>
</div>
<div>Was able to stand up the barbican instance without configuring pyenv and pyenv-virtualenv dependencies  by modifying the barbican script , installing few additional packages and exporting the python path to PATH variable</div>
<div>Please find the change in barbican.sh script for installation and starting of the script below :</div>
<div><br>
<font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">VENV_DIR=${VIRTUAL_ENV:-`pyenv prefix`} ->
<b>This line needs to be removed </b></span></font><br style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">
<span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">uwsgi --master --emperor $CONFIG_DIR/vassals</span><b style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"> -H</b><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">  </span><b style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">$VENV_DIR
 -> The  </b><b style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">$VENV_DIR variable need to be removed as an argument and -H as an option.</b></div>
<div><b><br>
</b></div>
<div><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">The barbican script has been tied to $VENV_DIR variable which is dependent on the pyenv  for python configuration.Hence the barbican.sh  script needs to be  modified to remove </span><b style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">$VENV_DIR
 variable  </b><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px">by configuring python path in PATH variable.</span></div>
<div>On doing this , we can avoid the sourcing the pyenv and pyenv-virtualenv packages  and its dependices on Barbican script.</div>
<div><br>
</div>
<div>Any help would be highly appreciated and also would like to know opinion from the openstack group  on the changes indicated </div>
<div>Thanks in advance</div>
<div>
<div><br>
</div>
<br>
<div>
<div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
</div>
</div>
-- <br>
<span>
<div>
<div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div></div></span>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div></div>
</div>