glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.26k stars 1.29k forks source link

Database issue in migration of update to 10.0.12 #17518

Closed NoxWorld2660 closed 3 months ago

NoxWorld2660 commented 3 months ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.9

Bug description

System Situation :

I run GLPI with Apache 2.4 ; PHP 8.2.10 ; on a Windows Server 2019 ; Database is on the localhost with a MySQL 8

Bug :

When upgrading from GLPI 10.0.9 to GLPI 10.0.16 i have a crash when migating DB at the step where i go from 10.0.11 to 10.0.12 , see the image in attachment in the section with "BEFORE".

The error i have seems totally ridiculous. I tried to make a fresh install of GLPI 10.0.16 and i don't have a column "field" in the "glpi_tickettemplatehiddenfields" table. After digging into the code it seems the problem is coming from this file : "D:\www\glpi-fresh-10-0-16\install\migrations\update_10.0.11_to_10.0.12\duplicate_searchop_fixes.php" I don't understand where the table name and fields are coming, but that's probably the issue. Maybe it's related to MySQL 8 specifically ?

When upgrading through web browser, i have the exact same issue & error.

Workaround :

I renamed this file in ".crap" so it's ignored by the migration. After that it works, see Attachment with "AFTER". However i don't know if i will experience bug after since i don't exactly get what this migration step does ? If anyone can tell me what SQL i can eventually execute manually to make sure i don't have any bug regarding research ?

So after that, i successfully upgraded to v10.0.16 but i am not very confident since i skipped a step of the migration to v10.0.12.

image (4)

Relevant log output

No response

Page URL

No response

Steps To reproduce

  1. Make a fresh install of GLPI v10.0.9 , with Apache 2.4 ; PHP 8.2.10 ; on a Windows Server 2019 ; Database is on the localhost with a MySQL 8 DBMS
  2. Migrate your GLPI from v10.0.9 to any version of GLPI >= 10.0.12
  3. Enjoy

Your GLPI setup information

Informations sur le système, l'installation et la configuration
GLPI 10.0.16 ( => D:\www\glpi-fresh-10-0-16)
Installation mode: TARBALL
Current language:fr_FR

Server
 
Operating system: Windows NT STXXXXV 10.0 build 17763 (Windows Server 2019) AMD64
PHP 8.2.10 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bcmath, bz2, calendar,
    ctype, curl, date, dom, exif, fileinfo, filter, gd, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl,
    pcre, pdo_mysql, pdo_sqlsrv, random, readline, session, sodium, sqlsrv, standard, tokenizer, xml, xmlreader, xmlwriter, zip,
    zlib)
Setup: max_execution_time="300" memory_limit="512M" post_max_size="40M" safe_mode="" session.save_handler="files"
    upload_max_filesize="20M" disable_functions="" 
Software: Apache/2.4.59 (Win64) PHP/8.2.10 OpenSSL/3.1.5 ()
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Server Software: MySQL Community Server - GPL
    Server Version: 8.1.0
    Server SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
    Parameters: glpi_test@localhost/glpi_test_restored
    Host info: localhost via TCP/IP

PHP version (8.2.10) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.
curl extension is installed.
gd extension is installed.
intl extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (8.1.0) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to D:\www\glpi-fresh-10-0-16/files/_cache has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_cron has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_dumps has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_graphs has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_lock has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_pictures has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_plugins has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_rss has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_sessions has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_tmp has been validated.
Write access to D:\www\glpi-fresh-10-0-16/files/_uploads has been validated.

Web server root directory configuration seems safe.
Sessions configuration is secured.
OS and PHP are relying on 64 bits integers.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
Following extensions are installed: bz2, Phar, zip.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to D:\www\glpi-fresh-10-0-16/marketplace has been validated.
Access to timezone database (mysql) is not allowed.

GLPI constants
 
