RotherOSS / otobo

OTOBO is one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. https://otobo.io/
GNU General Public License v3.0
256 stars 75 forks source link

Attachments for customer does not work #1301

Closed remyd1 closed 2 years ago

remyd1 commented 3 years ago

Hi,

I found this issue on your forum, but there is no answer. I think we have the same issue here.

Attachments as an admin/operator is working from index.pl?ChallengeToken=...&Action=AgentTicketCompose, but not as a standard user from customer.pl?Action=CustomerTicketZoom;TicketNumber=... or customer.pl?Action=CustomerTicketMessage.

I looked into the logs and found only these messages:

Wed Sep 29 11:35:18 2021 (Europe/Paris) | error | OTOBO-CGI-54 | Module Kernel::Modules::AgentPassword not registered in Kernel/Config.pm!
-- | -- | -- | --
Wed Sep 29 11:35:10 2021 (Europe/Paris) | error | OTOBO-CGI-54 | Module Kernel::Modules::AgentPassword not registered in Kernel/Config.pm!
Wed Sep 29 11:11:13 2021 (Europe/Paris) | error | OTOBO-CGI-54 | DebugLog error:  Summary: Error while  performing REST 'DELETE' request to Controller '/tmpattachments/_doc/'  on Host 'http://localhost:9200'. Response code '405'.  Data   : Error  while performing REST 'DELETE' request to Controller  '/tmpattachments/_doc/' on Host 'http://localhost:9200'. Response code  '405'..
Wed Sep 29 11:11:13 2021 (Europe/Paris) | error | OTOBO-CGI-54 | DebugLog error:  Summary: Error while  performing REST 'DELETE' request to Controller '/tmpattachments/_doc/'  on Host 'http://localhost:9200'. Response code '405'.  Data   : Response  content: '{"error":"Incorrect HTTP method for uri  [/tmpattachments/_doc/] and method [DELETE], allowed:  [POST]","status":405}'.
Wed Sep 29 11:11:12 2021 (Europe/Paris) | error | OTOBO-CGI-54 | DebugLog error:  Summary: Error while  performing REST 'GET' request to Controller '/tmpattachments/_doc/' on  Host 'http://localhost:9200'. Response code '405'.  Data   : Error while  performing REST 'GET' request to Controller '/tmpattachments/_doc/' on  Host 'http://localhost:9200'. Response code '405'..
Wed Sep 29 11:11:12 2021 (Europe/Paris) | error | OTOBO-CGI-54 | DebugLog error:  Summary: Error while  performing REST 'GET' request to Controller '/tmpattachments/_doc/' on  Host 'http://localhost:9200'. Response code '405'.  Data   : Response  content: '{"error":"Incorrect HTTP method for uri  [/tmpattachments/_doc/] and method [GET], allowed:  [POST]","status":405}'.
Wed Sep 29 11:11:12 2021 (Europe/Paris) | error | OTOBO-CGI-54 | DebugLog error:  Summary: Error while  performing REST 'POST' request to Controller  '/tmpattachments/_doc/?pipeline=Attachments' on Host  'http://localhost:9200'. Response code '400'.  Data   : Error while  performing REST 'POST' request to Controller  '/tmpattachments/_doc/?pipeline=Attachments' on Host  'http://localhost:9200'. Response code '400'..
Wed Sep 29 11:11:11 2021 (Europe/Paris) | error | OTOBO-CGI-54 | DebugLog error:  Summary: Error while  performing REST 'POST' request to Controller  '/tmpattachments/_doc/?pipeline=Attachments' on Host  'http://localhost:9200'. Response code '400'.  Data   : Response  content:  '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"pipeline  with id [Attachments] does not  exist"}],"type":"illegal_argument_exception","reason":"pipeline with id  [Attachments] does not exist"},"status":400}'.

I checked that elasticsearch is working and it seems to work fine and listening on port 9200.

