ericferon / glpi-archimap

GLPI plugin for drawing architecture maps (based on draw.io)
GNU General Public License v2.0
19 stars 10 forks source link

Cannot download from Marketplace #52

Closed jcervantes-sipecom closed 2 years ago

jcervantes-sipecom commented 2 years ago

When trying to download from Marketplace, I'm getting this error:

Uncaught Exception RuntimeException: Cannot access phar file entry '/archimap/drawio/src/main/java/com/mxgraph/layout/hierarchical/model/mxGraphAbstractHierarchyCell.java' in archive '/var/www/html/glpi/files/_tmp/archimap-v3.2.2.tar.gz' in /var/www/html/glpi/vendor/wapmorgan/unified-archive/src/Formats/Tar.php at line 377

image

GLPI Version: 9.5.7

ericferon commented 2 years ago

Hi, I will have a look why this archive is not accepted, although I followed the same process as for my other plugins. I'm not sure the solution could come from my side, as the exception is raised in the GLPI core. K.r,

cedric-anne commented 2 years ago

Hi,

Problem is due to PHP Phar limitations, that cannot handle file path longer than 255 bytes in archives. See https://www.php.net/manual/en/phar.fileformat.tar.php#:~:text=File%20names%20are%20limited%20to,the%20phar%20archive.

zdenkor commented 2 years ago

For me this is now working with the plugin version 3.2.4

jcervantes-sipecom commented 2 years ago

Hi, now I can download from Marketplace.

But In the php-error.log I got:

[2022-04-04 08:48:04] glpiphplog.WARNING:   *** PHP Warning (2): include(/var/www/html/glpi/marketplace/archimap/scripts/copystylestodb.php): failed to open stream: No such file or directory in /var/www/html/glpi/marketplace/archimap/hook.php at line 78
  Backtrace :
  marketplace/archimap/hook.php:78                   include()
  inc/plugin.class.php:741                           plugin_archimap_install()
  :                                                  Plugin->install()
  inc/marketplace/controller.class.php:483           call_user_func()
  inc/marketplace/controller.class.php:402           Glpi\Marketplace\Controller->setPluginState()
  inc/marketplace/controller.class.php:159           Glpi\Marketplace\Controller->installPlugin()
  ajax/marketplace.php:69                            Glpi\Marketplace\Controller->downloadPlugin()

[2022-04-04 08:48:04] glpiphplog.WARNING:   *** PHP Warning (2): include(): Failed opening '/var/www/html/glpi/marketplace/archimap/scripts/copystylestodb.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/glpi/marketplace/archimap/hook.php at line 78
  Backtrace :
  marketplace/archimap/hook.php:78                   include()
  inc/plugin.class.php:741                           plugin_archimap_install()
  :                                                  Plugin->install()
  inc/marketplace/controller.class.php:483           call_user_func()
  inc/marketplace/controller.class.php:402           Glpi\Marketplace\Controller->setPluginState()
  inc/marketplace/controller.class.php:159           Glpi\Marketplace\Controller->installPlugin()
  ajax/marketplace.php:69                            Glpi\Marketplace\Controller->downloadPlugin()

But In general everything is OK.

ericferon commented 2 years ago

Thank you to https://github.com/cedric-anne for the tip. I examined it, but currently the longest path is 147 characters. So, to solve the problem rapidly, I choose to use zip as archive format, and it works better. Thank you also to https://github.com/jcervantes-sipecom : I will add the missing "scripts" directory to the archive in a next version. K.r, Eric