GLPI_ROOT: "D:\\www\\glpi-fresh-10-0-16"
GLPI_CONFIG_DIR: "D:\\www\\glpi-fresh-10-0-16/config"
GLPI_VAR_DIR: "D:\\www\\glpi-fresh-10-0-16/files"
GLPI_MARKETPLACE_DIR: "D:\\www\\glpi-fresh-10-0-16/marketplace"
GLPI_USE_CSRF_CHECK: "1"
GLPI_CSRF_EXPIRES: "7200"
GLPI_CSRF_MAX_TOKENS: "100"
GLPI_USE_IDOR_CHECK: "1"
GLPI_IDOR_EXPIRES: "7200"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\\/\\/[^@:]+(\\/.*)?$/"]
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_INSTALL_MODE: "TARBALL"
GLPI_NETWORK_MAIL: "glpi@teclib.com"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_TEXT_MAXSIZE: "4000"
GLPI_DOC_DIR: "D:\\www\\glpi-fresh-10-0-16/files"
GLPI_CACHE_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_cache"
GLPI_CRON_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_cron"
GLPI_DUMP_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_dumps"
GLPI_GRAPH_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_graphs"
GLPI_LOCAL_I18N_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_locales"
GLPI_LOCK_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_lock"
GLPI_LOG_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_log"
GLPI_PICTURE_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_plugins"
GLPI_RSS_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_rss"
GLPI_SESSION_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_sessions"
GLPI_TMP_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_tmp"
GLPI_UPLOAD_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_uploads"
GLPI_INVENTORY_DIR: "D:\\www\\glpi-fresh-10-0-16/files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
GLPI_I18N_DIR: "D:\\www\\glpi-fresh-10-0-16/locales"
GLPI_VERSION: "10.0.16"
GLPI_SCHEMA_VERSION: "10.0.16@b13256c443dd4fdb27b4a0d3b8fea8caba4dfaa9"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.4.0"
GLPI_YEAR: "2024"

Libraries
 