ss -plantu |grep 9200
tcp   LISTEN    0      128      [::ffff:127.0.0.1]:9200                 *:*      users:(("java",pid=233,fd=313))                                                
tcp   LISTEN    0      128                   [::1]:9200              [::]:*      users:(("java",pid=233,fd=312)) 

I also double checked installation documentation, but everything here seems to be ok.

However, as I was thinking about permission issue, I have been unable to find any tmpattachments or attachments directory on the server.

I am a bit lost. I do not know if this may be related to this issue.

Any help would be greatly appreciated,

Thanks,

Best regards, Rémy

edit: otobo version 10.0.11

remyd1 commented 3 years ago

Same issue with otobo version 10.0.12.

Operating system Ubuntu 20.04.2 LTS.

Elastisearch with plugins:

/usr/share/elasticsearch/bin/elasticsearch-plugin list
analysis-icu
ingest-attachment

Otobo modules:

/opt/otobo/bin/otobo.CheckModules.pl --list

Required packages:
  o Archive::Tar.....................ok (v2.32)
  o Archive::Zip.....................ok (v1.67)
  o Class::Method::Modifiers.........ok (v2.13)
  o Date::Format.....................ok (v2.24)
  o DateTime.........................ok (v1.51)
    o DateTime::TimeZone.............ok (v2.38)
  o Convert::BinHex..................ok (v1.125)
  o DBI..............................ok (v1.643)
  o Digest::SHA......................ok (v6.02)
  o LWP::UserAgent...................ok (v6.26)
  o Moo..............................ok (v2.003006)
  o namespace::autoclean.............ok (v0.29)
  o Net::DNS.........................ok (v1.22)
  o Net::SMTP::SSL...................ok (v1.04)
  o Sub::Exporter....................ok (v0.987)
  o Template::Toolkit................ok (undef)
  o Template::Stash::XS..............ok (undef)
  o Time::HiRes......................ok (v1.9760)
  o Try::Tiny........................ok (v0.30)
  o URI..............................ok (v1.71)
  o XML::LibXML......................ok (v2.0134)
  o YAML::XS.........................ok (v0.81)
  o Unicode::Collate.................ok (v1.27)

Recommended features for setups using apache:
  o ModPerl::Util....................ok (v2.000011)
  o Apache::DBI......................ok (v1.12)
  o Apache2::Reload..................ok (v0.13)

Database support (installing one is required):
  o DBD::mysql.......................ok (v4.050)

Various features for additional functionality:
  o Encode::HanExtra.................ok (v0.23)
  o Net::LDAP........................ok (v0.66)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
  o XML::LibXSLT.....................ok (v1.99)
  o XML::Parser......................ok (v2.46)

Features enabling communication with a mail-server:
  o Net::SMTP........................ok (v3.11)
  o Mail::IMAPClient.................ok (v3.42)
  o Authen::SASL.....................ok (v2.16)
  o Authen::NTLM.....................ok (v1.09)
  o IO::Socket::SSL..................ok (v2.067)

Optional features which can increase performance:
  o JSON::XS.........................ok (v4.02)
  o Text::CSV_XS.....................ok (v1.41)
svenoe commented 3 years ago

Hi Rémy,

we are currently extremely busy with 10.1 and a lot of customer requests and unfortunately don't have the ressources to answer all questions in the forum, currently. Someone wrote that he cannot reproduce this problem, there, and I cannot either... Have you done a clean install and just added one customer(user) to try this out?

The Elasticsearch errors don't mean too much in any case - if there was an error with the upload prior to this, I would assume the errors are just a consequence of the attachment not being present for some reason. As a test you could set the Elasticsearch Webservice to invalid in Admin->Webservices and deactivate Elasticsearch in the SysConfig under "Elasticsearch::Active". OTOBO is not dependent on it, and this way we could exclude it as the source of the problem.

Just as a check, also could you have a look at the SysConfig-option "HttpType" and check whether it aligns with the actual type you are using? I don't think this is the reason, but it's the only thing which remotely comes to my mind when thinking about it right now.

