tomolimo / processmaker

GLPI plugin that provides an interface with ProcessMaker (http://www.processmaker.com/)
30 stars 11 forks source link

Unable to connect from plugin to processmaker server on the same host #152

Closed Wolvverine closed 2 years ago

Wolvverine commented 2 years ago

GLPI address: http://docker.some.wew:6080/ Processmaker server address: http://docker.some.wew:8090/

From glpi to Processmaker server telnet connection - work From external network to Processmaker server connection - work From glpi to Processmaker plugin to Processmaker server - failed

image

Connections log on procesmaker-server: from external: 10.0.1.254 - - [11/May/2022:15:18:21 +0000] "GET /skins/neoclassic/images/ext/gray/grid/refresh.gif HTTP/1.1" 499 0 "http://docker.domain.local:8090/css/neoclassic-extJs.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0"

10.0.1.254 - - [11/May/2022:13:48:12 +0000] "GET /images/favicon.ico HTTP/1.1" 200 1162 "http://processmaker_test_pm.domain.local:8090/sys/en/neoclassic/login/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0"

from Plugin with another hostname than glpi (alias in dns):

172.20.0.1 - - [11/May/2022:13:49:45 +0000] "GET /sysworkflow/en/glpi_classic/services/wsdl2 HTTP/1.1" 200 65959 "-" "-" 172.20.0.1 - - [11/May/2022:13:51:17 +0000] "GET /sysworkflow/en/glpi_classic/services/wsdl2 HTTP/1.1" 200 65959 "-" "-"

172.20.0.1 - internal docker host address

tomolimo commented 2 years ago

Hello @Wolvverine The communication is partially done via SOAP API interface. Could you spy the communication with Fiddler (for exemple)? Could you copy/paste the PM server configuration page? Thank you, Regards, Tomolimo

Wolvverine commented 2 years ago

PM server configuration is default - new instalation.

I completed above with logs.

image image image

tomolimo commented 2 years ago

Hello @Wolvverine When you wrote "default installation": did you follow the wiki for the configuration of the PM server (https://github.com/tomolimo/processmaker-server/wiki)? Thank you, Regards, Tomolimo

Wolvverine commented 2 years ago

Yes.

tomolimo commented 2 years ago

So you've got an error with the mysql connection...

Wolvverine commented 2 years ago

image image image

Wolvverine commented 2 years ago

Does the plugin have a problem if the processmaker server address is the same as the glpi server address and they only differ in port?

tomolimo commented 2 years ago

Normally not :), But you have an issue in the config of the PM server itself: image

Wolvverine commented 2 years ago

Which file is that?

tomolimo commented 2 years ago

Look into the php error file for the php7.1 (in the phpinfo you should be able to find where the php error log file is)

Wolvverine commented 2 years ago

I use php-fpm with:

catch_workers_output = yes
php_admin_flag[display_errors] = Off
php_admin_value[error_log] = /proc/1/fd/2
php_admin_flag[log_errors] = On
php_admin_value[error_reporting] = E_ALL
php_admin_flag[html_errors] = On

nginx: for php location added: fastcgi_intercept_errors on; and only (tons of) Deprecated Warnings in error log: PHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ...

tomolimo commented 2 years ago

Seems like there is a bug in PM server when mySQL user password has special chars. Try changing the password of your mySQL user (and root) to a more simple one (just letters and digits), see reference here: https://forum.processmaker.com/viewtopic.php?t=708638

Wolvverine commented 2 years ago

After changing the password, the error disappeared, unfortunately, the connection from GLPI to ProcessMaker server is still missing.

When tcpdump is connected, I can see traffic between base and GLPI, but there is no outgoing connection to the processmaker server from GLPI.

tomolimo commented 2 years ago

On GLPI side did you add the PHP soap module?

Wolvverine commented 2 years ago

Yes:

Operating system: Linux f1d5d758dc0f 4.18.0-365.el8.x86_64 #1 SMP Thu Feb 10 16:11:23 UTC 2022 x86_64
PHP 7.4.28 fpm-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bz2, cgi-fcgi, ctype, curl, date, dom,
    exif, fileinfo, filter, ftp, gd, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre,
    pdo_sqlite, posix, readline, session, snmp, soap, sodium, sqlite3, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, zip,
    zlib)
Setup: max_execution_time="600" memory_limit="64M" post_max_size="8M" safe_mode="" session.save_handler="files"
    upload_max_filesize="2M" 
Software: nginx/1.20.2
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Server Software: mariadb.org binary distribution
    Server Version: 10.7.3-MariaDB-1:10.7.3+maria~focal
    Server SQL Mode: 
    Parameters: root@mariadb_test_pm/glpi_test_pm
    Host info: mariadb_test_pm via TCP/IP

Dump for config variable:

