camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
64 stars 46 forks source link

Transifex Issue with authenticated proxy #2723

Closed svavoi closed 6 years ago

svavoi commented 7 years ago

Running command: make -f svavoi.mk upgrade2

Result:

svavoi@bvdgdi-svdmbap3:~/mapbs$ make -f svavoi.mk upgrade2
.build/venv/bin/c2ctool upgrade  svavoi.mk --step 2
make[1]: Entering directory '/home/svavoi/mapbs'
.build/venv/bin/pot-create --config lingua-client.cfg --output mapbs/locale/mapbs-client.pot mapbs/templates/desktop.html mapbs/templates/mobile.html mapbs/templates/api/apihelp.html mapbs/templates/api/xapihelp.html mapbs/templates/match.html mapbs/templates/routing.html mapbs/templates/edit.html mapbs/templates/metadata.html mapbs/static-ngeo/js/mobile.js mapbs/static-ngeo/js/mapbsmodule.js mapbs/static-ngeo/js/desktop.js   mapbs/static-ngeo/components/contextualdata/contextualdata.html .build/config.yaml development.ini print/print-apps/mapbs/config.yaml
Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Error parsing ./mapbs/templates/mobile.html at line 6 column 74
Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Error parsing ./mapbs/templates/api/apihelp.html at line 15 column 45
Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Error parsing ./mapbs/templates/api/xapihelp.html at line 15 column 45
Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __call__
    exit()
  File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 124, in __call__
    template_adapter=MyTemplate
  File "/home/svavoi/mapbs/.build/venv/bin/bottle.py", line 3609, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/home/svavoi/mapbs/.build/venv/bin/bottle.py", line 3280, in render
    return self.tpl.render(**_defaults)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/mako/template.py", line 462, in render
    return runtime._render(self, self.callable_, args, data)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 873, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
    callable_(context, *args, **kwargs)
  File "__mapbs_templates_metadata_html", line 24, in render_body
AttributeError: 'Undefined' object has no attribute 'bezeichnung'

Traceback (most recent call last):
  File ".build/venv/bin/pot-create", line 11, in <module>
    sys.exit(main())
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/lingua/extract.py", line 330, in main
    for message in extractor(real_filename, options):
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 199, in __call__
    self.env = bootstrap(filename)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/pyramid/paster.py", line 131, in bootstrap
    app = get_app(config_uri, options=options)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/pyramid/paster.py", line 31, in get_app
    global_conf=options)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 203, in invoke
    app = context.app_context.create()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/home/svavoi/mapbs/mapbs/__init__.py", line 66, in main
    cube_engine = create_engine(settings.get('cube_connection').get('url'))
AttributeError: 'NoneType' object has no attribute 'get'
CONST_Makefile:701: recipe for target 'mapbs/locale/mapbs-client.pot' failed
make[1]: *** [mapbs/locale/mapbs-client.pot] Error 1
make[1]: Leaving directory '/home/svavoi/mapbs'
Traceback (most recent call last):
  File ".build/venv/bin/c2ctool", line 11, in <module>
    sys.exit(main())
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 98, in main
    c2ctool.upgrade()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 218, in upgrade
    self.step2()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 383, in step2
    self.step3()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 428, in step3
    self.step4()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 442, in step4
    check_call(["make", "-f", self.options.file, "build"])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-f', 'svavoi.mk', 'build']' returned non-zero exit status 2
CONST_Makefile:1248: recipe for target 'upgrade2' failed
make: *** [upgrade2] Error 1

My assumption is that the DB connections I defined in the __init__.py file are not valid anymore. Do I need to define them differently for GMF 2.x? https://github.com/camptocamp/baselstadt_mapbs/blob/GMF2x/mapbs/__init__.py#L42-L49

svavoi commented 7 years ago

Ok thanks. I made all group names unique and could finally finish step 2! :)

svavoi@bvdgdi-svdmbap3:~/mapbs$ make -f svavoi.mk upgrade2
.build/venv/bin/c2ctool upgrade  svavoi.mk --step 2
make[1]: Entering directory '/home/svavoi/mapbs'
sudo /usr/sbin/apache2ctl graceful
touch .build/apache.timestamp
make[1]: Leaving directory '/home/svavoi/mapbs'
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.

================================================================
The upgrade is nearly done, now you should:
- Test your application.
To continue type:
make -f svavoi.mk upgrade5

Now I want to test the application but get the following server errors:

http://bvdgdi-svdmbap3.bs.ch/svavoi/wsgi

WebError Traceback:
⇝ IndexError: list index out of range 

http://bvdgdi-svdmbap3.bs.ch/svavoi/admin

WebError Traceback:
⇝ AttributeError: 'unicode' object has no attribute 'role' 
sbrunner commented 7 years ago

Is it possible to provide a full stack?

svavoi commented 7 years ago

Entry of apache error Logfile:

