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.18k stars 1.28k forks source link

[GLPI 10] problem in Rules for assigning an item to an entity #10513

Closed Badkempachi closed 2 years ago

Badkempachi commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

10

Bug description

There was a problem when setting “Rules for assigning an item to an entity”, in the new rule in the action tab of the attempt to assign an object to an office that reports to the head office, this possibility is not available. But if you use the standard GLPI account, this control is present. The user account under which the assignment operation cannot be performed was imported via LDAP. Please clarify what I'm doing wrong or perhaps I need to issue additional rights? At the same time, the user is given the maximum Super-Admin rights, but the result does not change. There is also an error when navigating to the following path • Home • Administration • Entities • assets. The error looks like “Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/html/glpi/src/DBmysqlIterator.php at line 585” using the latest nightly build 2022-02-02 00:22:51 master.16615cb. tar.gz

Relevant log output

[log.txt](https://github.com/glpi-project/glpi/files/7986254/log.txt)

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

Information about system installation and configuration
GLPI 10.0.0-dev ( => /var/www/html/glpi)
Installation mode: TARBALL
Current language:en_GB

Server
 
Operating system: Linux glpi.localhost.ru 5.4.17-2136.302.7.2.1.el8uek.x86_64 #2 SMP Tue Jan 18 12:11:34 PST 2022 x86_64
PHP 7.4.27 fpm-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bz2, calendar, cgi-fcgi, ctype, curl,
    date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl,
    pcre, pdo_mysql, pdo_sqlite, session, sockets, sodium, sqlite3, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl,
    zip, zlib)
Setup: max_execution_time="30" memory_limit="256M" post_max_size="8M" safe_mode="" session.save_handler="files"
    upload_max_filesize="2M" 
Software: Apache/2.4.37 (Oracle Linux) OpenSSL/1.1.1k ()
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Server Software: MariaDB Server
    Server Version: 10.3.28-MariaDB
    Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    Parameters: root@localhost/GLPI
    Host info: Localhost via UNIX socket

PHP version (7.4.27) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.
gd extension is installed.
intl extension is installed.
libxml extension is installed.
zlib extension is installed.
Database engine version (10.3.28) is supported.
The log file has been created successfully.
Write access to /var/www/html/glpi/files/_cache has been validated.
Write access to /var/www/html/glpi/config has been validated.
Write access to /var/www/html/glpi/files/_cron has been validated.
Write access to /var/www/html/glpi/files has been validated.
Write access to /var/www/html/glpi/files/_dumps has been validated.
Write access to /var/www/html/glpi/files/_graphs has been validated.
Write access to /var/www/html/glpi/files/_lock has been validated.
Write access to /var/www/html/glpi/files/_pictures has been validated.
Write access to /var/www/html/glpi/files/_plugins has been validated.
Write access to /var/www/html/glpi/files/_rss has been validated.
Write access to /var/www/html/glpi/files/_sessions has been validated.
Write access to /var/www/html/glpi/files/_tmp has been validated.
Write access to /var/www/html/glpi/files/_uploads has been validated.
Web access to the files directory should not be allowed but this cannot be checked automatically on this instance.
Make sure access to error log file (/files/_log/php-errors.log) is forbidden; otherwise review .htaccess file and web server configuration.
SELinux configuration is OK.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
zip extension is installed.
bz2 extension is installed.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /var/www/html/glpi/marketplace has been validated.
Timezones seems loaded in database.

GLPI constants
 
GLPI_ROOT: /var/www/html/glpi
GLPI_CONFIG_DIR: /var/www/html/glpi/config
GLPI_VAR_DIR: /var/www/html/glpi/files
GLPI_MARKETPLACE_DIR: /var/www/html/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: 
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: 1
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1
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_DOC_DIR: /var/www/html/glpi/files
GLPI_CACHE_DIR: /var/www/html/glpi/files/_cache
GLPI_CRON_DIR: /var/www/html/glpi/files/_cron
GLPI_DUMP_DIR: /var/www/html/glpi/files/_dumps
GLPI_GRAPH_DIR: /var/www/html/glpi/files/_graphs
GLPI_LOCAL_I18N_DIR: /var/www/html/glpi/files/_locales
GLPI_LOCK_DIR: /var/www/html/glpi/files/_lock
GLPI_LOG_DIR: /var/www/html/glpi/files/_log
GLPI_PICTURE_DIR: /var/www/html/glpi/files/_pictures
GLPI_PLUGIN_DOC_DIR: /var/www/html/glpi/files/_plugins
GLPI_RSS_DIR: /var/www/html/glpi/files/_rss
GLPI_SESSION_DIR: /var/www/html/glpi/files/_sessions
GLPI_TMP_DIR: /var/www/html/glpi/files/_tmp
GLPI_UPLOAD_DIR: /var/www/html/glpi/files/_uploads
GLPI_INVENTORY_DIR: /var/www/html/glpi/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/glpi-plugins/
GLPI_I18N_DIR: /var/www/html/glpi/locales
GLPI_VERSION: 10.0.0-dev
GLPI_SCHEMA_VERSION: 10.0.0-dev@4f12cc11183dfb486b84e28e8dad44a9259736c3
GLPI_MARKETPLACE_PRERELEASES: 1
GLPI_MIN_PHP: 7.4.0
GLPI_MAX_PHP: 8.2.0
GLPI_YEAR: 2022

