camptocamp / c2cgeoportal

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

Error in step 4 during upgrade to 2.1.0rc4 #2642

Closed gnerred closed 7 years ago

gnerred commented 7 years ago

After doing the 4th step (make -f v2.mk upgrade4), I get the following error :

 - /layers/plan_ville_vevey_1986/dimensions/0: Cannot find required key 'generate'.
 - /layers/plan_ville_vevey_1986/dimensions/0: Key 'value' was not defined.
 - /layers/plan_ville_vevey_1993/dimensions/0: Cannot find required key 'generate'.
 - /layers/plan_ville_vevey_1993/dimensions/0: Key 'value' was not defined.
 - /layers/plan_ville_vevey_2000/dimensions/0: Cannot find required key 'generate'.
 - /layers/plan_ville_vevey_2000/dimensions/0: Key 'value' was not defined.
 - /layers/plan_ville_voirie/dimensions/0: Cannot find required key 'generate'.
 - /layers/plan_ville_voirie/dimensions/0: Key 'value' was not defined.
 - /layers/rayonnement_solaire_2012/dimensions/0: Cannot find required key 'generate'.
 - /layers/rayonnement_solaire_2012/dimensions/0: Key 'value' was not defined.
 - /layers/vevey_moyen_age/dimensions/0: Cannot find required key 'generate'.
 - /layers/vevey_moyen_age/dimensions/0: Key 'value' was not defined.
CONST_Makefile:1148: recipe for target 'apache/mapcache.xml' failed
make[1]: *** [apache/mapcache.xml] Error 1
make[1]: Leaving directory '/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish'
Traceback (most recent call last):
  File ".build/venv/bin/c2ctool", line 11, in <module>
    sys.exit(main())
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 98, in main
    c2ctool.upgrade()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 222, in upgrade
    self.step4()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.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', 'v2.mk', 'build']' returned non-zero exit status 2
CONST_Makefile:1256: recipe for target 'upgrade4' failed
make: *** [upgrade4] Error 1
sbrunner commented 7 years ago

You do this https://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/scaffolds/update/CONST_CHANGELOG.txt_tmpl#L176-L193? as I saw yes... then you also should change all the dimension from:

        -   name: DATE
            default: 2011
            value: 2011
            values: [2011]

to:

        -   name: DATE
            default: '2011'
            generate: '2011'
            values: ['2011']
gnerred commented 7 years ago

I already have that in my config.yaml.mako:

    dimensions:
        -   name: DATE
            # the default value for the WMTS capabilities
            default: "2011"
            # the generated value
            value: "2011"
            # all the available values in the WMTS capabilities
            values: ["2011"]

And the last 2.1 rc worked with that config

sbrunner commented 7 years ago

You miss: value => generate :-)

gnerred commented 7 years ago

Ok thanks, now I have that

    dimensions:
        -   name: DATE
            # the default value for the WMTS capabilities
            default: "2011"
            # the generated value
            generate: "2011"
            # all the available values in the WMTS capabilities
            values: ["2011"]

and the following error :

CONST_Makefile:1148: warning: overriding recipe for target 'apache/mapcache.xml'
cartoriviera.mk:18: warning: ignoring old recipe for target 'apache/mapcache.xml'
.build/venv/bin/c2ctool upgrade  v2.mk --step 4
make[1]: Entering directory '/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish'
CONST_Makefile:1148: warning: overriding recipe for target 'apache/mapcache.xml'
cartoriviera.mk:18: warning: ignoring old recipe for target 'apache/mapcache.xml'
.build/venv/bin/c2c-template --vars vars_prod_v2.yaml --engine mako --files tilegeneration/config.yaml.mako
.build/venv/bin/generate_controller --generate-mapcache-config
ERROR:tilecloud_chain:__init__:The config file 'tilegeneration/config.yaml' in invalid.
 - /caches/local/http_urls/0: Value 'https://preprod.cartoriviera.ch/tiles' does not match pattern '^https?://.+/$'.
CONST_Makefile:1148: recipe for target 'apache/mapcache.xml' failed
make[1]: *** [apache/mapcache.xml] Error 1
make[1]: Leaving directory '/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish'
Traceback (most recent call last):
  File ".build/venv/bin/c2ctool", line 11, in <module>
    sys.exit(main())
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 98, in main
    c2ctool.upgrade()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 222, in upgrade
    self.step4()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.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', 'v2.mk', 'build']' returned non-zero exit status 2
