I am randomly getting the error "IPGV&M: an HTTP error 404 occurred" in an alert window as I perform tasks around my site, it is inconsistent so it's hard to track down what the cause is. I believe this is an issue because I denied the website from using my location, this is happening in Chrome at the moment, I have tested other browsers. It happens most frequently when I do something like save an entity or perform an ajax function. It happens less frequently while cruising around the site.
I am trying to do a bit of debugging on this myself, but the main cause appears to me to be when the user denies access to the Location service.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | IPGVM-HTTP-error-404-2158847-10.patch | 652 bytes | kurtfoster |
| #7 | IPGVM-HTTP-error-404-2158847-7.patch | 561 bytes | kurtfoster |
Comments
Comment #1
kurtfoster commentedI added the callback_url in teh function Drupal.behaviors.addCurrentLocation in the file ip_geoloc_current_location.js. Now I get the error:
IPGV&M: an HTTP error 404 occurred. /undefined
So somewhere undefined is being passed through as the callback. I'll add in any further debugging info I can dig up for you. It would be great to get this fixed. I'd like to use this module on a very large project i'm working on, and I can't afford to have these alerts pop up. If I can't get them debugged, I might just add in a debug flag or something to disable all of the alerts unless the user has selected debug mode. Alerts aren't a great way to show a user an issue.
Comment #2
rdeboerI agree this is not great.
But like you I'm at a loss to explain what exactly happens...
Any further clues welcome.
By the way... have you tried 7.x-1.x-dev with high performance JS?
See this section in the README:
HIGH PERFORMANCE AJAX
=====================
IPGV&M will take advantage of the "High-performance Javascript callback
handler", if installed. Here are its installation instructions for Apache,
in bullet form. For Nginx, see http://drupal.org/node/1876418
o download and enable https://drupal.org/project/js (7.x-1.0-beta3 or later)
o copy the file sites/all/modules/js/js.php to the document root, i.e where
index.php lives
o visit admin/config/system/js which displays a number of lines tailored for
your server
o copy those lines and paste them into the .htaccess file in the document-root,
immediately below the line "RewriteEngine on".
IPGV&M will now perform its AJAX calls more efficiently. To switch this feature
off, comment out the newly added lines from the .htaccess file (# in front).
Rik
Comment #3
likewhoa commentedI can only reproduce this issue if working from a localhost server since the ip cannot be mapped. Not sure if this is a bug or not but once I work from the remote server it goes away.
@kafmil are you working from a localhost environment?
Comment #4
kurtfoster commentedI'm working on my local, but I think it happens on my staging server as well, I'll need to check, I keep switching between the two so I can't remember. Also, it happens randomly so it's not easy to tell. I unfortunately haven't had a chance to keep debugging this one, this are a bit flat out at the moment.
Comment #5
kurtfoster commentedOK, just tested it again, it's definitely not working on the staging server, but it has http auth as well so that could be an issue.
Comment #6
tkittich commentedHello,
I just ran into the same error. This seems to be caused by /ip-geoloc-current-location returning a 404 not found error. For my case, clean URLs is not enabled so posting to /ip-geoloc-current-location will give a 404 error.
Comment #7
kurtfoster commentedHi,
I need to have a quick solution on this so I've made a patch that just removes the alert. It doesn't completely solve the issue as I'm still not sure what'a causing the 404, but it gets rid of the symptom; good enough for me with now.
Comment #8
rdeboerThanks kafmil,
I think this may be the way to go for now.
Rik
Comment #9
rdeboerChecked in the change from #7, i.e.IPGV&M 7.x-1.x-dev.
Thanks for the suggestion kafmil.
Rik
Comment #10
kurtfoster commentedHi RdeBoer,
I'm hosting a site on acquia and on that server I'm getting the same pop up with a 503. I've made the attached patch for remove the 503 as well.
kafmil
Comment #11
rdeboer@kafmil, #10
Is this 503 intermittent or does it happen all the time. If it happens all the time, then you won't get the current location functionality, do you?
Rik
Comment #12
kurtfoster commentedIt's an intermittent issue. As with the 504, the alert message is a bit too much in my opinion, it's not great UX. Prepending a div somewhere with the message would give the user the feedback, while not preventing them from continuing with what they're doing. I'm just not a fan of alert messages outside of debugging. I also hate the drupal alert that appears when you click something before whatever ajax it is has finished doing what it's doing.
Comment #13
rdeboer@kafmil, #10, #12.
Have added 503 to the list of exclusions. Checked in. Avail in 7.x-1.x-dev now and 7.x-1.25 when it comes out
Agree that JS alerts aren't great, but they're cheap and easy to do!
Rik