OTRS + IIS + AJAX = Error During Ajax Communication

Moderator: crythias

Locked
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

I've been working on moving our OTRS 3.1.12 from Apache -> IIS so that I can get Integrated Authentication working. I am using ActiveState PERL and the perlex.dll as the IIS handler.

In this configuration, the AJAX queries appear to be unstable and often error out with "Error During AJAX Communication"

I've seen a few other threads that discussed some missing packages, but I have the URI:escape, JSON, and the DBD:mysql installed in my PPM.

Here is a Fiddler capture of a postback that throws an error:

Code: Select all

POST http://[HOST]:1080/otrs/index.pl? HTTP/1.1
Host: [HOST]:1080
Connection: keep-alive
Content-Length: 625
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://[HOST]:1080
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Content-Type: application/x-www-form-urlencoded
Referer: http://[HOST]:1080/otrs/index.pl?Action=AgentTicketPhone
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: CSID=1004c3a14495bcca07732d87215ab179d0; Session=102a46d4d72b39ef73c83c61b0ee00570f

FormID=1368489455.9937244.98855591;ExpandCustomerName=0;OwnerAll=;ResponsibleAll=;PreSelectedCustomerUser=;SelectedCustomerUser=[CUST];TicketID=;LinkTicketID=;CustomerKey=;CustomerTicketText=;CustomerSelected=1;CustomerKey_1=ian;CustomerTicketText_1=[STUFF]%3E;CustomerTicketCounterFromCustomer=1;FromCustomer=;Dest=%7C%7C-;NewUserID=;Subject=;Body=;AttachmentUpload=0;CustomerID=[STUFF];NextStateID=4;Month=5;Day=14;Year=2013;Hour=16;Minute=57;PriorityID=3;TimeUnits=;;ChallengeToken=[TOKEN];Action=AgentTicketPhone;Subaction=AJAXUpdate;ElementChanged=ServiceID
I enabled IIS failed request logging, but it doesn't seem to be giving me much that is useful other than telling me that there was a script error.

Any suggestions?
Last edited by invaderzog on 26 Sep 2014, 18:39, edited 1 time in total.
OTRS 3.1.12 / Windows / MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by crythias »

invaderzog wrote:from Apache -> IIS so that I can get Integrated Authentication working
Really? I'm using Windows SSO with Apache just fine.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

I would *love* to know how you pulled that off :)

It's been a while but I seem to recall that when I tried enabling the integrated authentication configuration in the apache conf files that I started getting PERL errors.

If you could share the details (or relevant segments) of your configuration files, I would appreciate it...
OTRS 3.1.12 / Windows / MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by crythias »

I browsed the interwebs to get information about keytabs, etc.
viewtopic.php?f=81&t=15422 has a conversation

<Directory "/opt/otrs/bin/cgi-bin/">
AllowOverride None
AuthType Kerberos
AuthName "Something"
KrbServiceName HTTP/otrsserver.domain@DOMAIN
Krb5Keytab /path/to/ticketingkeytabfile.extension
KrbMethodK5Passwd On
KrbAuthRealms DOMAIN
KrbMethodNegotiate on
KrbSaveCredentials off
Require valid-user

pretty much the hardest part is getting the keytab file and confirming it works. also you'll want auth_kerb and apache kerberos module.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

I noticed your config file had: <Directory "/opt/otrs/bin/cgi-bin/">

Is your configuration running completely on Windows? I recall that some of the architectures required that you set up a Linux box with Kerberos and I was hoping to avoid that.

When I was working on getting the integrated auth working with Apache, I was using SSPI (although I believe it was causing some PERL errors).

<Directory "C:/PROGRA~2/OTRS/OTRS/bin/cgi-bin/">

SSPIAuth On
SSPIAuthoritative On
SSPIDomain MYDOMAIN.COM
SSPIUsernameCase lower
SSPIOfferBasic On
Require valid-user

AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
OTRS 3.1.12 / Windows / MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by crythias »

Please edit your signature :) (see mine).

anyway there's this... but it may be old. No clue if it works.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

crythias wrote:Please edit your signature :) (see mine).

anyway there's this... but it may be old. No clue if it works.
That looks like the technique I was attempting except I was running into PERL errors (i.e. scripts would run fine until SSPI was enabled).