CONST_Makefile:1256: recipe for target 'upgrade4' failed
make: *** [upgrade4] Error 1
sbrunner commented 7 years ago

It still has a validation error in the 'tilegeneration/config.yaml':

ERROR:tilecloud_chain:__init__:The config file 'tilegeneration/config.yaml' in invalid.
 - /caches/local/http_urls/0: Value 'https://preprod.cartoriviera.ch/tiles' does not match pattern '^https?://.+/$'.

The concerned URL should ends with a / => https://preprod.cartoriviera.ch/tiles/

gnerred commented 7 years ago

Ok I have added a / in my config.yaml.mako (strange, it was not needed in previous rc...)

caches:
    local:
        type: filesystem
        folder: /var/sig/tilecache/cartoriviera
        wmtscapabilities_file: 1.0.0/WMTSCapabilities_${instanceid}.xml
        # for GetCapabilities
        # can includes %(folder)s comes from this cache
        http_urls: 
        - https://${host}/tiles/

Now I have the folowing error.... :

.build/venv/bin/generate_controller --generate-apache-config
.build/venv/bin/c2c-template --vars vars_prod_v2.yaml --engine mako --files print/templates/A0_landscape.mako
.build/venv/bin/c2c-template --vars vars_prod_v2.yaml --engine mako --files print/templates/A1_landscape.mako
.build/venv/bin/c2c-template --vars vars_prod_v2.yaml --engine mako --files print/templates/A4_portrait.mako
.build/venv/bin/c2c-template --vars vars_prod_v2.yaml --engine mako --files print/templates/A4_portrait_inherit.mako
Traceback (most recent call last):
  File ".build/venv/bin/c2c-template", line 11, in <module>
    sys.exit(main())
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 213, in main
    _proceed(files, used_vars, options)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 237, in _proceed
    bottle_template(files, used_vars, engine)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 268, in bottle_template
    template, **used_vars
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/bin/bottle.py", line 3609, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/bin/bottle.py", line 3280, in render
    return self.tpl.render(**_defaults)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/mako/template.py", line 462, in render
    return runtime._render(self, self.callable_, args, data)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 872, in _render_context
    (inherit, lclcontext) = _populate_self_namespace(context, tmpl)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 814, in _populate_self_namespace
    ret = template.module._mako_inherit(template, context)
  File "print_templates_A4_portrait_inherit_mako", line 25, in _mako_inherit
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 771, in _inherit_from
    template = _lookup_template(context, uri, calling_uri)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 804, in _lookup_template
    raise exceptions.TemplateLookupException(str(compat.exception_as()))
mako.exceptions.TemplateLookupException: Cant locate template for uri u'/A4_portrait.mako'
CONST_Makefile:650: recipe for target 'print/templates/A4_portrait_inherit' failed
make[1]: *** [print/templates/A4_portrait_inherit] Error 1
make[1]: Leaving directory '/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish'
Traceback (most recent call last):
  File ".build/venv/bin/c2ctool", line 11, in <module>
    sys.exit(main())
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 98, in main
    c2ctool.upgrade()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 222, in upgrade
    self.step4()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.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', 'v2.mk', 'build']' returned non-zero exit status 2
CONST_Makefile:1256: recipe for target 'upgrade4' failed
make: *** [upgrade4] Error 1
sbrunner commented 7 years ago

Good step :-)

Strange, The error is at line https://github.com/camptocamp/cartoriviera_geomapfish/blob/master/print/templates/A4_portrait_inherit.mako#L3 Can you try if the templat includ wir with one of them?

gnerred commented 7 years ago

I tried without the first slash and it is OK for that error. Now I have the following error. It tries to set to not null a column that contains null values... Do I have to run BD migration manually before ?

INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade ee25d267bf46 -> e004f76e951a, Add missing not null
Traceback (most recent call last):
  File ".build/venv/bin/c2ctool", line 11, in <module>
    sys.exit(main())
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 98, in main
    c2ctool.upgrade()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 222, in upgrade
    self.step4()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 444, in step4
    command.upgrade(Config("alembic.ini"), "head")
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
    script.run_env()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/script/base.py", line 407, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    module = load_module_py(module_id, path)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "CONST_alembic/main/env.py", line 110, in <module>
    run_migrations_online()
  File "CONST_alembic/main/env.py", line 102, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/runtime/migration.py", line 312, in run_migrations
    step.migration_fn(**kw)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/CONST_alembic/main/versions/e004f76e951a_add_missing_not_null.py", line 51, in upgrade
    op.alter_column('layer_wmts', 'image_type', nullable=False, schema=schema)
  File "<string>", line 8, in alter_column
  File "<string>", line 3, in alter_column
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/operations/ops.py", line 1420, in alter_column
    return operations.invoke(alt)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/operations/base.py", line 318, in invoke
    return fn(self, operation)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/operations/toimpl.py", line 53, in alter_column
    **operation.kw
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/ddl/postgresql.py", line 105, in alter_column
    **kw)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/ddl/impl.py", line 145, in alter_column
    existing_nullable=existing_nullable,
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/alembic/ddl/impl.py", line 118, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1002, in _execute_ddl
    compiled
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1393, in _handle_dbapi_exception
    exc_info
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 462, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) column "image_type" contains null values
 [SQL: 'ALTER TABLE main.layer_wmts ALTER COLUMN image_type SET NOT NULL']