[Wed Feb 22 17:19:52.212272 2017] [wsgi:error] [pid 31980] 2017-02-22 17:19:52,212 INFO  [sqlalchemy.engine.base.Engine][MainThread] ROLLBACK
[Wed Feb 22 17:19:52.302324 2017] [wsgi:error] [pid 31980] 2017-02-22 17:19:52,302 INFO  [sqlalchemy.engine.base.Engine][MainThread] BEGIN (implicit)
[Wed Feb 22 17:19:52.304774 2017] [wsgi:error] [pid 31980] /home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py:219: SAWarning: Unicode type received non-unicode bind param value 'source for image/png'. (this warning may be suppressed after 10 occurrences)
[Wed Feb 22 17:19:52.304811 2017] [wsgi:error] [pid 31980]   (util.ellipses_string(value),))
[Wed Feb 22 17:19:52.304962 2017] [wsgi:error] [pid 31980] 2017-02-22 17:19:52,304 INFO  [sqlalchemy.engine.base.Engine][MainThread] SELECT main.ogc_server.id AS main_ogc_server_id, main.ogc_server.name AS main_ogc_server_name, main.ogc_server.description AS main_ogc_server_description, main.ogc_server.url AS main_ogc_server_url, main.ogc_server.url_wfs AS main_ogc_server_url_wfs, main.ogc_server.type AS main_ogc_server_type, main.ogc_server.image_type AS main_ogc_server_image_type, main.ogc_server.auth AS main_ogc_server_auth, main.ogc_server.wfs_support AS main_ogc_server_wfs_support, main.ogc_server.is_single_tile AS main_ogc_server_is_single_tile
[Wed Feb 22 17:19:52.305029 2017] [wsgi:error] [pid 31980] FROM main.ogc_server
[Wed Feb 22 17:19:52.305161 2017] [wsgi:error] [pid 31980] WHERE main.ogc_server.name = %(name_1)s
[Wed Feb 22 17:19:52.305366 2017] [wsgi:error] [pid 31980] 2017-02-22 17:19:52,305 INFO  [sqlalchemy.engine.base.Engine][MainThread] {'name_1': 'source for image/png'}
[Wed Feb 22 17:19:52.345604 2017] [wsgi:error] [pid 31980] 2017-02-22 17:19:52,345 INFO  [sqlalchemy.engine.base.Engine][MainThread] ROLLBACK
[Wed Feb 22 17:19:52.346706 2017] [wsgi:error] [pid 31980] [remote 10.81.220.213:58422] Debug at: http://bvdgdi-svdmbap3.bs.ch/svavoi/wsgi/_debug/view/1487775662
WebError Traceback:
⇝ IndexError: list index out of range
View as:   Interactive  |  Text  |  XML (full)
URL: http://bvdgdi-svdmbap3.bs.ch/svavoi/wsgi
Module weberror.evalexception:429 in respond         view
>>  app_iter = self.application(environ, detect_start_response)
Module fanstatic.publisher:219 in __call__         view
>>  return self.app(environ, start_response)
Module fanstatic.injector:54 in __call__         view
>>  response = request.get_response(self.app)
Module webob.request:1299 in send         view
>>  application, catch_exc_info=False)
Module webob.request:1263 in call_application         view
>>  app_iter = application(self.environ, start_response)
Module pyramid.router:223 in __call__         view
>>  response = self.invoke_subrequest(request, use_tweens=True)
Module pyramid.router:198 in invoke_subrequest         view
>>  response = handle_request(request)
Module c2cgeoportal.lib.cacheversion:57 in __call__         view
>>  if path[1] in CACHE_PATH:
IndexError: list index out of range
WebError Traceback:
⇝ MakoRenderingException: Traceback (most recent call last): File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/pyramid_mako/__init__.py", line 148, in __call__ result = template.render_unicode(**system) File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode as_unicode=True) File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render **_kwargs_for_callable(callable_, data)) File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/mako/runtime.py", line 873, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template callable_(context, *args, **kwargs) File "/home/svavoi/mapbs/mapbs/templates/desktop.html", line 134, in render_body <script type="text/javascript" src="${request.route_url('desktop.js', _query=extra_params)}"></script> File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/pyramid/url.py", line 269, in route_url elements, kw = route.pregenerator(self, elements, kw) File "/home/svavoi/mapbs/.build/venv/lib/python2.7/site-packages/c2cgeoportal/lib/__init__.py", line 320, in __call__ query["username"] = request.user.username AttributeError: 'unicode' object has no attribute 'username'
View as:   Interactive  |  Text  |  XML (full)
URL: http://bvdgdi-svdmbap3.bs.ch/svavoi/wsgi/desktop
Module weberror.evalexception:429 in respond         view
>>  app_iter = self.application(environ, detect_start_response)
Module fanstatic.publisher:219 in __call__         view
>>  return self.app(environ, start_response)
Module fanstatic.injector:54 in __call__         view
>>  response = request.get_response(self.app)
Module webob.request:1299 in send         view
>>  application, catch_exc_info=False)
Module webob.request:1263 in call_application         view
>>  app_iter = application(self.environ, start_response)
Module pyramid.router:223 in __call__         view
>>  response = self.invoke_subrequest(request, use_tweens=True)
Module pyramid.router:198 in invoke_subrequest         view
>>  response = handle_request(request)
Module c2cgeoportal.lib.cacheversion:62 in __call__         view
>>  response = self.handler(request)
Module pyramid_debugtoolbar.toolbar:187 in toolbar_tween         view
>>  return handler(request)
Module pyramid.tweens:20 in excview_tween         view
>>  response = handler(request)
Module pyramid_tm:109 in tm_tween         view
>>  reraise(*exc_info)
Module pyramid_tm:88 in tm_tween         view
>>  response = handler(request)
Module pyramid.router:145 in handle_request         view
>>  view_name
Module pyramid.view:541 in _call_view         view
>>  response = view_callable(context, request)
Module c2cgeoportal.pyramid_:120 in new_f         view
>>  return f(root, request)
Module pyramid.config.views:377 in rendered_view         view
>>  context)
Module pyramid.renderers:450 in render_view         view
>>  return self.render_to_response(response, system, request=request)
Module pyramid.renderers:473 in render_to_response         view
>>  result = self.render(value, system_values, request=request)
Module pyramid.renderers:469 in render         view
>>  result = renderer(value, system_values)
Module pyramid_mako:156 in __call__         view
>>  reraise(MakoRenderingException(errtext), None, exc_info[2])
Module pyramid_mako:148 in __call__         view
>>  result = template.render_unicode(**system)
Module mako.template:471 in render_unicode         view
>>  as_unicode=True)
Module mako.runtime:838 in _render         view
>>  **_kwargs_for_callable(callable_, data))
Module mako.runtime:873 in _render_context         view
>>  _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
Module mako.runtime:899 in _exec_template         view
>>  callable_(context, *args, **kwargs)
Module _desktop_html:136 in render_body         view
Module pyramid.url:269 in route_url         view
>>  elements, kw = route.pregenerator(self, elements, kw)
Module c2cgeoportal.lib:320 in __call__         view
>>  query["username"] = request.user.username
ger-benjamin commented 7 years ago

(Internal information for debug purpose: here https://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/lib/cacheversion.py#L56 the request.path_info is "" )

sbrunner commented 7 years ago

I just apply the modification, then can you try again? thanks :-)

.build/venv/bin/pip uninstall transifex-client
.build/venv/bin/pip install git+https://github.com/sbrunner/transifex-client.git@authenticated-proxy
rm .build/locale/de/LC_MESSAGES/gmf.po
make -f svavoi.mk .build/locale/de/LC_MESSAGES/gmf.po
svavoi commented 7 years ago

I get the following error:

svavoi@bvdgdi-svdmbap3:~/mapbs$ .build/venv/bin/pip install git+https://github.com/sbrunner/transifex-client.git@authenticated-proxy
Collecting git+https://github.com/sbrunner/transifex-client.git@authenticated-proxy
  Cloning https://github.com/sbrunner/transifex-client.git (to authenticated-proxy) to /tmp/pip-gA7xJI-build
Requirement already satisfied: urllib3 in ./.build/venv/lib/python2.7/site-packages (from transifex-client==0.12.3)
Requirement already satisfied: six in ./.build/venv/lib/python2.7/site-packages (from transifex-client==0.12.3)
Installing collected packages: transifex-client
  Running setup.py install for transifex-client ... done
Successfully installed transifex-client-0.12.3
svavoi@bvdgdi-svdmbap3:~/mapbs$ rm .build/locale/de/LC_MESSAGES/gmf.po
svavoi@bvdgdi-svdmbap3:~/mapbs$ make -f svavoi.mk .build/locale/de/LC_MESSAGES/gmf.po
mkdir -p .build/locale/de/LC_MESSAGES/
.build/venv/bin/tx pull -l de --force
Traceback (most recent call last):
  File ".build/venv/bin/tx", line 11, in <module>
    load_entry_point('transifex-client==0.12.3', 'console_scripts', 'tx')()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/txclib/cmdline.py", line 10, in <module>
    from txclib import utils
  File "/home/svavoi/mapbs/.build/venv/local/lib/python2.7/site-packages/txclib/utils.py", line 114
    user-agent=user_agent_identifier(),
SyntaxError: keyword can't be an expression
CONST_Makefile:751: recipe for target '.build/locale/de/LC_MESSAGES/gmf.po' failed
make: *** [.build/locale/de/LC_MESSAGES/gmf.po] Error 1
sbrunner commented 7 years ago

Fixed, can you try again :-)

svavoi commented 7 years ago

Now it works. :-) Thanks!

sbrunner commented 7 years ago

Excellent, many thanks for your patience :-)

sbrunner commented 7 years ago

New pull request: https://github.com/transifex/transifex-client/pull/167