I ended up giving up on it and just trying to get the config working under IIS. Overall this worked out pretty well except the unfortunate AJAX errors.

I was just about to begin lamenting the difficulties in actually getting any useful debugging (i.e. specific error reports) out of IIS/ActiveState PERL/PerlEX when it occurred to me to google for that. I just learned that PerlEx.dll writes it's own log file in the PERL folder with error messages.

It looks like this is my problem:


*** 'C:\Program Files (x86)\OTRS\OTRS\bin\cgi-bin\index.pl' log message at: 2013/05/14 16:12:20
Precompiler: Execute Error:
Filename:[C:\Program Files (x86)\OTRS\OTRS\bin\cgi-bin\index.pl]
Package:[PerlEx::Precompiler::c_::program20files2028x8629::otrs::otrs::bin::cgi2dbin::index_pl]
Params[]
encountered object 'false', but neither allow_blessed nor convert_blessed settings are enabled at C:/Program Files (x86)/OTRS/OTRS/bin/cgi-bin/../../Kernel/System/JSON.pm line 110.

This appears to be the same issue that: viewtopic.php?t=10533&p=41004

Least this gives me something else to chase down...
OTRS 3.1.12 / Windows / MySQL
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

It's been a *long* time since I hacked any PERL, but I've taken a stab at modifying the KERNEL\SYSTEM\JSON.PM file. I tried adding two new lines:

# create additional objects
$Self->{JSONObject} = JSON->new();
$Self->{JSONObject}->allow_nonref(1);
$Self->{JSONObject}->allow_blessed(1);
$Self->{JSONObject}->convert_blessed(1);


This resolved my primary test case (attempting to create a new phone ticket), but it looks like there is still some sort of an issue with changing the Owner of an existing ticket.

When you pick a new owner in the drop down list, it instantly is blanked out afterwards and it throws this error:

*** 'C:\Program Files (x86)\OTRS\OTRS\bin\cgi-bin\index.pl' log message at: 2013/05/14 16:38:56
[Tue May 14 16:38:56 2013] -e: Use of uninitialized value $ServiceID in hash element at C:/Program Files (x86)/OTRS/OTRS/bin/cgi-bin/../../Kernel/Modules/AgentTicketActionCommon.pm line 842.

Looks like someone else had this problem before as well: viewtopic.php?t=17546&p=68325
OTRS 3.1.12 / Windows / MySQL
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

Sorry for the deluge of posts. I tried this:

Code: Select all

    # create additional objects
    $Self->{JSONObject} = JSON->new();
    $Self->{JSONObject}->allow_nonref(1);
#    $Self->{JSONObject}->allow_blessed(1);
    $Self->{JSONObject}->convert_blessed(1);
(i.e. just adding convert->blessed) and so far so good. I'm going to keep testing (and finger crossing)...
OTRS 3.1.12 / Windows / MySQL
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

Unfortunately, my attempted tweaks to the JSON.PM were not successful.

Unfortunately, It's been well over a decade since I've done any serious PERL development so trying to track down and resolve the problem is beyond the amount of time I can invest into the project.

I'm giving up for now and hoping that a future OTRS release (or perhaps PERL JSON library) will work better with OTRS + ActiveState PerlEx.Dll + IIS
OTRS 3.1.12 / Windows / MySQL
joecopty
Znuny newbie
Posts: 22
Joined: 11 Jan 2013, 01:42
Znuny Version: 3.2.6
Real Name: Joseph Copty
Company: TMC

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by joecopty »

Have you tried installing/updatign OTRS using the new windows installer. its still in beta but its a great improvement, takes care of the IIS configuration for you and everything. (To fix ajax errors i needed to remove the JSON::XS module as you woul dhave seen in this post)
Sydney, Australia
OTRS 3.3.6 on Windows Server 2003, IIS6 with MSSQL database
invaderzog
Znuny newbie
Posts: 9
Joined: 14 May 2013, 02:02
Znuny Version: 3.1.12

Re: OTRS + IIS + AJAX = Error During Ajax Communication

Post by invaderzog »

I'll give that a try next. Thanks for the suggestions :)
OTRS 3.1.12 / Windows / MySQL
Locked