Problem com cloudservice and proxy

Moderator: crythias

Locked
spinaldf
Znuny newbie
Posts: 48
Joined: 29 Apr 2019, 16:29
Znuny Version: 6community
Real Name: Luiz Guilherme

Problem com cloudservice and proxy

Post by spinaldf »

Dears,
I Disabled the cloudservice on otrs graphical. But It had several erros in log:

OTRS-otrs.Console.pl-Maint::CloudServices::ConnectionCheck-56[93171]: [Error][Kernel::System::WebUserAgent::Request][Line:221]: Can't perform POST on https://cloud.otrs.com/otrs/public.pl: 500 Can't connect to cloud.otrs.com:443 (timeout)

well, I have a idea, I executed this command.

su -c "/opt/otrs/bin/otrs.Console.pl Maint::CloudServices::ConnectionCheck" -s /bin/bash otrs
Checking OTRS cloud service connectivity...
Sending request with the following options:
Timeout: 15 second(s)

ERROR: OTRS-otrs.Console.pl-Maint::CloudServices::ConnectionCheck-56 Perl: 5.16.3 OS: linux Time: Tue Nov 26 17:19:10 2019

Message: Can't perform POST on https://cloud.otrs.com/otrs/public.pl: 500 Can't connect to cloud.otrs.com:443 (timeout)

Traceback (96926):
Module: Kernel::System::WebUserAgent::Request Line: 221
Module: Kernel::System::Console::Command::Maint::CloudServices::ConnectionCheck::Run Line: 93
Module: (eval) Line: 460
Module: Kernel::System::Console::BaseCommand::Execute Line: 454
Module: Kernel::System::Console::InterfaceConsole::Run Line: 80
Module: /opt/otrs/bin/otrs.Console.pl Line: 36

Response time: 15 second(s)

Response:
'Status' => '500 Can\'t connect to cloud.otrs.com:443 (timeout)'


I tried add to proxy in configuration of systemd

cat /usr/lib/systemd/system/otrs6.service
[Unit]
Description=OTRS: Open-source Ticket Request System, Copyright (C) 2001-2019 xxx
Documentation=https://otrs.github.io/doc/manual/admin/stable/en/html/
Requires=crond.service httpd.service postfix.service
After=crond.service httpd.service postfix.service

[Service]
Type=oneshot
RemainAfterExit=yes
Enviroment="http_proxy=http://myproyserver.default.com:5865"
Enviroment="https_proxy=http://myproyserver.default.com:5865"
Enviroment="ftp_proxy=http://myproyserver.default.com:5865"
ExecStart=/opt/otrs/bin/otrs.Daemon.pl start
ExecStart=su -c "/opt/otrs/bin/Cron.sh stop" -s /bin/bash otrs
ExecStop=/opt/otrs/bin/Cron.sh stop
ExecStop=/opt/otrs/bin/otrs.Daemon.pl stop
User=otrs
Group=apache

[Install]
WantedBy=multi-user.target


Then I found on the internet:

vim /opt/otrs/Kernel/System/WebUserAgent.pm

use Kernel::System::WebUserAgent;

my $WebUserAgentObject = Kernel::System::WebUserAgent->new(
Timeout => 15, # optional, timeout
Proxy => 'http://myproyserver.default.com:5865/', # optional, proxy
);


I added this configutarion this file WebUserAgent.pm, doesn't work too.

Then I did my last test:

su -c "/opt/otrs/bin/otrs.Console.pl Admin::Package::Install https://addons.znuny.com/api/addon_repos/public/ID:1029" -s /bin/bash otrs
Installing package...
ERROR: OTRS-otrs.Console.pl-Admin::Package::Install-56 Perl: 5.16.3 OS: linux Time: Tue Nov 26 17:25:27 2019

Message: Can't perform GET on https://addons.znuny.com/api/addon_repo ... D/otrs.xml: 500 Can't connect to addons.znuny.com:443 (Connection timed out)

