camptocamp / c2cgeoportal

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

Error with pre-restore-database during upgrade #2844

Closed rbovard closed 7 years ago

rbovard commented 7 years ago

Project:

Running command: make -f instance_v2.mk upgrade4

Result:

.build/venv/bin/c2ctool upgrade  instance_v2.mk --step 4
make[1]: Entering directory 'v2'
.build/venv/bin/c2c-template --vars vars_nyon.yaml --engine mako --files CONST_create_template/deploy/hooks/pre-restore-database.mako
Traceback (most recent call last):
  File ".build/venv/bin/c2c-template", line 11, in <module>
    sys.exit(main())
  File "v2/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 213, in main
    _proceed(files, used_vars, options)
  File "v2/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 237, in _proceed
    bottle_template(files, used_vars, engine)
  File "v2/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 268, in bottle_template
    template, **used_vars
  File "v2/.build/venv/bin/bottle.py", line 3619, in template
    return TEMPLATES[tplid].render(kwargs)
  File "v2/.build/venv/bin/bottle.py", line 3290, in render
    return self.tpl.render(**_defaults)
  File "v2/.build/venv/local/lib/python2.7/site-packages/mako/template.py", line 462, in render
    return runtime._render(self, self.callable_, args, data)
  File "v2/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "v2/.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 "v2/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
    callable_(context, *args, **kwargs)
  File "CONST_create_template_deploy_hooks_pre_restore_database_mako", line 25, in render_body
TypeError: 'Undefined' object has no attribute '__getitem__'
CONST_Makefile:658: recipe for target 'CONST_create_template/deploy/hooks/pre-restore-database' failed
make[1]: *** [CONST_create_template/deploy/hooks/pre-restore-database] Error 1
make[1]: Leaving directory 'v2'
Traceback (most recent call last):
  File ".build/venv/bin/c2ctool", line 11, in <module>
    sys.exit(main())
  File "v2/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 100, in main
    c2ctool.upgrade()
  File "v2/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 231, in upgrade
    self.step4()
  File "v2/.build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py", line 452, 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', 'instance_v2.mk', 'build']' returned non-zero exit status 2
CONST_Makefile:1284: recipe for target 'upgrade4' failed
make: *** [upgrade4] Error 1

If no direct error, result and expected result:

rbovard commented 7 years ago

For information, the content of deploy/hooks is the same as in CONST_create_template/deploy/hooks.

rbovard commented 7 years ago

@sbrunner Do you have a workaround to bypass this error?

rbovard commented 7 years ago

I suspect one of those commits:

Do you test the upgrade since the last commit?

sbrunner commented 7 years ago

You also should get that: https://github.com/camptocamp/c2cgeoportal/blob/2.1/c2cgeoportal/scaffolds/create/vars_%2Bpackage%2B.yaml_tmpl#L142-L144

I should add it in the changelog :-)

rbovard commented 7 years ago

It's working, thanks.