htmlawed/htmlawed version 1.2.14 in (D:\www\glpi-fresh-10-0-16\vendor\htmlawed\htmlawed)
phpmailer/phpmailer version 6.8.0 in (D:\www\glpi-fresh-10-0-16\vendor\phpmailer\phpmailer\src)
simplepie/simplepie version 1.5.8 in (D:\www\glpi-fresh-10-0-16\vendor\simplepie\simplepie\library)
tecnickcom/tcpdf version 6.7.5 in (D:\www\glpi-fresh-10-0-16\vendor\tecnickcom\tcpdf)
michelf/php-markdown in (D:\www\glpi-fresh-10-0-16\vendor\michelf\php-markdown\Michelf)
true/punycode in (D:\www\glpi-fresh-10-0-16\vendor\true\punycode\src)
iamcal/lib_autolink in (D:\www\glpi-fresh-10-0-16\vendor\iamcal\lib_autolink)
sabre/dav in (D:\www\glpi-fresh-10-0-16\vendor\sabre\dav\lib\DAV)
sabre/http in (D:\www\glpi-fresh-10-0-16\vendor\sabre\http\lib)
sabre/uri in (D:\www\glpi-fresh-10-0-16\vendor\sabre\uri\lib)
sabre/vobject in (D:\www\glpi-fresh-10-0-16\vendor\sabre\vobject\lib)
laminas/laminas-i18n in (D:\www\glpi-fresh-10-0-16\vendor\laminas\laminas-i18n\src)
laminas/laminas-servicemanager in (D:\www\glpi-fresh-10-0-16\vendor\laminas\laminas-servicemanager\src)
monolog/monolog in (D:\www\glpi-fresh-10-0-16\vendor\monolog\monolog\src\Monolog)
sebastian/diff in (D:\www\glpi-fresh-10-0-16\vendor\sebastian\diff\src)
donatj/phpuseragentparser in (D:\www\glpi-fresh-10-0-16\vendor\donatj\phpuseragentparser\src\UserAgent)
elvanto/litemoji in (D:\www\glpi-fresh-10-0-16\vendor\elvanto\litemoji\src)
symfony/console in (D:\www\glpi-fresh-10-0-16\vendor\symfony\console)
scssphp/scssphp in (D:\www\glpi-fresh-10-0-16\vendor\scssphp\scssphp\src)
laminas/laminas-mail in (D:\www\glpi-fresh-10-0-16\vendor\laminas\laminas-mail\src\Protocol)
laminas/laminas-mime in (D:\www\glpi-fresh-10-0-16\vendor\laminas\laminas-mime\src)
rlanvin/php-rrule in (D:\www\glpi-fresh-10-0-16\vendor\rlanvin\php-rrule\src)
ramsey/uuid in (D:\www\glpi-fresh-10-0-16\vendor\ramsey\uuid\src)
psr/log in (D:\www\glpi-fresh-10-0-16\vendor\psr\log\Psr\Log)
psr/simple-cache in (D:\www\glpi-fresh-10-0-16\vendor\psr\simple-cache\src)
psr/cache in (D:\www\glpi-fresh-10-0-16\vendor\psr\cache\src)
league/csv in (D:\www\glpi-fresh-10-0-16\vendor\league\csv\src)
mexitek/phpcolors in (D:\www\glpi-fresh-10-0-16\vendor\mexitek\phpcolors\src\Mexitek\PHPColors)
guzzlehttp/guzzle in (D:\www\glpi-fresh-10-0-16\vendor\guzzlehttp\guzzle\src)
guzzlehttp/psr7 in (D:\www\glpi-fresh-10-0-16\vendor\guzzlehttp\psr7\src)
glpi-project/inventory_format in (D:\www\glpi-fresh-10-0-16\vendor\glpi-project\inventory_format\lib\php)
wapmorgan/unified-archive in (D:\www\glpi-fresh-10-0-16\vendor\wapmorgan\unified-archive\src)
paragonie/sodium_compat in (D:\www\glpi-fresh-10-0-16\vendor\paragonie\sodium_compat\src)
symfony/cache in (D:\www\glpi-fresh-10-0-16\vendor\symfony\cache)
html2text/html2text in (D:\www\glpi-fresh-10-0-16\vendor\html2text\html2text\src)
symfony/css-selector in (D:\www\glpi-fresh-10-0-16\vendor\symfony\css-selector)
symfony/dom-crawler in (D:\www\glpi-fresh-10-0-16\vendor\symfony\dom-crawler)
twig/twig in (D:\www\glpi-fresh-10-0-16\vendor\twig\twig\src)
twig/string-extra in (D:\www\glpi-fresh-10-0-16\vendor\twig\string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (D:\www\glpi-fresh-10-0-16\vendor\symfony\polyfill-php82)
league/oauth2-client in (D:\www\glpi-fresh-10-0-16\vendor\league\oauth2-client\src\Provider)
league/oauth2-google in (D:\www\glpi-fresh-10-0-16\vendor\league\oauth2-google\src\Provider)
thenetworg/oauth2-azure in (D:\www\glpi-fresh-10-0-16\vendor\thenetworg\oauth2-azure\src\Provider)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP (anonymous@smtp.mydomain.be)

Plugins list
 
    fields               Name: Additional fields              Version: 1.20.6     State: Installed / not activated               
        Install Method: Manual
    datainjection        Name: Data Injection                 Version: 2.13.2     State: Installed / not activated               
        Install Method: Manual
    useditemsexport      Name: Export des éléments utilisés   Version: 2.5.1      State: Installed / not activated              
         Install Method: Manual
    formcreator          Name: Form Creator                   Version: 2.13.6     State: Not installed                           
        Install Method: Manual
    mreporting           Name: Plus de rapports               Version: 1.8.2      State: Installed / not activated               
        Install Method: Manual

Anything else?

No response

cedric-anne commented 3 months ago

Hi,

This issue is fixed by #17481. You should restore you backup, reinstall the GLPI 10.0.16 source files, apply the patch (ignore the test file) and run the migration.

NoxWorld2660 commented 3 months ago

@cedric-anne , thank you for your quick reply, i'll do that.