Traceback (97241):
Module: Kernel::System::WebUserAgent::Request Line: 221
Module: Kernel::System::Package::_Download Line: 3636
Module: Kernel::System::Package::PackageOnlineList Line: 1451
Module: Kernel::System::Console::Command::Admin::Package::List::_PackageContentGet Line: 315
Module: Kernel::System::Console::Command::Admin::Package::Install::Run Line: 55
Module: (eval) Line: 460
Module: Kernel::System::Console::BaseCommand::Execute Line: 454
Module: Kernel::System::Console::InterfaceConsole::Run Line: 80
Module: /opt/otrs/bin/otrs.Console.pl Line: 36


I tried to exports enviroment variables, also doesn't work.
Other example:

su -c "https_proxy='https://myproyserver.default.com:5865' /opt/otrs/bin/otrs.Console.pl Maint::CloudServices::ConnectionCheck" -s /bin/bash otrs

Other example:

Add this option in /opt/otrs/Kernel/Config.pm
$Self->{'Package::Proxy'} = '/myproyserver.default.com:5865';


Detail: Proxy works with yum, wget and lynx, but with otrs application and scripts of otrs too no. :( :( :(

Any suggestion.
zzz
Znuny superhero
Posts: 914
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Problem com cloudservice and proxy

Post by zzz »

Hey,

If your proxy settings allow wget, download this file on your server (https://addons.znuny.com/api/addon_repo ... 029/latest) and install it locally with the console.

Code: Select all

su -c "/opt/otrs/bin/otrs.Console.pl Admin::Package::Install '/your/path/to/Znuny4OTRS-Repo-6.0.52.opm'" -s /bin/bash otrs
If I am correct, the package has an integrated blocker for these kinds of xxx connections.
And if your OTRS setting 'Package::Proxy' is set correctly, you should have no problem installing more packages from the package manager.

Best regards
Emin
Professional Znuny and OTRS services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem com cloudservice and proxy

Post by jojo »

correct setting is
WebUserAgent::Proxy
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
spinaldf
Znuny newbie
Posts: 48
Joined: 29 Apr 2019, 16:29
Znuny Version: 6community
Real Name: Luiz Guilherme

Re: Problem com cloudservice and proxy

Post by spinaldf »

Thanks for informations, but some example of configuration with "WebUserAgent::Proxy"? because with me doesn't work.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem com cloudservice and proxy

Post by jojo »

"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
spinaldf
Znuny newbie
Posts: 48
Joined: 29 Apr 2019, 16:29
Znuny Version: 6community
Real Name: Luiz Guilherme

Re: Problem com cloudservice and proxy

Post by spinaldf »

File: /opt/otrs/Kernel/System/WebUserAgent.pm
Detail: Doesn't work, but I dont have idea that why.
Look my config: "Part of file"

Kernel::System::WebUserAgent - a web user agent lib

=head1 DESCRIPTION

All web user agent functions.

=head1 PUBLIC INTERFACE

=head2 new()

create an object

use Kernel::System::WebUserAgent;

my $WebUserAgentObject = Kernel::System::WebUserAgent->new(
Timeout => 15, # optional, timeout
Proxy => 'http://10.1.0.99:5865/', # optional, proxy
);

=cut

sub new {
my ( $Type, %Param ) = @_;

# allocate new hash for object
my $Self = {};
bless( $Self, $Type );
# get database object
my $ConfigObject = $Kernel::OM->Get('Kernel::Config');

$Self->{Timeout} = $Param{Timeout} || $ConfigObject->Get('WebUserAgent::Timeout') || 15;
$Self->{Proxy} = $Param{Proxy} || $ConfigObject->Get('WebUserAgent::Proxy') || '';

return $Self;
}

=head2 Request()


I need to add another parameter or enable this config?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem com cloudservice and proxy

Post by jojo »

There is no need to change any code! Please use the system configuration for configuration and don't break the code with changes.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
spinaldf
Znuny newbie
Posts: 48
Joined: 29 Apr 2019, 16:29
Znuny Version: 6community
Real Name: Luiz Guilherme

Re: Problem com cloudservice and proxy

Post by spinaldf »

Ah thanks, now work. I change options in Graphical.
Locked