Solved

Need assistance troubleshooting a javascript error message

Posted on 2014-01-07
17
314 Views
Last Modified: 2014-01-18
Hi Team,

   I am trying to troubleshoot an ajax plugin for my database front end web application where the ajax driven table is not appearing on the page.   When I turn on firebug to look at console messages, I keep seeing this:

"NetworkError: 403 Forbidden - https://pavlo/xataface-2.0.3/modules/DataGrid/js/ext-plugins/Select.js"

I navigated down from my apache document root to the directory below for /xataface-2.0.3/modules/DataGrid/js/ext-plugins....and i played with the ownership and flags of the file....right now I have this.

[root@pavlo js]# ls -l
total 588
-rwxrw-rw-. 1 root root  14978 Jan  2 17:52 DataGrid.js
-rwxrw-rw-. 1 root root    897 Jan  2 17:52 DataGrid_new.js
-rwxrw-rw-. 1 root root 538956 Jan  2 17:52 ext-all.js
-rwxrw-rw-. 1 root root  27836 Jan  2 17:52 ext-base.js
-rwxrw-rw-. 1 root root   8144 Jan  2 17:52 Ext-min.js
drwxrw-rw-. 2 root root   4096 Jan  2 17:52 ext-plugins
[root@pavlo js]# cd ext-plugins/
[root@pavlo ext-plugins]# ls -l
total 20
-rwxrwxrwx. 1 root root 17822 Jan  2 17:52 Select.js
[root@pavlo ext-plugins]# 

Open in new window

* I even changed the owner and group of Select.js to be apache, changed it to 777 (maximum permissions) but the error still persists.

How else can I troubleshoot exactly what is causing the 403 error message?

Thanks very much for all the help.
0
Comment
Question by:rleyba828
  • 8
  • 8
17 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 39764131
I navigated down from my apache document root to the directory below...
If the resource is in your document root, why the absolute URL and why the https?
0
 

Author Comment

by:rleyba828
ID: 39764203
Hi tom,

* My document root is /var/www/html/

* The path to the js file on the file system is  /var/www/html/xataface-2.0.3/modules/DataGrid/js/ext-plugins/Select.js"

* in the example above, pavlo is the name of the host and i have it's address in my host file.

* also, I turned off http  --> https redirection and looks like the problem shows up in both http and https.

thanks.
0
 

Author Comment

by:rleyba828
ID: 39764285
Finally...  I was able to get rid of the 403 error by changing my directory permissions from:

drwxrw-rw-. 2 root root   4096 Jan  2 17:52 ext-plugins

Open in new window

to
drwxrwxrwx. 2 root root   4096 Jan  2 17:52 ext-plugins

Open in new window


But my ajax grid was still showing up with empty rows.  I now need to rephrase my question to:   What tools are available to troubleshoot ajax?

Thanks and regards,
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39764288
nothing in your .htaccess that would be preventing access?
0
 

Author Comment

by:rleyba828
ID: 39764400
hi rob.....the only thing in my .htaccess is:

[root@pavlo pavlo]# cat .htaccess
<FilesMatch "\.ini$">
Deny from all
</FilesMatch>[root@pavlo pavlo]# 

Open in new window

0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39764652
Is that the only one in use in the file path
0
 

Author Comment

by:rleyba828
ID: 39774309
Hi Rob....sorry for the late reply.    I'm not sure I understand what you mean.

 I have this output
[root@pavlo ~]# echo $PATH
/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@pavlo ~]# 

Open in new window

It this what you mean?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39774313
No, just whether you had more than one .htaccess in your directory structure
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39774314
Such as the ext-plugins folder
0
 

Author Comment

by:rleyba828
ID: 39774579
OK gotcha...  I checked, and there is no other .htaccess anywhere in the directory branch from
  /var/www/html/xataface-2.0.3/
all the way down to   /var/www/html/xataface-2.0.3/modules/DataGrid/js/ext-plugins/Select.js"

So there is only one .htaccess file and it is in the /var/www/html/xataface-2.0.3/pavlo/ directory.

thanks.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39774596
Great, just had to rule that out.
When you get the error in fire bug
E.g.
https://pavlo/xataface-2.0.3/modules/DataGrid/js/ext-plugins/Select.js
What is the address you have the browser address bar?
If the https and the pavlo parts differ then it's not allowed
0
 

Author Comment

by:rleyba828
ID: 39774609
...well the errors that I originally saw in firebug have disappeared after i changed the directory permissions (post id: ID: 39764285 above).   However, the ajax table is still showing blank.   So I now need some AJAX debugging utility to let me know whether the Select.js  script is making the ajax call and from the php side whether the database actually received any javascript queries.  Would you know if there is any plugin/utility/debug tool that can do this?

*Also, not sure if it is relevant, but when I installed my apache, mysql, php, xataface software, and my DataGrid JS plugins,   my Centos SE linux feature was turned on.   Ultimately, I disabled  selinux by going to /etc/selinux/config then do SELINUX=disabled, did a fresh reboot and continuing from there.  Do you think selinux being initally "enabled"  affected the installation?   My other option of course is to keep SELINUX off, just to test, and then reinstall all my database and apache, JS, etc.  What do you think?

thanks
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 39775400
selinux wouldn't have affected the installation of those items but it would affect how they talk to each other.  I've had a lot of trouble getting iptables (firewall) rules right as well.  The PHP/MySQL/Apache has issues until you allow the right users the right permissions.
I turned it all off (on my local machine) for testing and development so at least I know it works before moving it to the production environment.

That said, for troubleshooting ajax you should still be able to use firebug or the built in debugger where there is a network tab you can monitor the requests and responses.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39775405
I've just realised looking at your first post that you need read + execute permissions on all your js files to even be able to make it work.
0
 

Author Comment

by:rleyba828
ID: 39778920
Hi rob....did this....  I made everything js writable, readable, executable...full permissions....

[root@pavlo js]# ls -al
total 596
drwxr-xr-x. 3 root root   4096 Jan  2 17:52 .
drwxr-xr-x. 7 root root   4096 Jan  2 17:52 ..
-rwxrwxrwx. 1 root root  14978 Jan  2 17:52 DataGrid.js
-rwxrwxrwx. 1 root root    897 Jan  2 17:52 DataGrid_new.js
-rwxrwxrwx. 1 root root 538956 Jan  2 17:52 ext-all.js
-rwxrwxrwx. 1 root root  27836 Jan  2 17:52 ext-base.js
-rwxrwxrwx. 1 root root   8144 Jan  2 17:52 Ext-min.js
drwxrwxrwx. 2 root root   4096 Jan  2 17:52 ext-plugins
[root@pavlo js]# cd ext-plugins
[root@pavlo ext-plugins]# ls -l
total 20
-rwxrwxrwx. 1 root root 17822 Jan  2 17:52 Select.js

Open in new window



Then restarted mysqld and httpd and still no change...... I still can't see the ajax table.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39778939
That said, for troubleshooting ajax you should still be able to use firebug or the built in debugger where there is a network tab you can monitor the requests and responses.
Have you tried that?
0
 

Author Comment

by:rleyba828
ID: 39791718
Hi rob....looked at all messages in firebug, debugger, and only saw normal gets and 200 OK messages.....

At this point, I'll just do a re-install, turn of SE Linux and firewall, put in ajax plugin, then make sure everything works before I tighten security again.

Thanks a lot for all your help and suggestions.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now