Lastly you have linked this issue in your opening post, where you said, it could be related to it. What is the other problem you are having?

Best regards, Sven

possebon commented 2 years ago

Hi @remyd1 and @svenoe ,

I'm the one that posted on the forum this issue.

I'm still facing the issue, even after installing a new server, with the latest version 10.0.13 of OTOBO.

The only difference from Rémy is that my server is running on CentOS 8.

I can't see anything on logs. In fact, on the latest version, I don't have any message on the log.

I already changed on Sysconfig the MinimumLogLevel to debug and even this way I can't have any message on log.

Two particular settings that probably is different from someone that installs the otobo from scratch: I have configured on Apache to not use the /otobo at URL:

ScriptAlias /otobo/ "/opt/otobo/bin/cgi-bin/"
Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"

And my setting is:

    # Please change here the otobo admin mail address
    ServerAdmin myaccount@mydomain.com

    # Please change here the FQDN or hostname, you like to use with OTOBO
    ServerName servicedesk.mydomain.com

    # Please change here and add more different FQDN´s or hostnames, you like to use with OTOBO
    ServerAlias servicedesk.mydomain.com
    DocumentRoot /opt/otobo/var/httpd/htdocs
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature Off

    Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"
    ScriptAlias / "/opt/otobo/bin/cgi-bin/"

And also, I have an additional apache.conf file for the customer interface:

<VirtualHost *:80>
    # Please change here the otobo admin mail address
    ServerAdmin support@mydomain.com

    # Please change here the FQDN or hostname, you like to use with OTOBO
    ServerName support@mydomain.com

    # Please change here and add more different FQDN´s or hostnames, you like to use with OTOBO
    ServerAlias support@mydomain.com
    DocumentRoot /opt/otobo/var/httpd/htdocs
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature Off

    Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"
    ScriptAlias / "/opt/otobo/bin/cgi-bin/"

    # Please change here the redirect to https and add your FQDN or hostname
    #Redirect permanent / http://suporte.marcotextil.com.br/

    <IfModule mod_perl.c>

    # Setup environment and preload modules
    PerlOptions +Parent
    Perlrequire /opt/otobo/scripts/apache2-perl-startup.pl

    # Reload Perl modules when changed on disk
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload

    # general mod_perl2 options
    <Location />
        DirectoryIndex customer.pl
        AddHandler  perl-script .pl .cgi
        ErrorDocument 403 /otobo/customer.pl
        #ErrorDocument 403 /otobo/index.pl
        #SetHandler  perl-script
        PerlResponseHandler ModPerl::Registry
        Options +ExecCGI
        PerlOptions +ParseHeaders
        PerlOptions +SetupEnv

        <IfModule mod_version.c>
            <IfVersion < 2.4>
                Order allow,deny
                Allow from all
            </IfVersion>
            <IfVersion >= 2.4>
                Require all granted
            </IfVersion>
        </IfModule>
        <IfModule !mod_version.c>
            Order allow,deny
            Allow from all
        </IfModule>
    </Location>

</IfModule>

And the last difference in my scenario, all requests are done by nginx a reverse-proxy where I have the SSL certificates.

But, I already tested doing requests directly to Apache and the issue still occurs.

I did the check and test that Sven suggested (disabling Elasticsearch) but in my case, nothing changed.

If there is a way to enable some logs and detail more about this issue, please let me know.

Best regards,

Possebon

possebon commented 2 years ago

Hi @remyd1 and @svenoe ,

I'm the one that posted on the forum this issue.

I'm still facing the issue, even after installing a new server, with the latest version 10.0.13 of OTOBO.

The only difference from Rémy is that my server is running on CentOS 8.

I can't see anything on logs. In fact, on the latest version, I don't have any message on the log.

I already changed on Sysconfig the MinimumLogLevel to debug and even this way I can't have any message on log.

Two particular settings that probably is different from someone that installs the otobo from scratch: I have configured on Apache to not use the /otobo at URL:

ScriptAlias /otobo/ "/opt/otobo/bin/cgi-bin/"
Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"

