Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in editing interface - multiple layers #2540

Closed
kalbermattenm opened this issue Sep 21, 2016 · 12 comments
Closed

Error in editing interface - multiple layers #2540

kalbermattenm opened this issue Sep 21, 2016 · 12 comments

Comments

@kalbermattenm
Copy link
Contributor

In GMF 1.6.x, when using the editing interface and activating multiple layers at once, I get the hereunder error. I first thought it was related to #699, but it is something else.

It looks like things get mixed up between layers...

When running pserve, I do not get any error, thus I thought that this was due to the dogpile caching on arguments and I turned it off (I mainly just commented https://github.com/camptocamp/c2cgeoportal/blob/1.6/c2cgeoportal/views/layers.py#L367 out...)

Commenting this line makes things work... PR or not ? And does anyone understand what is really happening (I don't...)

[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\fanstatic\\publisher.py", line 219, in __call__
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return self.app(environ, start_response)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\fanstatic\\injector.py", line 54, in __call__
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = request.get_response(self.app)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\webob\\request.py", line 1320, in send
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     application, catch_exc_info=False)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\webob\\request.py", line 1284, in call_application
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     app_iter = application(self.environ, start_response)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid\\router.py", line 243, in __call__
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = self.invoke_subrequest(request, use_tweens=True)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid\\router.py", line 218, in invoke_subrequest
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = handle_request(request)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid\\tweens.py", line 21, in excview_tween
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = handler(request)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid_tm\\__init__.py", line 94, in tm_tween
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     reraise(*exc_info)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid_tm\\__init__.py", line 75, in tm_tween
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = handler(request)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid\\router.py", line 164, in handle_request
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = view_callable(context, request)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid\\config\\views.py", line 353, in rendered_view
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     result = view(context, request)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\pyramid\\config\\views.py", line 481, in _class_requestonly_view
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     response = getattr(inst, attr)()
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\views\\layers.py", line 365, in metadata
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return self._metadata(str(layer.geo_table), layer.exclude_properties)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\cache\\region.py", line 1040, in decorate
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     should_cache_fn)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\cache\\region.py", line 651, in get_or_create
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     async_creator) as value:
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\core\\dogpile.py", line 158, in __enter__
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return self._enter()
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\core\\dogpile.py", line 98, in _enter
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     generated = self._enter_create(createdtime)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\core\\dogpile.py", line 149, in _enter_create
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     created = self.creator()
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\cache\\region.py", line 619, in gen_value
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     created_value = creator()
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\dogpile\\cache\\region.py", line 1036, in creator
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return fn(*arg, **kw)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\views\\layers.py", line 371, in _metadata
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     exclude_properties=exclude_properties
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\lib\\dbreflection.py", line 200, in get_class
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     cls = _create_class(table, exclude_properties)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\lib\\dbreflection.py", line 226, in _create_class
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     _add_association_proxy(cls, col)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\lib\\dbreflection.py", line 237, in _add_association_proxy
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     child_cls = get_class(child_tablename)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\lib\\dbreflection.py", line 197, in get_class
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     table = get_table(tablename, schema, session)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\c2cgeoportal\\lib\\dbreflection.py", line 178, in get_table
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     )] if management else []
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 406, in __new__
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     table._init(name, metadata, *args, **kw)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 479, in _init
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     self._autoload(metadata, autoload_with, include_columns)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 491, in _autoload
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     self, include_columns, exclude_columns
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\engine\\base.py", line 1732, in run_callable
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return conn.run_callable(callable_, *args, **kwargs)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\engine\\base.py", line 1241, in run_callable
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return callable_(self, *args, **kwargs)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\engine\\default.py", line 356, in reflecttable
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     return insp.reflecttable(table, include_columns, exclude_columns)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\engine\\reflection.py", line 512, in reflecttable
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     table.append_column(col)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 632, in append_column
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     column._set_parent_with_dispatch(self)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\base.py", line 433, in _set_parent_with_dispatch
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     self._set_parent(parent)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 1262, in _set_parent
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     fk._set_remote_table(table)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 1749, in _set_remote_table
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     self._link_to_col_by_colstring(parenttable, table, colname)
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]   File "d:\\applications\\mapfish\\production\\.build\\venv\\Lib\\site-packages\\sqlalchemy\\sql\\schema.py", line 1650, in _link_to_col_by_colstring
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6]     assert self.constraint._referred_table is table
[Wed Sep 21 09:50:33 2016] [error] [client 148.196.28.6] AssertionError
@kalbermattenm
Copy link
Contributor Author

Anyone...?

@yjacolin
Copy link
Member

@kalbermattenm We need to plan some time and are looking for the best person. Probably @sbrunner :)

@kalbermattenm
Copy link
Contributor Author

kalbermattenm commented Sep 28, 2016

No worries! Thanks for your reply!

There is no emergency, but it would be good to get that fixed as it will reappear each time I update the c2cgeoportal egg...

@yjacolin
Copy link
Member

Good to know because we probably work on this after the 17/10.

@sbrunner
Copy link
Member

sbrunner commented Oct 5, 2016

@kalbermattenm The trace you post is the trace you get when you get an error?
It's strange for me that your not using a class from the cache...

@kalbermattenm
Copy link
Contributor Author

@kalbermattenm The trace you post is the trace you get when you get an error?

Yes

It's strange for me that your not using a class from the cache...

Because there is no cache at the moment I get this error (and the cache is never supplied because I always get this error...)

@sbrunner
Copy link
Member

sbrunner commented Oct 5, 2016

But when you remove the line https://github.com/camptocamp/c2cgeoportal/blob/1.6/c2cgeoportal/views/layers.py#L367 you don't have anymore an error?

@kalbermattenm
Copy link
Contributor Author

Exactly...

And my knowledge of the dogpile cache is not good enough to really understand why... It is like it is trying to cache something twice or that something is already existing in the cache and cannot be overwritten (because having multiple layers will call this function multiple times), or... I do not know...

@sbrunner
Copy link
Member

sbrunner commented Oct 5, 2016

Same for me, I will do a pull request ...

@kalbermattenm
Copy link
Contributor Author

Cool... (or not...)

I think we could remove the cache on this function without loosing a lot of performance....

@sbrunner
Copy link
Member

sbrunner commented Oct 5, 2016

Effectively :-) I think also

@kalbermattenm
Copy link
Contributor Author

PR was merged, problem resolved, thanks @sbrunner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants