Problems with upgrade

HI,

when trying update Kobo Toolbox using run.py (3fe3247) this error occurs:

kobo@acf-kobo2:~/kobo-install$ ./run.py --update
HEAD is now at 914e209... Upgrade KPI to 2.020.24b
From https://github.com/kobotoolbox/kobo-docker
 * tag               2.020.24b  -> FETCH_HEAD
KoBoToolbox has been updated
From https://github.com/kobotoolbox/kobo-install
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
        conftest.py
        helpers/aws_validation.py
        helpers/updater.py
        requirements_tests.txt
        templates/kobo-docker/docker-compose.backend.primary.override.yml.tpl
        templates/kobo-docker/docker-compose.backend.secondary.override.yml.tpl
        templates/kobo-env/enketo_express/config.json.tpl
        templates/kobo-env/envfile.txt.tpl
        templates/kobo-env/envfiles/aws.txt.tpl
        templates/kobo-env/envfiles/databases.txt.tpl
        templates/kobo-env/envfiles/enketo.txt.tpl
        templates/kobo-env/envfiles/external_services.txt.tpl
        templates/kobo-env/envfiles/kobocat.txt.tpl
        templates/kobo-env/envfiles/kpi.txt.tpl
        templates/kobo-env/envfiles/nginx.txt.tpl
        templates/kobo-env/envfiles/smtp.txt.tpl
        templates/kobo-env/postgres/primary/postgres.conf.tpl
        templates/kobo-env/postgres/secondary/postgres.conf.tpl
        tests/test_run.py
        tests/utils.py
Please move or remove them before you merge.
Aborting
Updating 3fe3247..5c65526
An error has occurred

What are we doing wrong and how to rectify this?

Thanks
Vladimir

@maric.vladimir, maybe this post discussed previously should help you solve your issue:

Hi Kal,

thanks, but it did not help. I followed different instructions from that post - to no avail.

I tried cloning the last version of kobo-install, and now I am getting the following:

kobo@acf-kobo2:~/kobo-install$ ./run.py --update
Traceback (most recent call last):
  File "./run.py", line 16, in <module>
    from helpers.command import Command
  File "/home/kobo/kobo-install/helpers/command.py", line 8, in <module>
    from helpers.config import Config
  File "/home/kobo/kobo-install/helpers/config.py", line 14, in <module>
    from helpers.aws_validation import AWSValidation
  File "/home/kobo/kobo-install/helpers/aws_validation.py", line 51
    [f'host:{self.HOST}', f'x-amz-date:{amzdate}', '']
                       ^
SyntaxError: invalid syntax

Any ideas please?

Thanks,
Vladimir
`

Do git stash before running the upgrade.

1 Like

Thanks for your answer. It makes some progress, but finally it fails.

Firstly, there is an issue with output format (on freshest debian), so I had to run

 /bin/bash -c "PYTHONIOENCODING=utf8 PATH='/usr/local/bin:/usr/bin:/bin' /home/kobo/kobo-install/run.py --upgrade"

…to get around the first obstacle. That might have to do with system config though.

Upgrade process started well and went through a number of questions, as expected, but at the end:

Redis backup schedule?
[0 23 * * *]:
Traceback (most recent call last):
  File "/home/kobo/kobo-install/run.py", line 65, in <module>
    elif sys.argv[1] == '--upgrade':
  File "/home/kobo/kobo-install/helpers/command.py", line 490, in update
    def version(cls):
  File "/home/kobo/kobo-install/helpers/template.py", line 73, in render
    cls.__write_templates(template_variables,
  File "/home/kobo/kobo-install/helpers/template.py", line 291, in __write_templates
    'REDIS_PASSWORD_JS_ENCODED': json.dumps(
  File "/usr/lib/python3.5/string.py", line 129, in substitute
    return self.pattern.sub(convert, self.template)
  File "/usr/lib/python3.5/string.py", line 119, in convert
    val = mapping[named]
KeyError: 'PRIMARY_BACKEND_IP'

Like we are inching towards the solution… So please advise - how to proceed with this?

Many thanks!

Did you manage to solve this?
Any reason that you need to use Debian?

No, the problem is not solved. Our service provider insists on Debian, that is the only reason.

Which Linux do you suggest we use, and which distribution / version?

Thanks.

Try using Ubuntu, I think you won’t face issues with it.

1 Like