Kiwi icon indicating copy to clipboard operation
Kiwi copied to clipboard

Upgrade to 4.1.3 fails

Open xbln opened this issue 8 years ago • 8 comments

Description of problem

Upgrade of a perfectly working version 4.1.0 to 4.1.3 fails (kiwi_web stays in restarting loop)

root@docker-1gb-fra1-01:~/kiwi# docker-compose up Starting kiwi_db ... Starting kiwi_db ... done Starting kiwi_web ... Starting kiwi_web Attaching to kiwi_db, kiwi_web db_1 | 180322 16:29:36 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'. db_1 | 180322 16:29:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql web_1 | AH00526: Syntax error on line 34 of /etc/httpd/conf.d/kiwi-httpd.conf: web_1 | SSLCertificateFile: file '/etc/kiwitcms/ssl/localhost.crt' does not exist or is empty kiwi_web exited with code 1 ^CGracefully stopping... (press Ctrl+C again to force)

Steps to Reproduce

  1. Upgrade according to Upgrade Instructions: cd Kiwi/ docker-compose down docker pull kiwitcms/kiwi docker pull centos/mariadb docker-compose up -d

Actual results

kiwi_web stays in restarting loop

xbln avatar Mar 22 '18 16:03 xbln

Did you do git pull before docker-compose up ?

Post the docker-compose.yml file with which you see the failure!

atodorov avatar Mar 22 '18 17:03 atodorov

No, I did not perform a Git Pull. Docker Images are usually self containing and need no action like Git pull. Anyhow, there was no instruction to do so in the installation manual. The former image did all that without trouble. Compose file used is the standard file contained in Git without any modifications.

xbln avatar Mar 22 '18 18:03 xbln

post the contents of docker-compose.yml that reproduce the problem minus any passwords that you may have.

then try git pull and retry upgrading again, should fix the issue.

atodorov avatar Mar 22 '18 20:03 atodorov

My docker-compose file is https://github.com/kiwitcms/Kiwi/blob/master/docker-compose.yml

I reeally dont want to install all the git stuff on my host. Why should I perform a git pull? I want a plain docker installation. What´s wrong with that?

xbln avatar Mar 22 '18 22:03 xbln

No, I did not perform a Git Pull.

You need to, see explanation below.

Anyhow, there was no instruction to do so in the installation manual.

I will fix this, it's a genuine omission.

Docker Images are usually self containing and need no action like Git pull. I reeally dont want to install all the git stuff on my host. Why should I perform a git pull? I want a plain docker installation. What´s wrong with that?

There's nothing wrong with what you want but you fail to understand how Kiwi TCMS works and how it plays around with Docker.

You can't execute Kiwi TCMS alone by itself. It needs a database and SSL certificates files at the very least. This is not something we can bundle together into the kiwitcms/Kiwi docker image. That is why we use docker-compose to help us put together everything that we need.

docker-compose.yml is the file that controls how you put together a running Kiwi instance. It tells you what database backend to spin-up automatically, it configures your default DB password, it creates 2 separate data volumes (for DB and uploaded files) so that your data is not lost between upgrades and it also controls how SSL certiciates and HTTPD logs are mounted to/exposed from the running container.

This file is not part of the container image itself, it is an external configuration that lives in git and that's why you have to update it. The failure in the original comment points to this problem:

SSLCertificateFile: file '/etc/kiwitcms/ssl/localhost.crt' does not exist or is empty

that file doesn't exist because the older version of docker-compose.yml used to mount the SSL certificates differently.

We will try to point out changes to docker-compose.yml in the changelog but when they do happen you will have to refresh that file to match the latest.

As far as I know Docker doesn't provide a way to bundle the various pieces of a docker-compose together so that's how it works.

atodorov avatar Mar 23 '18 12:03 atodorov

I tested the upgrade today, but it failed with the last step. It seems there were some changed to the package recently. The same test 2 weeks ago did work well. Any suggestion? Thanks!

cd Kiwi/ git pull >>I used "git clone https://github.com/kiwitcms/Kiwi.git" instead as I did not use git command before docker-compose down docker pull kiwitcms/kiwi docker-compose up -d >> if I rum "docker ps -a", I can see the status as UP docker exec -it kiwi_web /Kiwi/manage.py migrate >>This step failed with error message as below:

[root@localhost Kiwi]# docker exec -it kiwi_web /Kiwi/manage.py migrate Traceback (most recent call last): File "/Kiwi/manage.py", line 12, in execute_from_command_line(sys.argv) File "/venv/lib/python3.5/site-packages/django/core/management/init.py", line 371, in execute_from_command_line utility.execute() File "/venv/lib/python3.5/site-packages/django/core/management/init.py", line 317, in execute settings.INSTALLED_APPS File "/venv/lib/python3.5/site-packages/django/conf/init.py", line 56, in getattr self._setup(name) File "/venv/lib/python3.5/site-packages/django/conf/init.py", line 43, in _setup self._wrapped = Settings(settings_module) File "/venv/lib/python3.5/site-packages/django/conf/init.py", line 106, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "/venv/lib64/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 658, in exec_module File "", line 764, in get_code File "", line 724, in source_to_code File "", line 222, in _call_with_frames_removed File "/venv/lib/python3.5/site-packages/tcms/settings/product.py", line 1 import os ^ IndentationError: unexpected indent

calvinmqc avatar May 10 '18 23:05 calvinmqc

docker pull kiwitcms/kiwi

that is in fact 4.1.4 now

File "/venv/lib/python3.5/site-packages/tcms/settings/product.py", line 1 import os ^ IndentationError: unexpected indent

there's no import os in our product.py if you have overriden this via docker-compose.yml or by other means just fix your config file.

atodorov avatar May 11 '18 07:05 atodorov

@atodorov You are right! This works if I remove the following entry. The reason I added it was just to enable email function.

         - ./product.py:/venv/lib64/python3.5/site-packages/tcms/settings/product.py:Z

Today I realize that I can enable email function by modify tcms/settings/common.py, and then add the following entry into the docker-compose.yml file. This way the revised version of common.py can be added into the container during setup. Although I am not very sure if I did this in the right way but the email function worked.

         - ./tcms/settings:/venv/lib64/python3.5/site-packages/tcms/settings:Z

Thanks a lot for checking my comment. Have a nice weekend!

calvinmqc avatar May 11 '18 15:05 calvinmqc