And my setting is:

    # Please change here the otobo admin mail address
    ServerAdmin myaccount@mydomain.com

    # Please change here the FQDN or hostname, you like to use with OTOBO
    ServerName servicedesk.mydomain.com

    # Please change here and add more different FQDN´s or hostnames, you like to use with OTOBO
    ServerAlias servicedesk.mydomain.com
    DocumentRoot /opt/otobo/var/httpd/htdocs
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature Off

    Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"
    ScriptAlias / "/opt/otobo/bin/cgi-bin/"

And also, I have an additional apache.conf file for the customer interface:

<VirtualHost *:80>
    # Please change here the otobo admin mail address
    ServerAdmin support@mydomain.com

    # Please change here the FQDN or hostname, you like to use with OTOBO
    ServerName support@mydomain.com

    # Please change here and add more different FQDN´s or hostnames, you like to use with OTOBO
    ServerAlias support@mydomain.com
    DocumentRoot /opt/otobo/var/httpd/htdocs
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature Off

    Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"
    ScriptAlias / "/opt/otobo/bin/cgi-bin/"

    # Please change here the redirect to https and add your FQDN or hostname
    #Redirect permanent / http://suporte.marcotextil.com.br/

    <IfModule mod_perl.c>

    # Setup environment and preload modules
    PerlOptions +Parent
    Perlrequire /opt/otobo/scripts/apache2-perl-startup.pl

    # Reload Perl modules when changed on disk
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload

    # general mod_perl2 options
    <Location />
        DirectoryIndex customer.pl
        AddHandler  perl-script .pl .cgi
        ErrorDocument 403 /otobo/customer.pl
        #ErrorDocument 403 /otobo/index.pl
        #SetHandler  perl-script
        PerlResponseHandler ModPerl::Registry
        Options +ExecCGI
        PerlOptions +ParseHeaders
        PerlOptions +SetupEnv

        <IfModule mod_version.c>
            <IfVersion < 2.4>
                Order allow,deny
                Allow from all
            </IfVersion>
            <IfVersion >= 2.4>
                Require all granted
            </IfVersion>
        </IfModule>
        <IfModule !mod_version.c>
            Order allow,deny
            Allow from all
        </IfModule>
    </Location>

</IfModule>

And the last difference in my scenario, all requests are done by nginx a reverse-proxy where I have the SSL certificates.

But, I already tested doing requests directly to Apache and the issue still occurs.

I did the check and test that Sven suggested (disabling Elasticsearch) but in my case, nothing changed.

If there is a way to enable some logs and detail more about this issue, please let me know.

Best regards,

Possebon

An update, I did a test now, I disabled my Apache settings, changing back to the original one, and now the attachments are saved correctly.

I have the same setting working for different instances running on customers but of OTRS. The same configuration used on OTRS seems not to be working on OTOBO.

possebon commented 2 years ago

Hi @remyd1 and @svenoe ,

I fixed my issue finally. in my case, I forgot to change the ScriptAlias variable on SysConfig.

Since I changed the Apache config to do not use. the /otobo at URI, I need to reflect this change either on SysConfig. The default value is/otoboand it was on not working instance.

Best regards,

svenoe commented 2 years ago

Hi @possebon,

thanks for letting us know. Hopefully it will be the same for @remyd1 .

Best regards, Sven

remyd1 commented 2 years ago

Hi,

I checked all this stuff:

And still no luck...

I also edited my first post to reference the right issue.

Nevertheless, I think my apache configuration is a bit different than the official one; Here are the differences:

