upgrade from 16.1.3 to 16.3.0

Ask your questions regarding TimeTrex installation here.
Post Reply
hal9008
Posts: 10
Joined: Tue Nov 30, 2021 3:45 pm

upgrade from 16.1.3 to 16.3.0

Post by hal9008 »

Hello.

Since some weeks I notice that the time trex installation is given me this notification.

"TimeTrex automatic upgrade has failed due to a system error! Please contact your TimeTrex administrator immediately to re-run the TimeTrex installer to correct the issue"

Now i want to solve this trouble.

The actual installation of TimeTrex is working without problems. My system is:

- Ubuntu 20.04 server (virtualized in proxmox - I have snapshots, so i can make experiments with the installation).
- PHP 7.4.3
- psql (PostgreSQL) 12.13 (Ubuntu 12.13-0ubuntu0.20.04.1)

This system only runs the timetrex installation (there isn't any other programs running on it)

I suppose that the automatic installer may update the requeriments if it's needed. I tried to do this.

hal9008@fichador:/usr/share/timetrex/html/maint$ sudo -u www-data php ./AutoUpgrade.php

But this command brings me the following message.

New version available, collecting data to download...
ERROR: Unable to download upgrade file at this time, please try again later...

If I download the .deb manually it tells me that the php version is not correct instead of automatically installing the necessary dependencies.

Before this problem the updates had been done perfectly.

I have tried upgrading ubuntu 20.04 to 22.04 but it seems that upgrading the OS breaks the timetrex installation.

Any idea how to resolve this issue? The current installation works fine, but I don't like having outdated software, especially when my installation is available over the internet.
mikeb
Posts: 709
Joined: Thu Jul 27, 2006 11:58 am

Re: upgrade from 16.1.3 to 16.3.0

Post by mikeb »

TimeTrex requires PHP v8.0 or newer, since you are running v7.4, automatic updates are failing. Using the .deb will not install dependencies that are not available on your Ubuntu version.

Therefore you will need to manually upgrade to PHP v8.0 using 3rd party .deb repos, or update your Ubuntu to 22.04 which comes with PHP v8.1.
TimeTrex Community Edition is developed and supported by volunteers.
Help motivate us to continue by showing your appreciation!
hal9008
Posts: 10
Joined: Tue Nov 30, 2021 3:45 pm

Re: upgrade from 16.1.3 to 16.3.0

Post by hal9008 »

I still have troubles with this.

I updated php version to 8.2. If I run the installer i get the following messages.

Code: Select all

root@fichador:/home/marcosms/descargas# dpkg -i TimeTrex_Community_Edition.deb
(Leyendo la base de datos ... 121656 ficheros o directorios instalados actualmen                                                                                                             te.)
Preparando para desempaquetar TimeTrex_Community_Edition.deb ...
Desempaquetando timetrex-community-edition (16.3.2) sobre (12.7.3) ...
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/webmozart/assert/src': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/webmozart/assert': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/webmozart': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/phpdocumentor/type-resolver/src/Types': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/phpdocumentor/type-resolver/src/PseudoTypes': El directorio no está va                                                                                                             cío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/phpdocumentor/type-resolver/src': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/phpdocumentor/type-resolver': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/phpdocumentor/reflection-common': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/phpdocumentor': El directorio no está vacío
dpkg: atención: no se puede borrar el directorio antiguo `/usr/share/timetrex/ht                                                                                                             ml/vendor/pear/mail_mime/tests': El directorio no está vacío
Configurando timetrex-community-edition (16.3.2) ...

Fichero de configuración `/usr/share/timetrex/html/timetrex.ini.php'
 ==> Fichero en el sistema creado por usted o por algún script.
 ==> Fichero también en el paquete.
   ¿Qué quisiera hacer al respecto?  Sus opciones son:
    Y o I  : instalar la versión del desarrollador del paquete
    N o O  : conservar la versión que tiene instalada actualmente
      D    : mostrar las diferencias entre versiones
      Z    : ejecutar un intérprete de órdenes para examinar la situación
 La acción por omisión es conservar la versión actual.
*** timetrex.ini.php (Y/I/N/O/D/Z) [por omisión=N] ?
Upgrading TimeTrex database...
Force Mode enabled...
ERROR: System requirements are not satisfied, or a new version exists!
dpkg: error al procesar el paquete timetrex-community-edition (--install):
 el subproceso instalado paquete timetrex-community-edition script post-installa                                                                                                             tion devolvió el código de salida de error 1
Se encontraron errores al procesar:
 timetrex-community-edition
root@fichador:/home/marcosms/descargas#
¿System requirements are not satisfied? What's wrong?

a "php -v" shows me the following.

Code: Select all

root@fichador:/home/marcosms/descargas# php -v
PHP 8.2.3 (cli) (built: Feb 14 2023 16:57:50) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.3, Copyright (c), by Zend Technologies
root@fichador:/home/marcosms/descargas#
Update-alternatives shows me the following.

Code: Select all

root@fichador:/home/marcosms/descargas# sudo update-alternatives --config php
Existen 2 opciones para la alternativa php (que provee /usr/bin/php).

  Selección   Ruta             Prioridad  Estado
------------------------------------------------------------
* 0            /usr/bin/php8.2   82        modo automático
  1            /usr/bin/php7.4   74        modo manual
  2            /usr/bin/php8.2   82        modo manual

Pulse <Intro> para mantener el valor por omisión [*] o pulse un número de selección:
(so php8.2 is enabled)

If i edit timetrex.ini.php and set installer_enabled = true and i go to https://myweb.com/timetrex/interface/in ... nstall.php i can see this message.

Code: Select all

Checking pre-flight requirements... 1... 2... 3... 4...You are currently using PHP v8.2.3 TimeTrex requires PHP v8.1.x or earlier!

5... 6... 7... 9... 10... FAILED!

For installation support, please join our community forums or contact a TimeTrex support expert for Implementation Support Services. 
While i'm doing this, a mail was sent to me with the following text.

Code: Select all

TimeTrex application version (16.3.2) does not match database version (16.1.3). Please re-run the TimeTrex web installer to complete the upgrade process.
But i can't run the installer to solve the problem. I'm very confused with this troubles. ¿Any idea about how to solve it?
hal9008
Posts: 10
Joined: Tue Nov 30, 2021 3:45 pm

Re: upgrade from 16.1.3 to 16.3.0

Post by hal9008 »

I deleted PHP7.4 so in my linux installation i only have php8.2.

I think that the following information is important.

Code: Select all

root@fichador:/usr/share/timetrex/html/maint# sudo -u www-data php ./AutoUpgrade.php
ERROR: Current system requirements check failed...
  Failed Requirements: Require,PHPVersion
root@fichador:/usr/share/timetrex/html/maint
WHAT?¿?¿? the php version is still wrong? Now i only have 8.1!! See:

Code: Select all

marcosms@fichador:~$ sudo update-alternatives --config php
Sólo hay una alternativa en el grupo de enlaces php (provee /usr/bin/php): /usr/bin/php8.2
Nada que configurar.
marcosms@fichador:~$
I'm very confused with this trouble.
hal9008
Posts: 10
Joined: Tue Nov 30, 2021 3:45 pm

Re: upgrade from 16.1.3 to 16.3.0

Post by hal9008 »

mmmm.. I can see the following in the logs.

Code: Select all

[P0008619] [02084ms] [L1012]: Install::checkPHPVersion(): Comparing with Version: 8.2.3
[P0008619] [02084ms] [L1671]: Install::checkDiskSpace(): Free Space: 10626621440 Free Percent: 50.705707971209
[P0008619] [02085ms] [L1608]: Install::checkPHPOpenBaseDir(): Open BaseDir: 
[P0008619] [02085ms] [L3243]: Misc::getCurrentOSUser(): Running as OS User: www-data
[P0008619] [02085ms] [L1240]: Install::checkFilePermissions(): Checking directory readable/writable: /usr/share/timetrex/html Random Num: 115
[P0008619] [02102ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 1000 Current File: /usr/share/timetrex/html/vendor/phar-io/manifest/src/values/Extension.php
[P0008619] [02121ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 2000 Current File: /usr/share/timetrex/html/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php
[P0008619] [02138ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 3000 Current File: /usr/share/timetrex/html/vendor/pear/pear/tests/PEAR_Command_Pickle/pickle/packagefiles/http/http_info_api.c
[P0008619] [02156ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 4000 Current File: /usr/share/timetrex/html/vendor/pear/pear/tests/PEAR_Installer/packages/foobar.xml
[P0008619] [02174ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 5000 Current File: /usr/share/timetrex/html/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php
[P0008619] [02193ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 6000 Current File: /usr/share/timetrex/html/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php
[P0008619] [02210ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 7000 Current File: /usr/share/timetrex/html/classes/modules/api/company/APIWageGroup.class.php
[P0008619] [02229ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 8000 Current File: /usr/share/timetrex/html/interface/html5/framework/widgets/color-picker/colors.js
[P0008619] [02253ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 9000 Current File: /usr/share/timetrex/html/interface/html5/theme/default/images/empty_bg.png
[P0008619] [02269ms] [L1301]: Install::checkFilePermissions():   Batch Completed: 10000 Current File: /usr/share/timetrex/html/interface/html5/dist/portal-sign_in-PortalResetForgotPasswordController.bundle.js
[P0008619] [02274ms] [L1324]: Install::checkFilePermissions():   Done Checking directory readable/writable: /usr/share/timetrex/html
[P0008619] [02274ms] [L1240]: Install::checkFilePermissions(): Checking directory readable/writable: /var/cache/timetrex Random Num: 126
[P0008619] [02277ms] [L1324]: Install::checkFilePermissions():   Done Checking directory readable/writable: /var/cache/timetrex
[P0008619] [02277ms] [L1240]: Install::checkFilePermissions(): Checking directory readable/writable: /var/log/timetrex Random Num: 76
[P0008619] [02277ms] [L1324]: Install::checkFilePermissions():   Done Checking directory readable/writable: /var/log/timetrex
[P0008619] [02277ms] [L1240]: Install::checkFilePermissions(): Checking directory readable/writable: /var/lib/timetrex/storage Random Num: 91
[P0008619] [02278ms] [L1324]: Install::checkFilePermissions():   Done Checking directory readable/writable: /var/lib/timetrex/storage
[P0008619] [02278ms] [L1334]: Install::checkFilePermissions(): All Files/Directories (10529) are readable/writable! Files Checked: 10529/10529(100%) in: 0s
[P0008619] [02278ms] [L0765]: GLOBAL: ERROR: Current system requirements check failed...
[P0008619] [02278ms] [L0766]: GLOBAL:   Failed Requirements: Require,PHPVersion
[P0008619] [02278ms] [L3236]: Factory::StartTransaction(): StartTransaction(): Transaction: Count: 0 Off: 0 OK: 0
[P0008619] [02278ms] [L3414]: Factory::isValid(): Calling Validate() of: SystemSettingListFactory
[P0008619] [02278ms] [L0062] Array: SystemSettingFactory::isUniqueName(): Unique Name: auto_upgrade_failed
string(36) "05c2dd81-32a3-d3d5-bb98-08a47a9b633b"
I think the key is here

Code: Select all

[P0008619] [02278ms] [L0765]: GLOBAL: ERROR: Current system requirements check failed...
[P0008619] [02278ms] [L0766]: GLOBAL:   Failed Requirements: Require,PHPVersion
The requeriments are packages named "require" and "PHPVersion"? Perhaps it's a bug? The PHP Version, as you can see in the previous posts, is right.
hal9008
Posts: 10
Joined: Tue Nov 30, 2021 3:45 pm

Re: upgrade from 16.1.3 to 16.3.0

Post by hal9008 »

Problem solved. I think that i was using php8.1 but really i were using php8.2 and Timetrex isn't compatible with 8.2.

So What i did was:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get dist-upgrade
sudo apt-get install php8.0
sudo update-alternatives --config php --> I put php8.0 as default php for the system
sudo apt-get install php8.0-cgi php8.0-cli php8.0-pgsql php8.0-pspell php8.0-gd php8.0-gettext php8.0-imap php8.0-intl php8.0-soap php8.0-zip php8.0-curl php8.0-ldap php8.0-xml php8.0-xsl php8.0-mbstring php8.0-bcmath
sudo a2dismod php7.4
sudo a2dismod php8.2
sudo a2enmod php8.0
sudo systemctl restart apache2
cd /usr/share/timetrex/html/maint
sudo -u www-data php AutoUpgrade.php

But... I think that all this scripts must be in the installer, isn't it?
Post Reply