CONST_Makefile:1256: recipe for target 'upgrade4' failed
sbrunner commented 7 years ago

No that just mean that you have some WMTS layers without any image_type, and it's no more allowed...

gnerred commented 7 years ago

OK. So I have added an "image_type" for all WMTS layers in my 1.6 database, and I have run a DB migration again. When I run the command .build/venv/bin/themev1tov2 , I get the error below, but all WMTS layers in table layerv1 have a value for "url" attribute. Is there a problem with .build/venv/bin/themev1tov2 ? Why is he trying to insert a NULL value for "url" in table layer_wmts ?

in do_execute

    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (psycopg2.IntegrityError) **null value in column "url" violates not-null constraint**
DETAIL:  Failing row contains (654, null, null, null, null, image/png).
 [SQL: 'INSERT INTO main.layer_wmts (id, url, layer, style, matrix_set, image_type) VALUES (%(id)s, %(url)s, %(layer)s, %(style)s, %(matrix_set)s, %(image_type)s)'] [parameters: {'layer': None, 'image_type': 'image/png', 'style': None, 'url': None, 'matrix_set': None, 'id': 654}]
sbrunner commented 7 years ago

sqlalchemy commit the layer in a place that I don't suspect to be commited... Than we should fix the themev1tov2 script...

gnerred commented 7 years ago

Ok, so I wait your correction to go ahead with rc4 installation...

gnerred commented 7 years ago

Could you please indicate more or less when the themev1tov2 script will be fixed ? Thanks

sbrunner commented 7 years ago

During the next week :-)

gnerred commented 7 years ago

Ok thanks...

rbovard commented 7 years ago

Silly question: When sould we run the themev1tov2 script during the upgrade process?

sbrunner commented 7 years ago

@rbovard When the upgrade is finish, to have some data in the ngeo applications.

gnerred commented 7 years ago

Now the step 4 of upgrade is done. But I have an error in step 5... :

 make -f v2.mk upgrade5
CONST_Makefile:1148: warning: overriding recipe for target 'apache/mapcache.xml'
cartoriviera.mk:18: warning: ignoring old recipe for target 'apache/mapcache.xml'
.build/venv/bin/c2ctool upgrade  v2.mk  --step 5
================================================================
Checker error:
Open `http://preprod.cartoriviera.ch/v2/wsgi/check_collector?` for more informations.

Correct the checker, the step 5 again:
make -f v2.mk upgrade5
CONST_Makefile:1260: recipe for target 'upgrade5' failed
make: *** [upgrade5] Error 1
rbovard commented 7 years ago

@sbrunner Ok, so if we stay with cgxp interface we don't need to run it? (Sorry for the cross posting here)

gnerred commented 7 years ago

You need to run it to make work your ngeo mobile interface...

rbovard commented 7 years ago

Ok, so we need to maintain 2 kinds of layers if we keep cgxp?

sbrunner commented 7 years ago

@gnerred had you read the message? (after the ===== line)

gnerred commented 7 years ago

Yes... there is a problem with print and FTS... The solutions ?

sbrunner commented 7 years ago

First, you have an indentation issue in your vars file, you have:

    checker:
        defaults:
            lang_files: [cgxp]
        #lang_files: [cgxp, cgxp-api]
        print_template: 1) A4 portrait
        print_center_lon: 554302
        print_center_lat: 145654
        print_scale: 10000
        defaults:
            routes_disable: []
            fulltextsearch: text to search
            print_spec:
                layout: "1 A4 portrait"
                outputFormat: "pdf"
                attributes:
                    title: ""
                    comments: ""
                    datasource: []
                    map:
                        projection: "EPSG:21781"
                        dpi: 254 
                        rotation: 0
                        center: [600000, 200000]
                        scale: 100000
                        longitudeFirst: true
                        layers: []
                    legend: {}