Libraries
 
htmlawed/htmlawed version 1.2.6 in (/var/www/html/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.5.3 in (/var/www/html/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/var/www/html/glpi/vendor/simplepie/simplepie/library)
mpdf/mpdf in (/var/www/html/glpi/vendor/mpdf/mpdf/src)
michelf/php-markdown in (/var/www/html/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/var/www/html/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/var/www/html/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/var/www/html/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/var/www/html/glpi/vendor/sabre/http/lib)
sabre/uri in (/var/www/html/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/var/www/html/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/var/www/html/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/var/www/html/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/var/www/html/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/var/www/html/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/var/www/html/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/var/www/html/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/var/www/html/glpi/vendor/symfony/console)
scssphp/scssphp in (/var/www/html/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/var/www/html/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/var/www/html/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/var/www/html/glpi/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/var/www/html/glpi/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/var/www/html/glpi/vendor/ramsey/uuid/src)
psr/log in (/var/www/html/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/var/www/html/glpi/vendor/psr/simple-cache/src)
psr/cache in (/var/www/html/glpi/vendor/psr/cache/src)
league/csv in (/var/www/html/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/var/www/html/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/var/www/html/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/var/www/html/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/var/www/html/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/var/www/html/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/var/www/html/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/var/www/html/glpi/vendor/symfony/cache)
html2text/html2text in (/var/www/html/glpi/vendor/html2text/html2text/src)
symfony/dom-crawler in (/var/www/html/glpi/vendor/symfony/dom-crawler)
twig/twig in (/var/www/html/glpi/vendor/twig/twig/src)
twig/string-extra in (/var/www/html/glpi/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 in (/var/www/html/glpi/vendor/symfony/polyfill-php80)

LDAP directories
 
Server: '192.168.1.1', Port: '3268', BaseDN: 'DC=localhost,DC=ru', Connection filter:
        '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN:
        'ldapsearch-glpi@localhost.ru', Use TLS: none
Server: '192.168.1.1', Port: '3268', BaseDN: 'DC=spb,DC=localhost,DC=ru', Connection filter:
        '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN:
        'ldapsearch-glpi@localhost.ru', Use TLS: none
Server: '192.168.1.1', Port: '3268', BaseDN: 'DC=cr,DC=localhost,DC=ru', Connection filter:
        '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN:
        'ldapsearch-glpi@localhost.ru', Use TLS: none

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP (anonymous@mail2.localhost.ru)

Plugins list
 
    connections          Name: Connections                    Version: 10.0.0-rc2 State: Installed / not activated
    manageentities       Name: Entities portal                Version: 4.0.0-rc1  State: Installed / not activated
    glpiinventory        Name: GLPI Inventory                 Version: 1.0.0-rc3  State: Enabled
    addressing           Name: IP Adressing                   Version: 3.0.0-rc2  State: Installed / not activated
    mreporting           Name: Подробные отчеты          Version: 1.8.0-rc1  State: Installed / not activated
    shellcommands        Name: Служебные команды        Version: 4.0.0-rc2  State: Installed / not activated
    typology             Name: Типологий                      Version: 3.0.0-rc1  State: Installed / not activated
    tag                  Name: Управление тэгами        Version: 2.9.0-rc2  State: Installed / not activated

Anything else?

No response

Badkempachi commented 2 years ago

5 1 2 3 4

trasher commented 2 years ago

Please provide full error trace from log files

trasher commented 2 years ago

(note that I've seen you attached a log file, but I cannot find the "Empty IN" error in it)

Badkempachi commented 2 years ago

(note that I've seen you attached a log file, but I cannot find the "Empty IN" error in it)

[2022-02-01 14:51:32] glpiphplog.DEBUG: Html::compileScss() in /var/www/html/glpi/src/Html.php line 6697 Compile css/standalone/dashboard.scss {"user":"9@glpi.localhost.ru"} [2022-02-01 14:51:32] glpiphplog.DEBUG: Html::compileScss() in /var/www/html/glpi/src/Html.php line 6697 Compile css/standalone/chartist.scss {"user":"9@glpi.localhost.ru"} [2022-02-01 14:51:32] glpiphplog.DEBUG: Html::compileScss() in /var/www/html/glpi/src/Html.php line 6697 Compile css/standalone/gridstack-grids.scss {"user":"9@glpi.localhost.ru"} [2022-02-01 14:51:33] glpiphplog.DEBUG: Html::compileScss() in /var/www/html/glpi/src/Html.php line 6697 Compile css/palettes/auror.scss {"user":"9@glpi.localhost.ru"} [2022-02-01 15:02:03] glpiphplog.ALERT: PHP Compile Error (64): Declaration of NotificationTargetObjectLock::getSender() must be compatible with NotificationTarget::getSender(): array in /var/www/html/glpi/src/NotificationTargetObjectLock.php at line 145
[2022-02-01 15:06:33] glpiphplog.DEBUG: Html::compileScss() in /var/www/html/glpi/src/Html.php line 6697 Compile css/palettes/auror.scss {"user":"9@glpi.localhost.ru"} [2022-02-01 15:10:27] glpiphplog.CRITICAL:
Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/html/glpi/src/DBmysqlIterator.php at line 585 Backtrace : src/DBmysqlIterator.php:556 DBmysqlIterator->analyseCriterion() src/DBmysqlIterator.php:311 DBmysqlIterator->analyseCrit() src/DBmysqlIterator.php:107 DBmysqlIterator->buildQuery() src/DBmysql.php:1021 DBmysqlIterator->execute() src/DbUtils.php:990 DBmysql->request() inc/db.function.php:326 DbUtils->getAncestorsOf() src/Entity.php:1783 getAncestorsOf() src/Entity.php:464 Entity::showInventoryOptions() src/CommonGLPI.php:687 Entity::displayTabContentForItem() ajax/common.tabs.php:107 CommonGLPI::displayStandardTab() php-error.txt sql-error.txt

cconard96 commented 2 years ago

Empty IN error fixed in #10618.

@Badkempachi Can you re-test with the latest nightly "master" release and see if there are any remaining issues related to this report? https://nightly.glpi-project.org/glpi/

Badkempachi commented 2 years ago

Empty IN error fixed in #10618.

@Badkempachi Can you re-test with the latest nightly "master" release and see if there are any remaining issues related to this report? https://nightly.glpi-project.org/glpi/

Hi, @cconard96 Strange but the situation has not changed. To clarify the situation, I want to clarify whether I am doing everything right. I go to "Rules for assigning an item to an entity" then I create a new rule and go to the "Actions" tab and create a new action and select "Assign -> Entities". And in the end, I see a similar picture that was before, namely, I see that only the head office is displayed, but we have 2 branches and they are not displayed in the list. If I go to Entity, I have the head office displayed and if I open it, then I will see the added branches in the subordinates. 3

cconard96 commented 2 years ago

The Entity dropdown is restricted to the Entity you are currently viewing and its children (if you are in recursive mode). When you change your Entity in the top right, be sure to select the double arrow next to the entity name if you want to see the child entities.

This is the behavior I observed on the latest GLPI 10 and it seems to be working.

Badkempachi commented 2 years ago

The Entity dropdown is restricted to the Entity you are currently viewing and its children (if you are in recursive mode). When you change your Entity in the top right, be sure to select the double arrow next to the entity name if you want to see the child entities.

This is the behavior I observed on the latest GLPI 10 and it seems to be working.

Hey, @cconard96 I can compare the default GLPI account and my account, imported via ldap and given the maximum access level, such complications arise. Therefore, I was initially interested in whether this is normal or if I need to change the settings, but even when I change to recursive rights, I do not get the result that is on the standard GLPI account. Tell me, please, what am I doing wrong? Or did I miss some point in setting additional rights? I really need to be able to interact with the organization's child objects, for the reason that it is not correct to use the standard GLPI account in such cases.

cedric-anne commented 2 years ago

@Badkempachi

Can you try with GLPI 10.0.0-rc3 ?

Therefore, I was initially interested in whether this is normal or if I need to change the settings, but even when I change to recursive rights, I do not get the result that is on the standard GLPI account.

Are you sure that you are displaying the whole entity tree ? image

Badkempachi commented 2 years ago

@Badkempachi

Can you try with GLPI 10.0.0-rc3 ?

Therefore, I was initially interested in whether this is normal or if I need to change the settings, but even when I change to recursive rights, I do not get the result that is on the standard GLPI account.

Are you sure that you are displaying the whole entity tree ? image

Hello, @cedric-anne thanks, the problem has been fixed.