object(PluginProcessmakerConfig)#53 (15) { ["fields"]=> array(21) { ["id"]=> int(1) ["name"]=> string(12) "ProcessMaker" ["pm_server_URL"]=> string(28) "http://docker.6domainname.wew:8090" ["pm_workspace"]=> string(8) "workflow" ["pm_admin_user"]=> string(5) "admin" ["pm_admin_passwd"]=> string(72) "xxxxx" ["pm_theme"]=> string(12) "glpi_classic" ["date_mod"]=> string(19) "2022-05-13 11:23:30" ["taskcategories_id"]=> NULL ["users_id"]=> int(2) ["pm_group_guid"]=> string(1) "0" ["comment"]=> NULL ["pm_dbserver_name"]=> string(20) "mariadb_test_pm:3306" ["pm_dbname"]=> string(11) "wf_workflow" ["pm_dbserver_user"]=> string(5) "admin" ["pm_dbserver_passwd"]=> string(72) "xxxxxxx" ["domain"]=> string(16) "docker.6domainname.wew" ["maintenance"]=> int(0) ["ssl_verify"]=> int(0) ["db_version"]=> string(5) "4.0.0" ["max_cases_per_item"]=> int(0) } ["dohistory"]=> bool(false) ["history_blacklist"]=> array(0) { } ["auto_message_on_action"]=> bool(true) ["no_form_page"]=> bool(false) ["additional_fields_for_dictionnary"]=> array(0) { } ["fkfield":protected]=> string(0) "" ["searchopt":protected]=> bool(false) ["taborientation"]=> string(8) "vertical" ["get_item_to_display_tab"]=> bool(true) ["usenotepad":protected]=> bool(false) ["notificationqueueonaction"]=> bool(false) ["type":protected]=> int(-1) ["displaylist":protected]=> bool(true) ["showdebug"]=> bool(false) }

Url for GLPI in configuration: http://docker.6domainname.wew:6080

tomolimo commented 2 years ago

Questions:

  1. Does the host name known via DNS? If you do a ping to it, how is it answering?
  2. I can propose to add some logs into the PM plugin source code, are you ready for that?
tomolimo commented 2 years ago

It behaves like if something was preventing SOAP calls from GLPI source code to PM server

Wolvverine commented 2 years ago
  1. Yes, Ping answers correctly.
  2. Yes
tomolimo commented 2 years ago

First: there is a small SOAP tester in PM server (but not sure that I've packaged it with the custom release): could you check if you have the following files in the workflow/engine/methods/setup/ folder (on PM server)?

  1. webServices.php
  2. webServicesAjax.php
  3. webServicesList.php

if not, I'll send them to you

Wolvverine commented 2 years ago

I do not have them.

tomolimo commented 2 years ago

here they are: webServices.zip

tomolimo commented 2 years ago

these files were available in the PM 2.x releases but no more in the 3.x releases as the SOAP interface (even if it is still available) is no longuer maintained in the 3.x releases.

tomolimo commented 2 years ago

as soon as you have put these files into the PM folders, then we can start a small test goto http://pm host name/sysworkflow/en/neoclassic/setup/webServices it will request your PM login, enter any PM user with PROCESSMAKER_ADMIN rights and then you should land on this page: image I'm running https, but it's not neccessary

tomolimo commented 2 years ago

From here, if needed, you may change the Setup, but probably you don't need to.

  1. click on the Login [Test], enter the credentials you used in the PM plugin configuration in GLPI (admin/xxxxx), And then you should get: image This means that your PM admin user is correctly logged into PM server via SOAP
  2. then you may test the RoleList and you should get: image

You cannot test all the functions as for some, there is no data, as your PM server instances is new. But at least with the login and the role list, it shows if the SOAP interface is correctly set on the PM server

Wolvverine commented 2 years ago

image

tomolimo commented 2 years ago

you may change the Setup by a click the Setup

tomolimo commented 2 years ago

but I'm pretty sure that there is something wrong in the nginx confiiguration

tomolimo commented 2 years ago

did you follow this: https://github.com/tomolimo/processmaker-server/wiki/Inbound-rewrite-rules?

Wolvverine commented 2 years ago

open setup: image Change: image efect: image

Wolvverine commented 2 years ago

after login test: image

tomolimo commented 2 years ago

did you follow this: https://github.com/tomolimo/processmaker-server/wiki/Inbound-rewrite-rules?

Wolvverine commented 2 years ago

This: https://github.com/tomolimo/processmaker-server/wiki/Nginx

Server_name declaration was lost. Now is ok.

image image

Wolvverine commented 2 years ago

It seems there was a problem here. Now they see each other at GLPI.

Big THX.

Wolvverine commented 2 years ago

The question is whether it is possible to replace this declaration with a universal entry for different servers and domains?

tomolimo commented 2 years ago

which declaration?