GMap Markers disappear at Cron

manero24 - June 1, 2009 - 03:47
Project:GMap Module
Version:6.x-1.1-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I am using GMap and markers disappear each time a scheduled cron job is executed (once every hour). The maps show up but no markers then. In order to have them back, I have to manually click the Regenerate marker button and they reappear. Any idea what is wrong?

I'm using Drupal 6.12
CCK: 6.x-2.x-dev
Views: 6.x-2.5

Thanks!

#1

manero24 - June 3, 2009 - 23:08
Assigned to:manero24» Anonymous

I am using GMap and markers disappear each time a scheduled cron job is executed (once every hour). The maps show up but no markers then. In order to have them back, I have to manually click the Regenerate marker button and they reappear. Any idea what is wrong?

I'm using Drupal 6.12
CCK: 6.x-2.x-dev
Views: 6.x-2.5

Any idea?

#2

bbence - September 14, 2009 - 16:56
Component:Miscellaneous» Code
Category:support request» bug report

I'm having the same problem. For me the Regeneration doesn't solve the problem. The only way to get back the markers is to go through each node and resave them. When I resave a node with a marker (by the way I'm using a gmap views and displaying the markers based on taxonomy), the whole gmap displays the same marker. Only after saving every node with a different marker I get back the correct marker display (correct marker for each taxonomy term).
So again, the cron ruins the markers for me as well.

#3

Nathaniel - September 17, 2009 - 05:35

Looking for a solution to this...

When cron runs I get these error msg.
The directory sites/default/files/js is not writable, because it does not have the correct permissions set.

The selected file /tmp/fileC6eByR could not be uploaded, because the destination sites/default/files/js/gmap_markers.js could not be found, or because its permissions do not allow the file to be written.

#4

Nathaniel - September 17, 2009 - 17:46

Okay, I changed the folder permissions http://drupal.org/node/365062

and added/enabled the Clusterer2.js marker manager...

It has been working since last night and cron runs every hour.

#5

Nathaniel - September 18, 2009 - 20:59

Well, I lied. That didn't really work.

Trying another angle and adding this function to the end of cron.php:

gmap_regenerate_markers();

#6

pmonjo - September 24, 2009 - 07:55

Hi Nathaniel,

Have you had any luck with your latest approach? I am having exactly this issue.

Thanks!

Pedro

#7

Nathaniel - September 25, 2009 - 10:26

No luck with the above...

I updated to the latest dev version.

Then there was an error in the logs indicating that the marker path was invalid. It was returning the base url and base path for some reason, so I changed a line of code and it seems to be working fine now.

Around 504 ~

replaced base_path() with '/'

<?php

  $contents
.= "Drupal.gmap.iconpath = ". drupal_to_js('/'.variable_get('gmap_markerfiles', drupal_get_path('module', 'gmap') .'/markers')) .";\n";

?>

#8

bbence - October 1, 2009 - 11:00

It seems now to me that at least in my case, the markers get messed up when I'm clearing the cache. Coriously enough, it only happens when I clear the cache with the standard cache clearing button but not when I'm clicking the "Regenerate marker cache" of the admin page. But according to the code, in both cases the gmap_regenerate_markers function is called. I tried chaging several things here but I couldn't get it to work. So basically my issue is the following:

1. Whenever the cache is cleared, all my markers on gmap are reset to the default marker
2. If I go into editing one of the nodes and resave the node without changes, curiously the markers of that node appears and all the other nodes will get this marker, even though they should have a different marker
3. I'm using taxonomy markers and I resave all my nodes, it works until the drupal cache clearing is called
4. When the case of disappearing markers happen, if I set a default marker in my gmap Views, it gets displayed. So it seems that the markers associated with the taxonomy term cannot be found
5. But also the markers disappear not only for the gmap Views display, but also for the gmap block.

Any ideas?

Thanks!
Bence

#9

nirad - October 3, 2009 - 23:50

FWIW, this started happening to me after I moved my development site to a new computer. Both computers run Windows with WAMP. The new environment was running WAMP with PHP 5.3, but I had problems with 5.3 and Gmap (see: http://drupal.org/node/582934), so I downgraded to PHP 5.2.11. But I still have this problem with the taxonomy markers not showing up. I will try my development sites in different environments to see what works.

#10

dpatte - October 23, 2009 - 16:59

I had markers working then enabled cron on my site. Now markers are missing, though it does zoom in to the right location.
Regenerate markers doesnt seem to work for me though. Ideas?

#11

dpatte - October 24, 2009 - 03:56

To add more detail, I had a test system running than over a 1 day period i made the following changes:

- i enabled cron
- i upgraded pathauto to the latest version
- i upgraded fivestar to the latest version

Some time during that period, markers disappeared.

#12

dpatte - October 24, 2009 - 04:31

I noticed that my log file contains the following each 15 minutes since about the time i enabled cron:

[23-Oct-2009 22:00:02] PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent

presumably cron is having a problem that also showed up at the same time as my marker problem, and may be another sympton.

The first time that it got this error, it also got the following error:

[23-Oct-2009 08:30:12] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 75 bytes) in (my path)/sites/all/modules/gmap/gmap_markerinfo.inc on line 201

Is it possible that some cache file is corrupted? Which cache files should I clean out?

#13

dpatte - October 24, 2009 - 05:08

my cache settings are all disabled - but i decided to clear my cache anyway (admin/settings/performance) . lo and behold - my markers have all returned.
They have survive a cron run since then as well, but i still get cron errors.

#14

Nathaniel - November 22, 2009 - 20:41

Looks like it is a caching issue and file permissions.

In the end disabling optimize javascript files in site performance and clearing cache fixes the problem.

Or change file permissions if you want / have optimize javascript files enabled.

chmod 777 files/js

#15

dpatte - November 25, 2009 - 02:54

I dont see this problem anymore, and I believe I had a problem with cron (it was running out of memory). After fixing my cron memory problem, I have not seen this this problem again.

#16

pmonjo - December 4, 2009 - 18:11

I think that I have found the reason for this bug, at least in my case. Let me try to explain it.

I am running Drupal cron using the command "/path/to/drupal/scritps/drupal.sh --root /path/to/drupal". This sets the base_path to '/path/to/drupal'. Therefore, in function gmap_regenerate_markers() (in gmap.module, line 496), when recreating the markers cache, the parameter "Drupal.gmap.iconpath" is set to "/path/to/drupal/sites/all/files/js/gmap_markers.js" instead of "/sites/all/files/js/gmap_markers.js".

Running Drupal cron using curl, solves the problem.

Can this be considered a bug in drupal.sh or somewhere else?

 
 

Drupal is a registered trademark of Dries Buytaert.