Solved

Need assistance troubleshooting a javascript error message

Posted on 2014-01-07
17
320 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 43

Expert Comment

by:Rob
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 43

Expert Comment

by:Rob
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 43

Expert Comment

by:Rob
ID: 39774313
No, just whether you had more than one .htaccess in your directory structure
0
 
LVL 43

Expert Comment

by:Rob
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 43

Expert Comment

by:Rob
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 43

Accepted Solution

by:
Rob 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 43

Expert Comment

by:Rob
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 43

Expert Comment

by:Rob
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Custom Wordpress Loop 22 38
Implement a function similar to grep in vanilla Javascript 3 18
Test if unique ID is in log file 5 21
Javascript 2 20
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

840 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