docker-otrs icon indicating copy to clipboard operation
docker-otrs copied to clipboard

Minor version upgrade

Open BelCo94 opened this issue 2 years ago • 6 comments

Files and modules are not upgraded when minor version upgrading, according to the instructions from README.md.

Image versions: 6.0.37 and 6.0.38

Upgrade is successful only if I manually create a file "current_version" in volume mounted to /opt/otrs/Kernel/ and put information about current version in it (6.0.37). After upgrade file contains new version (6.0.38).

I think the problem is the file "current_version" is being created and checked in different places by function load_defaults() in otrs/functions.sh:

line 254: local current_version_file="${OTRS_CONFIG_DIR}/current_version" line 273: echo ${current_version} > ${OTRS_ROOT}/current_version

docker-compose.yml

services:
  otrs:
    image: juanluisbaptiste/otrs:6.0.38
    ports:
      - '80:80'
    depends_on:
      - mariadb
    env_file: .env
    volumes:
      - './volumes/custom/Kernel:/opt/otrs/Custom/Kernel'
      - './volumes/config/Kernel:/opt/otrs/Kernel'
      - ./volumes/skins:/opt/otrs/var/httpd/htdocs/skins
      - ./backups:/var/otrs/backups
      - ./volumes/addons:/opt/otrs/addons
      - ./volumes/db_upgrade:/opt/otrs/db_upgrade
      - /etc/localtime:/etc/localtime:ro
      - ./volumes/log/otrs:/var/log/otrs
  mariadb:
    image: juanluisbaptiste/otrs-mariadb:latest
    expose:
      - "3306"
    env_file: .env
    volumes:
      - ./volumes/mysql:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro

.env

OTRS_DB_NAME=otrs
OTRS_DB_HOST=mariadb
OTRS_DB_PORT=3306
OTRS_DB_USER=otrs
OTRS_DB_PASSWORD=test

MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWORD=test

OTRS_INSTALL=no
OTRS_ROOT_PASSWORD=test
OTRS_HOSTNAME=otrs.test
OTRS_LANGUAGE=en
OTRS_TIMEZONE=UTC
OTRS_NUMBER_GENERATOR=AutoIncrement
OTRS_DEBUG=yes

OTRS_SENDMAIL_MODULE=SMTPS
OTRS_SMTP_SERVER=mail.test
OTRS_SMTP_PORT=587
OTRS_SMTP_USERNAME=otrs-sspk@test
OTRS_SMTP_PASSWORD=test

logs

otrs_1     | + load_defaults
otrs_1     | + local current_version_file=/opt/otrs/Kernel//current_version
otrs_1     | + '[' -e /opt/otrs/Kernel//current_version ']'
otrs_1     | [INFO] Starting  ((OTRS)) 6.0.38-01 Community Edition 
otrs_1     | 
otrs_1     | ++ cat /opt/otrs//RELEASE
otrs_1     | ++ grep VERSION
otrs_1     | ++ cut -d= -f2
otrs_1     | + current_version=' 6.0.38'
otrs_1     | + current_version=6.0.38
otrs_1     | + echo 6.0.38

BelCo94 avatar Nov 24 '21 14:11 BelCo94

Hi @BelCo94 , sorry for the late reply, I will try to look at this soon.

juanluisbaptiste avatar Apr 01 '22 15:04 juanluisbaptiste

@BelCo94 I can confirm the bug, looking into it.

juanluisbaptiste avatar Apr 01 '22 17:04 juanluisbaptiste

@BelCo94 fixed now, I will push again 6.0.40 images, but as the fix is present in this version onwards, upgrades from a previous version like 6.0.38 will need to be done manually as you did.

juanluisbaptiste avatar Apr 04 '22 20:04 juanluisbaptiste

@juanluisbaptiste Did you push that to anywhere? Seems the images 6.0.37 and 6.0.40 still have this error.

~~Idea: what about copying ${OTRS_ROOT}/current_version to ${OTRS_CONFIG_DIR}/current_version if this does not exist?~~ ~~I could make a PR for that if this is wanted.~~

(sorry for that confusion, this is not actually needed)

Ps. Oh no!

# docker run --entrypoint="" juanluisbaptiste/znuny:latest grep current_version /functions.sh
  local current_version_file="${OTRS_CONFIG_DIR}/current_version"
  if [ -e ${current_version_file} ] && [ ${OTRS_UPGRADE} != "yes" ]; then
    current_version=$(cat ${current_version_file})
    print_info "Current installed OTRS version: \e[1;31m$current_version\e[1;0m"
    check_version ${current_version} ${new_version}
      print_info "Doing minor version upgrade from \e[${OTRS_ASCII_COLOR_BLUE}m${current_version}\e[0m to \e[${OTRS_ASCII_COLOR_RED}m${new_version}\e[0m"
      echo ${new_version} > ${current_version_file}
    current_version=$(cat ${OTRS_ROOT}/RELEASE |grep VERSION|cut -d'=' -f2)
    current_version="${current_version## }"
  echo "${current_version}" > "${OTRS_CONFIG_DIR}/current_version"

seems this is the only image this has been fixed

rdxmb avatar May 30 '22 20:05 rdxmb

While testing issue #123 I found that previous fix was wrong, and it ended up overwriting the contents of /opt/otrs/Kernel/current_version after a minor version upgrade. I just pushed an updated 6.0.40 image.

juanluisbaptiste avatar Jun 01 '22 04:06 juanluisbaptiste

Sorry for the noise, I did some commit rebasing last night, I wasn't aware that these messages were going to be added again.

juanluisbaptiste avatar Aug 31 '22 15:08 juanluisbaptiste