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

New item form instead of item view for everything #16559

Closed
2 tasks done
kepi opened this issue Feb 14, 2024 · 6 comments
Closed
2 tasks done

New item form instead of item view for everything #16559

kepi opened this issue Feb 14, 2024 · 6 comments

Comments

@kepi
Copy link

kepi commented Feb 14, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.12

Bug description

When I try to preview any item in GLPI, i receive New item form instead of details of selected item.

This happens not only for assets, but also for users, groups, entities and everything else where there is a table from which I should click on name to do something.

I'm not 100 % sure when this started to happen, but same problem was on 10.0.10 which I upgraded to 10.0.12 just now. All files are clean installed, database is updated and checked for inconsistencies.

Relevant log output

no errors in log

Page URL

https://it.igloonet.cz/front/profile.phpf

Steps To reproduce

  1. With clean install, config files attached below, database is updated from older releases
  2. With PHP 8.2 on PHP-FPM
  3. With all plugins disabled
  4. I go to https://it.igloonet.cz/front/profile.php
  5. I click on Super-Admin
  6. I'm directed to https://it.igloonet.cz/front/profile.form.php?id=4
  7. I see New item - Profile instead of super-admin details

image
screenshot

Your GLPI setup information

Information about system installation and configuration
GLPI 10.0.12 ( => /apps/glpi/apps/glpi/glpi)
Installation mode: TARBALL
Current language:en_GB

Server
 
