Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor version upgrade #118

Open
BelCo94 opened this issue Nov 24, 2021 · 6 comments
Open

Minor version upgrade #118

BelCo94 opened this issue Nov 24, 2021 · 6 comments
Labels

Comments

@BelCo94
Copy link

BelCo94 commented Nov 24, 2021

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
@juanluisbaptiste
Copy link
Owner

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

@juanluisbaptiste
Copy link
Owner

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

@juanluisbaptiste
Copy link
Owner

@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.

@rdxmb
Copy link
Contributor

rdxmb commented May 30, 2022

@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

juanluisbaptiste added a commit that referenced this issue Jun 1, 2022
@juanluisbaptiste
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants