> ImportError: No module named EPICSEvent_pb2
This is protobuf generated python code (yes really :P ) which should
have been created by the setup.py build step (specifically the
build_protobuf step).
> However, if I go into the twisted directory it will start.
There are two way (the I've tested) to run carchivetools, a full install
"setup.py install ...." then add the destination directory to
PYTHONPATH. The destination directory should contain
"carchive/backend/EPICSEvent_pb2.py".
The other is an in-place build (for development/testing) as described at
the bottom of /README.md. This will generated EPICSEvent_pb2.py in the
source tree. So running from, or adding to PYTHONPATH, the root of the
source tree should work. It sounds like you've done this.
Before we get to a2aproxy, have you succeeded in getting the CLI tools
(eg. 'arinfo') to talk to AA? The following should serve as a template.
> cat <<EOF > test.conf
> [DEFAULT]
> urltype = appl
> host = http://localhost:17665/mgmt/bpl/getApplianceInfo
> EOF
> arinfo -C test.conf -vvv -a '*'
> ...a2aproxy will crashes with an
> exception 'dict' object has no attribute 'getint'. All the gory details
> follow...
This smells like a bug. This shouldn't be a 'dict', but rather a
'carchive._conf.ConfigDict'.
https://github.com/epicsdeb/carchivetools/issues/8
On 07/26/2016 09:15 AM, [email protected] wrote:
> Hello Michael,
>
>
>
> I have installed carchivetools and it looks like is will do exactly what
> I need but I think I am having a problem connecting it to AA. I am using
> twistd (the Twisted daemon) 13.2.0 and Python 2.7.6. I compiled and
> installed using setup.py and installed it under su. It all went smoothly
> and twistd –help now shows a2aproxy
>
>
>
> The problem is when I query a2aproxy with archiver.names or values
> (anything that seems to connect to AA). a2aproxy will crashes with an
> exception 'dict' object has no attribute 'getint'. All the gory details
> follow...
>
>
>
> I have an archiver appliance running on localhost. The mgmt and
> retrieval urls are running on different ports but I believe that is
> normal for the full setup of AA. From a browser,
> http://localhost:17665/mgmt/bpl/getApplianceInfo,
>
>
>
> AA will return:
>
>
>
> {"engineURL":"http:\/\/localhost:17666\/engine\/bpl","identity":"appliance0","retrievalURL":"http:\/\/localhost:17668\/retrieval\/bpl","clusterInetPort":"localhost:16670","etlURL":"http:\/\/localhost:17667\/etl\/bpl","version":"Archiver
> Appliance Version
> 0.0.1_SNAPSHOT_13-May-2016T11-23-57","mgmtURL":"http:\/\/localhost:17665\/mgmt\/bpl","dataRetrievalURL":"http:\/\/localhost:17668\/retrieval"}
>
>
>
>
>
> So, I start the a2aproxy via:
>
> twistd -n a2aproxy -P 8888 -A localhost:17665 (and several combinations
> of this with http:// etc during testing)
>
>
>
> If I start from outside the twisted plugin directory it will crash, this
> was my first worry as I thought that it was installed:
>
> ImportError: No module named EPICSEvent_pb2
>
>
>
> However, if I go into the twisted directory it will start. Ok, so I
> moved on, everything looks good. I can send and return the archiver.info
> call and get the hardcoded response from the proxy.
>
> However, if I send:
>
> archiver.names(1,"rga")
>
>
>
> Instead of getting a list of matching PVs from the AA it crashed with:
>
>
>
> 2016-07-26 13:53:40+0100 [HTTPChannel,0,148.79.212.92]
> INFO:carchive.a2aproxy.resource Request: archiver.names(1, 'rga')
>
> 2016-07-26 13:53:40+0100 [HTTPChannel,0,148.79.212.92]
> WARNING:carchive.a2aproxy.resource Cleanup of request with no
> reply
>
> 2016-07-26 13:53:40+0100 [HTTPChannel,0,148.79.212.92] 148.79.212.92 - -
> [26/Jul/2016:12:53:39 +0000] "POST /cgi-bin/ArchiveDataServer.cgi
> HTTP/1.1" 500 - "-" "Python-xmlrpc/3.5"
>
> 2016-07-26 13:53:40+0100 [HTTPChannel,0,148.79.212.92]
> ERROR:carchive.a2aproxy.resource Unhandled execption during request:
> Traceback (most recent call last):
>
> File
> "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 250, in
> render
>
> return m(request)
>
> File
> "/usr/local/lib/python2.7/dist-packages/carchive/a2aproxy/resource.py",
> line 106, in render_POST
>
> Dinfo = self.fetchInfo()
>
> File
> "/usr/local/lib/python2.7/dist-packages/carchive/a2aproxy/resource.py",
> line 73, in fetchInfo
>
> D = getArchive({'url':self.infourl})
>
> File
> "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1237,
> in unwindGenerator
>
> return _inlineCallbacks(None, gen, Deferred())
>
> --- <exception caught here> ---
>
> File
> "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099,
> in _inlineCallbacks
>
> result = g.send(result)
>
> File
> "/usr/local/lib/python2.7/dist-packages/carchive/backend/appl.py", line
> 208, in getArchive
>
> maxRequests=conf.getint('maxrequests', 100))
>
> exceptions.AttributeError: 'dict' object has no
> attribute 'getint'
>
>
>
> So, I thought that maybe the AA address was not getting set correctly in
> the proxy startup so I put a print statement into
>
> ./carchivetools-master/carchive/a2aproxy/resource.py:
>
> def buildResource(infourl=None):
>
> if not infourl.startswith('http') and infourl.find('/')==-1:
>
> # only host:port is provided, use default URL
>
> infourl = "http://%s/mgmt/bpl/getApplianceInfo"%infourl
>
> C = DataServer()
>
> C.infourl = infourl
>
> print(infourl)
>
>
>
> This printed out the correct url for AA:
> http://localhost:17665/mgmt/bpl/getApplianceInfo
>
>
>
> Best regards,
>
>
>
> Rory
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
- Replies:
- Re: EpicsQT and Archiver Appliance Pete Jemian
- RE: EpicsQT and Archiver Appliance rory.clarke
- References:
- Re: EpicsQT and Archiver Appliance rory.clarke
- Navigate by Date:
- Prev:
Re: EPICS-Arduino Serial Communication via Asyn-Stream Drivers Hulusi Öz
- Next:
Re: EpicsQT and Archiver Appliance Pete Jemian
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
<2016>
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: EpicsQT and Archiver Appliance rory.clarke
- Next:
Re: EpicsQT and Archiver Appliance Pete Jemian
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
<2016>
2017
2018
2019
2020
2021
2022
2023
2024
|