diff -Ebw /opt/otobo/scripts/apache2-httpd-vhost-443.include.conf /etc/apache2/sites-available/zzz_otobo-443.conf
10c10
<     ServerAdmin mail@otobo.de
---
>     ServerAdmin support@tld.com
13c13
<     ServerName helpdesk.otobo.de
---
>     ServerName otobo.tld.com
15,16c15,20
<     # Please change here and add more different FQDN´s or hostnames, you like to use with OTOBO
<     ServerAlias www.helpdesk.otobo.de
---
>     # Please change here and add more different FQDN or hostnames, you like to use with OTOBO
>     ServerAlias help.tld.com
>     ServerAlias helpdesk.tld.com
>     ServerAlias support.tld.com
>     ServerAlias ticket.tld.com
>     ServerAlias tickets.tld.com
25a30,36
>     RewriteEngine On
>     RewriteRule "^(/?)$" "/otobo/customer.pl" [PT]
>     RewriteRule "^/ticket(/?)$" "/otobo/"
>     RewriteRule "^/support(/?)$" "/otobo/"
>     RewriteRule "^/help(/?)$" "/otobo/"
>     RewriteRule "^/otobo(/?)$" "/otobo/customer.pl" [PT]
> 
29,38c40,41
< 
<         # Please add the path to the ssl cert
<         SSLCertificateFile /etc/ssl/certs/otobo.de.cert
< 
<         # Please add the path to the ssl key
<         SSLCertificateKeyFile /etc/ssl/private/otobo.de.nopass.key
< 
<         # Please add the path to the ssl chain file (Download from used ssl cert publisher)
<         SSLCertificateChainFile /etc/ssl/certs/linux_intermediate_otobo.ch.pem
< 
---
>       SSLCertificateFile /etc/letsencrypt/live/otobo.tld.com/fullchain.pem
>       SSLCertificateKeyFile /etc/letsencrypt/live/otobo.tld.com/privkey.pem
39a43,44
>   ErrorLog ${APACHE_LOG_DIR}/otobo-error.log
>   CustomLog ${APACHE_LOG_DIR}/otobo-access.log combined
43,45d47
<         # Use a dedicated Perl interpreter for the current virtual host, in this case  the virtual host serving port 443
<         PerlOptions +Parent
< 
46a49
>         PerlOptions +Parent

My http configuration is really simple as it redirects to https:

# --
# Copyright (C) 2019-2021 Rother OSS GmbH, https://otobo.de/
# added for OTOBO (http://otobo.de/)
# --

# Please change here * to the server IP-address
<VirtualHost *:80>
    # Please change here the otobo admin mail address
    ServerAdmin support@tld.com
    # Please change here the FQDN or hostname, you like to use with OTOBO
    ServerName otobo.tld.com

    # Please change here and add more different FQDN or hostnames, you like to use with OTOBO
    ServerAlias help.tld.com
    ServerAlias helpdesk.tld.com
    ServerAlias support.tld.com
    ServerAlias ticket.tld.com
    ServerAlias tickets.tld.com

    DocumentRoot /opt/otobo/var/httpd/htdocs
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature Off

    ScriptAlias /otobo/ "/opt/otobo/bin/cgi-bin/"
    Alias /otobo-web/ "/opt/otobo/var/httpd/htdocs/"

    # Please change here the redirect to https and add your FQDN or hostname
    RedirectMatch 301 ^/((?!\.well-known).*)$ https://otobo.tld.com/$1

    <Directory /opt/otobo/var/httpd/htdocs/.well-known>
        Options +Indexes +FollowSymlinks
        Require all granted
    </Directory>
</VirtualHost>

I changed all my domain information for anonymisation purpose.

Any idea would be helpful.

bschmalhofer commented 2 years ago

I think that the referenced issue #907 is not related to this issue. Issue 907 was, if I recall correctly, about changed layout in the customer interface, which derailed the Selenium test scripts.

svenoe commented 2 years ago

Ok, @remyd1 - to me this looks more like a support problem now, especially if you have some non standard apache configurations and so. Also it worked for @possebon.

Github is really only to coordinate the development, we do not have the ressources to help with configuration problems, here, at the moment, so I will close this issue and ask you try to get help in the forums again, or contact us directly for professional support, sorry. I would advice you to prepare a clean OTOBO install, see whether it works there, which I assume, and then slowly adapt your current configuration.

I hope for your understanding, best regards, Sven