And it should be:


    checker:
        defaults:
            lang_files: [cgxp]
            #lang_files: [cgxp, cgxp-api]
            print_template: 1) A4 portrait
            print_center_lon: 554302
            print_center_lat: 145654
            print_scale: 10000            routes_disable: []
            fulltextsearch: text to search
            print_spec:
                layout: "1 A4 portrait"
                outputFormat: "pdf"
                attributes:
                    title: ""
                    comments: ""
                    datasource: []
                    map:
                        projection: "EPSG:21781"
                        dpi: 254 
                        rotation: 0
                        center: [600000, 200000]
                        scale: 100000
                        longitudeFirst: true
                        layers: []
                    legend: {}
sbrunner commented 7 years ago

The fulltextsearch: text to search should be filled with something that get a result :-)

sbrunner commented 7 years ago

In the vars file you should set print_url: http://localhost:8080/print-{instanceid}/pdf

gnerred commented 7 years ago

Ok I set that in my vars file and I fixed the identation :

print_url: http://localhost:8080/print-{instanceid}/pdf (there was a final slash before)

and

fulltextsearch: "1234"

Then I run make -f v2.mk upgrade5 and I get the same error... I did a graceful. Do I have to run something else to "activate" these modifications of my vars file ?

gnerred commented 7 years ago

I just did a normal build, and now I have no more problem with FTS, but I still have an error with print :

https://preprod.cartoriviera.ch/v2/wsgi/check_collector?

sbrunner commented 7 years ago

I have modified your var file, than I hope that's OK :-)

gnerred commented 7 years ago

I still have errors in the checker : https://preprod.cartoriviera.ch/v2/wsgi/check_collector?

When I build, I also get the errors below. The line in question is the same in my files than in the CONST_create_template files... :

Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Error parsing ./cartoriviera/templates/mobile.html at line 6 column 74
Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Error parsing ./cartoriviera/templates/api/xapihelp.html at line 15 column 45
Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Error parsing ./cartoriviera/templates/api/apihelp.html at line 15 column 45
Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

Traceback (most recent call last):
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/lib/lingua_extractor.py", line 126, in __ca ll__
    exit()
  File "/var/www/vhosts/cartoriviera_preprod/private/cartoriviera_geomapfish_v2/cartoriviera_geomapfish/.build/venv/lib/python2.7/site.py", line 403, in __call__
    raise SystemExit(code)
SystemExit: None

No handlers could be found for logger "c2cgeoportal.pyramid_"
sbrunner commented 7 years ago

For the first I just edit your vars_cartoriviera.yaml to fix the routes checked by phantomjs :-)

sbrunner commented 7 years ago

The second will be fixed by https://github.com/camptocamp/c2cgeoportal/pull/2658...

gnerred commented 7 years ago

Okay thanks. And the error 500 in https://preprod.cartoriviera.ch/v2/wsgi/check_collector? ?

rbovard commented 7 years ago

@sbrunner Is it possible to show what you edited in the vars file, I have the same issues here. Thanks.

https://github.com/camptocamp/c2cgeoportal/issues/2642#issuecomment-262197849 https://github.com/camptocamp/c2cgeoportal/issues/2642#issuecomment-261507463

sbrunner commented 7 years ago

Ok, so we need to maintain 2 kinds of layers if we keep cgxp?

If you modify the new table (OGCServer, LayerWMS, LayerWMTS) yes, If you don't needs to modify them, you can maintain the LayerV1 and run the themev2tov2 again and again.

rbovard commented 7 years ago

Thanks for the tip, I'll do that!

sbrunner commented 7 years ago

@rbovard => :

checker:
  ...
  defaults:
    ...
    phantomjs_routes:
    - name: mobile
      query:
        no_redirext: true
  all:
    ...
    phantomjs_routes:
    - name: mobile
      query:
        no_redirect: true
    - name: mobile
      query:
        no_redirect: true
        debug: true

This is to disable the check make for ngeo on the cgxp interface and for the printv3.

sbrunner commented 7 years ago

I should add it in the changelog...

sbrunner commented 7 years ago

@gnerred You should add printproxy_capabilities in checker:defaults:routes_disable and in checker:all:routes_disable.

gnerred commented 7 years ago

Thanks @sbrunner, now my steps 5 and 6 ran without error :O)

gnerred commented 7 years ago

@sbrunner, could you please tell me in which issue is located the problem with the script themev1tov2 ?