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.

Comments

kurtfoster’s picture

I 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.

rdeboer’s picture

I 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

likewhoa’s picture

I 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?

kurtfoster’s picture

I'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.

kurtfoster’s picture

OK, 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.

tkittich’s picture

Hello,

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.

kurtfoster’s picture

StatusFileSize
new561 bytes

Hi,

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.

rdeboer’s picture

Thanks kafmil,
I think this may be the way to go for now.
Rik

rdeboer’s picture

Checked in the change from #7, i.e.IPGV&M 7.x-1.x-dev.
Thanks for the suggestion kafmil.
Rik

kurtfoster’s picture

StatusFileSize
new652 bytes

Hi 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

rdeboer’s picture

@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

kurtfoster’s picture

It'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.

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

@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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.