Operating system: Linux pazuzu 4.19.0-25-amd64 #​1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
PHP 8.2.15 fpm-fcgi (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, amqp, apcu, bcmath, bz2, calendar,
cgi-fcgi, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imagick, imap, intl, json,
ldap, libxml, mbstring, memcache, mongodb, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix,
pspell, random, readline, redis, session, shmop, soap, sockets, sodium, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer,
xml, xmlreader, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="600" memory_limit="200M" post_max_size="50M" safe_mode="" session.save_handler="files"
upload_max_filesize="50M" disable_functions=""
Software: nginx/1.14.2
Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
Server Software: Debian 12
Server Version: 10.11.4-MariaDB-1~deb12u1-log
Server SQL Mode: NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Parameters: some_glpi@mariadb.some.server/some_glpi
Host info: mariadb.some.server via TCP/IP

PHP version (8.2.15) 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 (10.11.4) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /apps/glpi/apps/glpi/var/_cache has been validated.
Write access to /apps/glpi/apps/glpi/var/_cron has been validated.
Write access to /apps/glpi/apps/glpi/var has been validated.
Write access to /apps/glpi/apps/glpi/var/_dumps has been validated.
Write access to /apps/glpi/apps/glpi/var/_graphs has been validated.
Write access to /apps/glpi/apps/glpi/var/_lock has been validated.
Write access to /apps/glpi/apps/glpi/var/_pictures has been validated.
Write access to /apps/glpi/apps/glpi/var/_plugins has been validated.
Write access to /apps/glpi/apps/glpi/var/_rss has been validated.
Write access to /apps/glpi/apps/glpi/var/_sessions has been validated.
Write access to /apps/glpi/apps/glpi/var/_tmp has been validated.
Write access to /apps/glpi/apps/glpi/var/_uploads has been validated.

Web server root directory configuration seems safe.
PHP directive "session.cookie_secure" should be set to "on" when GLPI can be accessed on HTTPS protocol.
PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values.
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 /apps/glpi/apps/glpi/glpi/marketplace has been validated.
Timezones seems loaded in database.

GLPI constants
 
GLPI_ROOT: "/apps/glpi/apps/glpi/glpi"
GLPI_CONFIG_DIR: "/apps/glpi/apps/glpi/config"
GLPI_VAR_DIR: "/apps/glpi/apps/glpi/var"
GLPI_LOG_DIR: "/apps/glpi/apps/glpi/log"
GLPI_MARKETPLACE_DIR: "/apps/glpi/apps/glpi/glpi/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: "/apps/glpi/apps/glpi/var"
GLPI_CACHE_DIR: "/apps/glpi/apps/glpi/var/_cache"
GLPI_CRON_DIR: "/apps/glpi/apps/glpi/var/_cron"
GLPI_DUMP_DIR: "/apps/glpi/apps/glpi/var/_dumps"
GLPI_GRAPH_DIR: "/apps/glpi/apps/glpi/var/_graphs"
GLPI_LOCAL_I18N_DIR: "/apps/glpi/apps/glpi/var/_locales"
GLPI_LOCK_DIR: "/apps/glpi/apps/glpi/var/_lock"
GLPI_PICTURE_DIR: "/apps/glpi/apps/glpi/var/_pictures"
GLPI_PLUGIN_DOC_DIR: "/apps/glpi/apps/glpi/var/_plugins"
GLPI_RSS_DIR: "/apps/glpi/apps/glpi/var/_rss"
GLPI_SESSION_DIR: "/apps/glpi/apps/glpi/var/_sessions"
GLPI_TMP_DIR: "/apps/glpi/apps/glpi/var/_tmp"
GLPI_UPLOAD_DIR: "/apps/glpi/apps/glpi/var/_uploads"
GLPI_INVENTORY_DIR: "/apps/glpi/apps/glpi/var/_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: "/apps/glpi/apps/glpi/glpi/locales"
GLPI_VERSION: "10.0.12"
GLPI_SCHEMA_VERSION: "10.0.12@b902ef5f5da967c1a9d0826ee8a7dce07d57cf3d"
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 (/apps/glpi/apps/glpi/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/apps/glpi/apps/glpi/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/apps/glpi/apps/glpi/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.6.2 in (/apps/glpi/apps/glpi/glpi/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/apps/glpi/apps/glpi/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/apps/glpi/apps/glpi/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/apps/glpi/apps/glpi/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/apps/glpi/apps/glpi/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/apps/glpi/apps/glpi/glpi/vendor/sabre/http/lib)
sabre/uri in (/apps/glpi/apps/glpi/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/apps/glpi/apps/glpi/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/apps/glpi/apps/glpi/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/apps/glpi/apps/glpi/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/apps/glpi/apps/glpi/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/apps/glpi/apps/glpi/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/apps/glpi/apps/glpi/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/apps/glpi/apps/glpi/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/apps/glpi/apps/glpi/glpi/vendor/symfony/console)
scssphp/scssphp in (/apps/glpi/apps/glpi/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/apps/glpi/apps/glpi/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/apps/glpi/apps/glpi/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/apps/glpi/apps/glpi/glpi/vendor/rlanvin/php-rrule/src)
ramsey/uuid in (/apps/glpi/apps/glpi/glpi/vendor/ramsey/uuid/src)
psr/log in (/apps/glpi/apps/glpi/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/apps/glpi/apps/glpi/glpi/vendor/psr/simple-cache/src)
psr/cache in (/apps/glpi/apps/glpi/glpi/vendor/psr/cache/src)
league/csv in (/apps/glpi/apps/glpi/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/apps/glpi/apps/glpi/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/apps/glpi/apps/glpi/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/apps/glpi/apps/glpi/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/apps/glpi/apps/glpi/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/apps/glpi/apps/glpi/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/apps/glpi/apps/glpi/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/apps/glpi/apps/glpi/glpi/vendor/symfony/cache)
html2text/html2text in (/apps/glpi/apps/glpi/glpi/vendor/html2text/html2text/src)
symfony/css-selector in (/apps/glpi/apps/glpi/glpi/vendor/symfony/css-selector)
symfony/dom-crawler in (/apps/glpi/apps/glpi/glpi/vendor/symfony/dom-crawler)
twig/twig in (/apps/glpi/apps/glpi/glpi/vendor/twig/twig/src)
twig/string-extra in (/apps/glpi/apps/glpi/glpi/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 (/apps/glpi/apps/glpi/glpi/vendor/symfony/polyfill-php82)
league/oauth2-client in (/apps/glpi/apps/glpi/glpi/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/apps/glpi/apps/glpi/glpi/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/apps/glpi/apps/glpi/glpi/vendor/thenetworg/oauth2-azure/src/Provider)
phpCas version 1.3.6 in (/usr/share/php/CAS/source)

LDAP directories
 
Server: 'ldap://ldap1.some.server', Port: '389', BaseDN: 'dc=some,dc=server', Connection filter: '(objectClass=person)', RootDN:
'cn=glpi,ou=webapps,dc=some,dc=server', Use TLS: '1'

SQL replicas
 
Not active

Notifications
 
Way of sending emails: PHP

Plugins list
 
accounts Name: Accounts Version: 3.0.4 State: Error / to clean
Install Method: Manual
fields Name: Additional fields Version: 1.21.6 State: Error / to clean
Install Method: Manual
datainjection Name: Data injection Version: 2.13.4 State: Error / to clean
Install Method: Manual
genericobject Name: Objects management Version: 2.14.8 State: Error / to clean
Install Method: Manual
racks Name: Rack enclosures management Version: 1.8.0 State: Error / to clean
Install Method: Manual
room Name: Rooms Version: 3.1.3 State: Error / to clean
Install Method: Manual
tag Name: Tag Management Version: 2.11.7 State: Error / to clean
Install Method: Manual

>

Anything else?

I have glpi/inc/inc_downstream.php

<?php
define('GLPI_CONFIG_DIR', '/apps/glpi/apps/glpi/config');

if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {
           require_once GLPI_CONFIG_DIR . '/local_define.php';
}

config/local_defined.php

<?php
define('GLPI_VAR_DIR', '/apps/glpi/apps/glpi/var');
define('GLPI_LOG_DIR', '/apps/glpi/apps/glpi/log');

and ofc config/config_db.php

@cedric-anne
Copy link
Member

Hi,

Did you tried to restart php-fpm?

@kepi
Copy link
Author

kepi commented Feb 27, 2024

Yes, tried once again to be 100 % sure and no change. I tried it on normal user, superadmin, tried to logout & login, clear cache and all other basic ways to resolve problem but no success.

@trasher
Copy link
Contributor

trasher commented Feb 28, 2024

Do you have any URL redirection set up in your web server configuration? It appears you use nginx, and it's quite frequent users have a setup that seems to work; but cause some issues.

Please double check your web server setup. As we do not know well nginx, we cannot help on that (also that's out of the scope of a GLPI communituy support). You can maybe try with an as clean as possible setup, or even better with apache to see if you reproduce.

@kepi
Copy link
Author

kepi commented Feb 28, 2024

No, there is no URL redirection. I'm using same config as recommended on https://glpi-install.readthedocs.io/en/latest/prerequisites.html#nginx-configuration

But I think the problem has to be elsewhere. When I hover over name of item, this is how target link looks like: https://it.igloonet.cz/front/computer.form.php?id=123 What is correct link to item detail? From form part in it, it seems to me that problem is in rendered view, not in some redirect.

Btw. one more clue I forgot to mention is that I also can't see dashboards since that problematic upgrade. When I open the page, I can se for fraction of second there are some data but they dissappears aftert. It looks like there is something rendered above, I can't see toolbar, dashboard, anything. I tried to play with devtools to find exact problem, but no luck.

Thanks for any idea.

@cconard96
Copy link
Contributor

Are you sure there is nothing logged in the GLPI log files (files/_log folder inside your GLPI install by default) or the nginx error log?
Do other uses of query parameters seem to work? For example, switching entities and profiles use them. You can also go to "/front/ticket.form.php?name=test" to see if the title field of a new ticket autofills.

You can also enable debug mode while logged in with a super-admin profile from the top-right menu and then go to the requests widget on the debug toolbar, then the "Globals" tab followed by the "GET" tab to see what data from the URL is being sent to PHP. If there is no "id" when trying to view an existing item, then it is likely that there is an issue on the web server side or a bad PHP config.

@kepi
Copy link
Author

kepi commented Feb 28, 2024

there is one NOTICE in logs:

"NOTICE: PHP message: PHP Warning:  Undefined array key "domain" in /apps/glpi/glpi/front/locale.php on line 84"

Ok, now I understand where you are heading with the nginx config... Main problem for me was that I wasn't sure that i.e. computer.form.php is correct file, but I see that problem is with arguments are not passed, it is same with your ?name=... This should take minutes to fix, hopefully...

and voilá, finaly fixed! Huge thanks everybody and especially @cconard96 for the problem. Looks like whole problem is fastcgi_split_path_info ^(.+\.php)(/.*)$; line in official config.

Working nginx config:

server {
    listen 10001;
    server_name glpi.some.domain;
    root /some/path/glpi/public;

    index index.php index.html;

    error_log /var/log/nginx/error.log;
    error_page 400 /400.html;

    client_max_body_size 50m;

    # deny access to dot files
    location ~ /\. {
        access_log off;
        log_not_found off;
        deny all;
    }

    location ~ ^(/install/mysql|/config|/scripts|/vendor/tecnickcom/tcpdf/tools|/locales|/files)/ {
        deny all;
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

   location ~ ^/index\.php$ {
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php.web-glpi.sock;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
    }
}

@kepi kepi closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants