[openstack-dev] [Congress] Error datasource create

Tim Hinrichs tim at styra.com
Tue Nov 8 18:07:38 UTC 2016


Here's the pertinent error.  It looks like you have a typo in one of your
translators.

2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node InvalidParamException:
Params (field_translators, selector_type) are invalid.  Valid params:
('translation-type', 'table-name', 'parent-key', 'id-col', 'selector-type',
'field-translators', 'in-list', 'parent-col-name', 'objects-extract-fn',
'parent-key-desc')


If you push your Magnum datasource code to review, we can help you more
easily.  Let us know if you need help doing that.  Here's the quickstart
guide.
http://docs.openstack.org/contributor-guide/quickstart/first-timers.html

There are 2 kinds of testing you can do.

1. Run congress and magnum using Devstack (as it seems you're doing).
Manually add a couple of objects to Magnum and manually check that those
objects are showing up in Congress.

2. You can run unit tests on a Linux box with the following commands.
$ cd /path/to/congress
$ tox

You can run specific tests with ...
$ tox -epy34      // just run the Python34 tests
$ tox -epy34 congress.tests.datasources     // just run the tests in the
congress/tests/datasources directory
$ tox -epy34 congress.tests.datasources.glancev2_driver  // just run the
tests in the file test_glancev2_driver.py
$ tox -epy34
congress.tests.datasources.glancev2_driver.test_update_from_datasource   //
just run the test_update_from_datasource test

Tim


On Tue, Nov 8, 2016 at 3:26 AM Ruben <r.manganiello1 at studenti.unisa.it>
wrote:

> Hi everybody,
> really, I've not been able to create the datasource for magnum.
> Now, I've seen that I've these errors when I restart the congress server..
>
> "ERROR congress.dse2.dse_node [-] Error loading instance of module
> 'congress.datasources.magnum_driver.MagnumDriver'
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node Traceback (most
> recent call last):
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/dse2/dse_node.py", line 841, in
> create_datasource_service
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node     service =
> getattr(module, class_name)(**kwargs)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/magnum_driver.py", line 49, in
> __init__
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  super(MagnumDriver, self).__init__(name, args=args)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1282,
> in __init__
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  super(PollingDataSourceDriver, self).__init__(name, args=args)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 324,
> in __init__
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  self.initialize_translators()
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1324,
> in initialize_translators
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  self.register_translator(translator)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 457,
> in register_translator
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  self._validate_translator(translator, related_tables)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 446,
> in _validate_translator
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  self._validate_by_translation_type(translator, related_tables)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 415,
> in _validate_by_translation_type
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
>  self._get_translator_params(translation_type))
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node   File
> "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1066,
> in check_params
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node     raise
> exception.InvalidParamException(err)
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
> InvalidParamException: Params (field_translators, selector_type) are
> invalid.  Valid params: ('translation-type', 'table-name', 'parent-key',
> 'id-col', 'selector-type', 'field-translators', 'in-list',
> 'parent-col-name', 'objects-extract-fn', 'parent-key-desc')
> 2016-11-08 12:15:29.906 TRACE congress.dse2.dse_node
> 2016-11-08 12:15:29.911 ERROR congress.harness [-] datasource magnum
> creation failed.
> 2016-11-08 12:15:29.911 TRACE congress.harness Traceback (most recent call
> last):
> 2016-11-08 12:15:29.911 TRACE congress.harness   File
> "/opt/stack/congress/congress/harness.py", line 167, in create_datasources
> 2016-11-08 12:15:29.911 TRACE congress.harness     service =
> bus.create_datasource_service(ds)
> 2016-11-08 12:15:29.911 TRACE congress.harness   File
> "/opt/stack/congress/congress/dse2/dse_node.py", line 845, in
> create_datasource_service
> 2016-11-08 12:15:29.911 TRACE congress.harness     raise
> exception.DataServiceError(msg % class_path)
> 2016-11-08 12:15:29.911 TRACE congress.harness DataServiceError: Error
> loading instance of module 'congress.datasources.magnum_driver.MagnumDriver'
> 2016-11-08 12:15:29.911 TRACE congress.harness
> 2016-11-08 12:15:29.912 ERROR congress.service [-] Fatal Exception:
> 2016-11-08 12:15:29.912 TRACE congress.service Traceback (most recent call
> last):
> 2016-11-08 12:15:29.912 TRACE congress.service   File
> "/opt/stack/congress/congress/service.py", line 34, in wrapper
> 2016-11-08 12:15:29.912 TRACE congress.service     return f(*args, **kw)
> 2016-11-08 12:15:29.912 TRACE congress.service   File
> "/opt/stack/congress/congress/service.py", line 51, in congress_app_factory
> 2016-11-08 12:15:29.912 TRACE congress.service
>  datasources=flags_dict['datasources'])
> 2016-11-08 12:15:29.912 TRACE congress.service   File
> "/opt/stack/congress/congress/harness.py", line 93, in create2
> 2016-11-08 12:15:29.912 TRACE congress.service     services['datasources']
> = create_datasources(node)
> 2016-11-08 12:15:29.912 TRACE congress.service   File
> "/opt/stack/congress/congress/harness.py", line 167, in create_datasources
> 2016-11-08 12:15:29.912 TRACE congress.service     service =
> bus.create_datasource_service(ds)
> 2016-11-08 12:15:29.912 TRACE congress.service   File
> "/opt/stack/congress/congress/dse2/dse_node.py", line 845, in
> create_datasource_service
> 2016-11-08 12:15:29.912 TRACE congress.service     raise
> exception.DataServiceError(msg % class_path)
> 2016-11-08 12:15:29.912 TRACE congress.service DataServiceError: Error
> loading instance of module 'congress.datasources.magnum_driver.MagnumDriver'
> 2016-11-08 12:15:29.912 TRACE congress.service
> 2016-11-08 12:15:29.914 DEBUG oslo_concurrency.lockutils [-] Acquired
> semaphore "singleton_lock" from (pid=10406) lock
> /usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:212
> 2016-11-08 12:15:29.914 DEBUG oslo_concurrency.lockutils [-] Releasing
> semaphore "singleton_lock" from (pid=10406) lock
> /usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:225
> "
>
> Ruben
>
> ----- Messaggio originale -----
> Da: "Ruben" <r.manganiello1 at studenti.unisa.it>
> A: "Eric" <ekcs.openstack at gmail.com>
> Cc: openstack-dev at lists.openstack.org
> Inviato: Domenica, 6 novembre 2016 17:48:24
> Oggetto: Re: [openstack-dev] [Congress] Restart Congress server
>
> Hi Eric,
> also with the old congress.conf file there is the error.
> I've used devstack with a single-process congress deployment.
>
> To stop the congress server I make: screen -x stack and Ctrl-C in the
> congress window.
> To restart the congress server I make: screen -x stack and sudo
> /usr/local/bin/congress-server --debug in the congress window.
>
> Is it possible that I should rejoin the stack?
>
> Ruben
>
> ----- Original Message -----
> From: "Eric" <ekcs.openstack at gmail.com>
> To: openstack-dev at lists.openstack.org
> Cc: "Ruben" <r.manganiello1 at studenti.unisa.it>
> Sent: Friday, November 4, 2016 7:23:50 PM
> Subject: Re: [Congress] Restart Congress server
>
> Hi Ruben,
>
> Awesome to hear about your progress!
>
> The error seems to be independent of adding a new driver.
>
> Could you try using the unchanged congress.conf and restarting again to
> see if the same problem shows up?
>
> Also, could you give the command you¹re using the launch congress-server?
>
> Mainly I want to understand whether you¹re using single-process congress
> deployment or multi-process congress deployment. If multi-process, it¹s
> possible that the datasources process was stopped but wasn¹t restarted.
>
>
> If your screen listing (access by pressing Ctrl-A followed by ") shows
> three congress windows like this, then you¹re running in multi-process
> mode:
> 29 congress-api
>                                                             $(L)
>   30 congress-engine
>                                                               $(L)
>   31 congress-datasources
>                                                               $(L)
>
> To launch Congress, make sure all three are running properly.
>
> A simpler alternative (but takes some time) is to deploy devstack from
> scratch (saving your work somewhere of course) using the latest versions
> (defaults to single process), which should reduce complications from
> multiple processes and make everything easier for dev-testing.
>
> All the best!
>
>
>
> On 11/4/16, 4:53 AM, "Ruben" <r.manganiello1 at studenti.unisa.it> wrote:
>
> >Hi everyone,
> >I've tried to write a datasource driver for Magnum and the unit test for
> >it.
> >So I've add this datasource driver in
> >/opt/stack/congress/congress/datasources/ and the unit test in
> >/opt/stack/congress/congress/tests/datasources/ to test it.
> >Moreover, I've add the driver to /etc/congress/congress.conf, but when I
> >try to restart Congress server I've some errors.
> >
> >
> >"2016-11-04 12:13:00.390 TRACE congress.service     self.service_id,
> >service, table)
> >2016-11-04 12:13:00.390 TRACE congress.service   File
> >"/opt/stack/congress/congress/dse2/dse_node.py", line 468, in
> >subscribe_table
> >2016-11-04 12:13:00.390 TRACE congress.service     {'table': table})
> >2016-11-04 12:13:00.390 TRACE congress.service   File
> >"/opt/stack/congress/congress/dse2/dse_node.py", line 355, in
> >invoke_service_rpc
> >2016-11-04 12:13:00.390 TRACE congress.service     raise
> >exception.NotFound(msg % service_id)
> >2016-11-04 12:13:00.390 TRACE congress.service NotFound: service 'nova'
> >could not be found
> >2016-11-04 12:13:00.390 TRACE congress.service
> >2016-11-04 12:13:00.537 DEBUG oslo_concurrency.lockutils [-] Acquired
> >semaphore "singleton_lock" from (pid=24411) lock
> >/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:212
> >2016-11-04 12:13:00.538 DEBUG oslo_concurrency.lockutils [-] Releasing
> >semaphore "singleton_lock" from (pid=24411) lock
> >/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:225"
> >
> >I don't know what to do to solve it and even if the driver I've written
> >works.
> >Maybe I make mistakes when I restart Congress server..
> >What should I do to restart Congress server?
> >What could I do to test the datasource and solve these problems?
> >
> >Ruben
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20161108/d54e2824/attachment.html>


More information about the OpenStack-dev mailing list