Firstly, the channel matching does not work because I'm getting slightly malformed paths after serve.php. Is this a server issue? Example:
serve.php?q=1&c=file&f=5&p=sites/default/files&t=18&u=node/398

When I fix it manually for the purposes of debugging, it still doesn't do what I want. Here's the code:

ad_dir: '/home/mambear/www/sites/all/modules/ad'
debug: '2'
adcache: 'file'
nids: ''
tids: '18'
hostid: ''
url: ''
quantity: '1'
aid: '0'
ad_display: 'javascript'
Attempting to include cache include file '/home/mambear/www/sites/all/modules/ad/cache/file/ad_cache_file.inc'.
--> Time mark: 09:27:31
Memory usage: 471.184 K
Drupal bootstrap '0'.
Drupal bootstrap complete.
Root drupal directory detected as '/home/mambear/www'.

/home/mambear/www/sites/all/modules/ad/serve.php: // $Id: serve.php,v 1.1.2.2.2.1.2.1 2009/02/23 22:39:02 jeremy Exp $
/home/mambear/www/sites/all/modules/ad/adserve.inc: // $Id: adserve.inc,v 1.1.2.31.2.8.2.7 2009/04/09 14:06:27 jeremy Exp $
/home/mambear/www/sites/all/modules/ad/adcache.inc:
/home/mambear/www/sites/all/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.83.2.16.2.21 2009/04/16 14:24:53 jeremy Exp $
/home/mambear/www/sites/all/modules/ad/ad.install: // $Id: ad.install,v 1.2.2.4.2.27.2.7.2.4 2009/04/03 17:01:02 jeremy Exp $

adserve_cache function(get_ad_ids)
Cache function 'ad_cache_file_get_ad_ids' does not exist.
Memory usage: 478.789 K
Invoking cache function 'adserve_cache_get_ad_ids'.
Entering default adserve_display.
adserve_cache function(open)
Memory usage: 479.047 K
Invoking cache function 'ad_cache_file_open'.
File cache: open
Trying cache_file '/home/mambear/www/sites/default/files/.1.ad.cache'.
Obtained lock on final cache file.
File cache: last sync: 1241193338
File cache: current time: 1241195251
File cache: cron will resync cache the next time it runs.
Hostid: 'none'.
adserve_invoke_hook hook(init) action(first)
adserve_cache function(hook)
Memory usage: 521.309 K
Invoking cache function 'ad_cache_file_hook'.
File cache: hook 'init' not found.
Function 'adserve_hook_init' does not exist.
adserve_cache function(id)
Memory usage: 521.672 K
Invoking cache function 'ad_cache_file_id'.
File cache: ad_cache_file_id type(host) id() hostid(none)
Searching tids: 18
adserve_cache function(id)
Memory usage: 522.035 K
Invoking cache function 'ad_cache_file_id'.
File cache: ad_cache_file_id type(tids) id(18) hostid(none)
Total ads: '9'.
Already displayed: 0
adserve_cache function(validate)
Memory usage: 522.883 K
Invoking cache function 'ad_cache_file_validate'.
File cache: found 9 valid advertisements.
Validated ads: '9'.
adserve_invoke_hook hook(filter) action(intersect)
adserve_cache function(hook)
Memory usage: 524.703 K
Invoking cache function 'ad_cache_file_hook'.
Including file: '/home/mambear/www/sites/all/modules/ad/channel/ad_channel.inc'.
Invoking 'ad_channel_cache_filter'.
ad_channel_cache: adserve_cache_filter
adserve_cache function(get_cache)
Memory usage: 559.453 K
Invoking cache function 'ad_cache_file_get_cache'.
ad_channel_cache: checking aid(75)
ad_channel_cache: aid(75) has no channel info [0]
ad_channel_cache: aid(75) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(76)
ad_channel_cache: aid(76) has no channel info [0]
ad_channel_cache: aid(76) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(77)
ad_channel_cache: aid(77) has no channel info [0]
ad_channel_cache: aid(77) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(253)
ad_channel_cache: aid(253) has no channel info [0]
ad_channel_cache: aid(253) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(116)
ad_channel_cache: aid(116) has no channel info [0]
ad_channel_cache: aid(116) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(241)
ad_channel_cache: aid(241) has no channel info [0]
ad_channel_cache: aid(241) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(242)
ad_channel_cache: aid(242) has no channel info [0]
ad_channel_cache: aid(242) is valid if no valid ads found in current channel
ad_channel_cache: checking aid(399)
ad_channel_cache: checking aid(399) against channel(1) path() regexp(/^(http\:\/\/www\.mamabearproductions\.com\/article\/meet-maureen-conlin-happy-notes-music)$/) match(0)
ad_channel_cache: aid(399) is not valid
ad_channel_cache: checking aid(317)
ad_channel_cache: aid(317) has no channel info [0]
ad_channel_cache: aid(317) is valid if no valid ads found in current channel
ad_channel_cache: using ads with no channel info
adserve_cache function(get_cache)
Memory usage: 561.906 K
Invoking cache function 'ad_cache_file_get_cache'.
ad_channel_cache: aid(75) is not a premiere advertisement
ad_channel_cache: aid(76) is not a premiere advertisement
ad_channel_cache: aid(77) is not a premiere advertisement
ad_channel_cache: aid(253) is not a premiere advertisement
ad_channel_cache: aid(116) is not a premiere advertisement
ad_channel_cache: aid(241) is not a premiere advertisement
ad_channel_cache: aid(242) is not a premiere advertisement
ad_channel_cache: aid(317) is not a premiere advertisement
ad_channel_cache: returning non-premiere advertisements
Filtered ads: '8'.
adserve_invoke_hook hook(weight) action(first)
adserve_cache function(hook)
Memory usage: 562.402 K
Invoking cache function 'ad_cache_file_hook'.
Including file: '/home/mambear/www/sites/all/modules/ad/weight/probability/ad_weight_probability.inc'.
Invoking 'ad_weight_probability_cache_filter'.
adserve_cache function(get_cache)
Memory usage: 572.957 K
Invoking cache function 'ad_cache_file_get_cache'.
ad_weight_probability cache_filter gcd(100)
ad_weight_probability cache_filter aid(75) weight(1)
ad_weight_probability cache_filter aid(76) weight(1)
ad_weight_probability cache_filter aid(77) weight(1)
ad_weight_probability cache_filter aid(253) weight(1)
ad_weight_probability cache_filter aid(116) weight(1)
ad_weight_probability cache_filter aid(241) weight(1)
ad_weight_probability cache_filter aid(242) weight(1)
ad_weight_probability cache_filter aid(317) weight(1)
Weighted ads: '8'.
adserve_invoke_hook hook(select) action(first)
adserve_cache function(hook)
Memory usage: 573.188 K
Invoking cache function 'ad_cache_file_hook'.
File cache: hook 'select' not found.
Invoking 'adserve_hook_select'.
Randomly selecting ad 1 of 1.
Randomly selected ID: 75.
adserve_cache function(validate)
Memory usage: 573.234 K
Invoking cache function 'ad_cache_file_validate'.
File cache: found 7 valid advertisements.
Selected ads: '1'.
adserve_cache function(display)
Cache function 'ad_cache_file_display' does not exist.
Memory usage: 574.504 K
Invoking cache function 'adserve_cache_display'.
adserve_cache function(display_ad)
Memory usage: 574.535 K
Invoking cache function 'ad_cache_file_display_ad'.
ad: <div class="html-advertisement" id="ad-75"><a target='new' href="http://click.linksynergy.com/fs-bin/click?id=Yyv*Uf0JWIw&amp;offerid=133940.10000110&amp;type=4&amp;subid=0" rel="nofollow"><IMG alt="MAB" border="0" src="http://www.identitydirect.com/Banners/120x600_mab.gif" /></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=Yyv*Uf0JWIw&amp;bids=133940.10000110&amp;type=4&amp;subid=0" /></div>
adserve_cache function(increment)
Memory usage: 575.434 K
Invoking cache function 'ad_cache_file_increment'.
PHP: errno(2048): date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead ; Line 171 in [/home/mambear/www/sites/all/modules/ad/cache/file/ad_cache_file.inc]
adserve_invoke_hook hook(increment_extra) action(merge)
adserve_cache function(hook)
Memory usage: 575.598 K
Invoking cache function 'ad_cache_file_hook'.
File cache: hook 'increment_extra' not found.
Function 'adserve_hook_increment_extra' does not exist.
File cache: aid(75) group(t18) extra() hostid(none) action(view) timestamp(2009050109) count: 13
adserve_cache function(close)
Memory usage: 576.125 K
Invoking cache function 'ad_cache_file_close'.
File cache: already have lock.
File cache: writing cache back to file '/home/mambear/www/sites/default/files/.1.ad.cache'.
File cache: wrote 10633 bytes to '/home/mambear/www/sites/default/files/.1.ad.cache'.
File cache: successfully closed '/home/mambear/www/sites/default/files/.1.ad.cache'.
adserve_invoke_hook hook(init_text) action(append)
adserve_cache function(hook)
Memory usage: 578.934 K
Invoking cache function 'ad_cache_file_hook'.
File cache: hook 'init_text' not found.
Function 'adserve_hook_init_text' does not exist.
adserve_invoke_hook hook(exit_text) action(append)
adserve_cache function(hook)
Memory usage: 578.934 K
Invoking cache function 'ad_cache_file_hook'.
File cache: hook 'exit_text' not found.
Function 'adserve_hook_exit_text' does not exist.
Memory usage: 578.512 K
document.write('\x3cdiv class=\"html-advertisement\" id=\"ad-75\"\x3e\x3ca target=\'new\' href=\"http://click.linksynergy.com/fs-bin/click?id=Yyv*Uf0JWIw\x26amp;offerid=133940.10000110\x26amp;type=4\x26amp;subid=0\" rel=\"nofollow\"\x3e\x3cIMG alt=\"MAB\" border=\"0\" src=\"http://www.identitydirect.com/Banners/120x600_mab.gif\" /\x3e\x3c/a\x3e\x3cIMG border=\"0\" width=\"1\" height=\"1\" src=\"http://ad.linksynergy.com/fs-bin/show?id=Yyv*Uf0JWIw\x26amp;bids=133940.10000110\x26amp;type=4\x26amp;subid=0\" /\x3e\x3c/div\x3e');

It finds the ad I want to call here:

ad_channel_cache: checking aid(399)
ad_channel_cache: checking aid(399) against channel(1) path() regexp(/^(http\:\/\/www\.mamabearproductions\.com\/article\/meet-maureen-conlin-happy-notes-music)$/) match(0)

But fails to match it to the path I have in the channel settings (I think). I want the channel to display on a specific page. I have tried both absolute and relative paths, with and without wild cards and aliasing. It looks to me like something is missing here path().

Comments

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

What is the full URL you are using for debug? Be sure that you set &u=/some/path. In the debug output you collected, you did not set this, and that is why it did not match a channel. At this time, the channel module requires absolute paths. Ideally, however, the code should be improved to match either (including both aliased and unaliased relative paths).

For more info on how to debug the module, check documentation/DEBUG.txt. The "&" stuff is intentional, as the script has to be encoded to not break web validation.

jeremy’s picture

BTW: The reason I know &u= is not set is because of this line toward the top of the debug output:

url: ''

jo1ene’s picture

Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Active

This is from the page source:
http://www.mamabearproductions.com/sites/all/modules/ad/serve.php?q=1&amp;c=file&amp;f=5&amp;p=sites/default/files&amp;t=18&amp;u=node/398&debug=2

But it only gives me this:

ad_dir: '/home/mambear/www/sites/all/modules/ad'
debug: '2'
adcache: 'none'
nids: ''
tids: ''
hostid: ''
url: ''
quantity: '1'
aid: '0'
ad_display: 'javascript'
--> Time mark: 10:07:44
Memory usage: 398.855 K
Drupal bootstrap '0'.
Drupal bootstrap complete.
Root drupal directory detected as '/home/mambear/www'.

If I take out the amp; I get this path:
http://www.mamabearproductions.com/sites/all/modules/ad/serve.php?q=1&c=file&f=5p=sites/default/files&t=18&u=node/398&debug=2

And this output. I seem to have "fixed" the path a little better this time because I see a url now. Didn't work at first, but keep reading...

ad_dir: '/home/mambear/www/sites/all/modules/ad'
debug: '2'
adcache: 'file'
nids: ''
tids: '18'
hostid: ''
url: 'node/398'
quantity: '1'
aid: '0'
ad_display: 'javascript'
Attempting to include cache include file '/home/mambear/www/sites/all/modules/ad/cache/file/ad_cache_file.inc'.
--> Time mark: 10:29:21
Memory usage: 471.059 K
Drupal bootstrap '0'.
Drupal bootstrap complete.
Root drupal directory detected as '/home/mambear/www'.

So I changed the settings to be a RELATIVE path with NO alias node398 and cleared the cache and it now works. Unfortunately, I couldn't debug with the &

Thanks for steering me in the right direction.

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)
> http://www.mamabearproductions.com/sites/all/modules/ad/serve.php?q=1&amp;c=file&amp;f=5&amp;p=sites/default/files&amp;t=18&amp;u=node/398&debug=2

This is an encoded URL. You have to manually decode it (by converting & to &).

> http://www.mamabearproductions.com/sites/all/modules/ad/serve.php?q=1&c=file&f=5p=sites/default/files&t=18&u=node/398&debug=2

That is the correctly decoded URL. Previously it is possible that you left "&u=node/398" which will not work.

> So I changed the settings to be a RELATIVE path with NO alias node/398 and cleared the cache and it now works.

I need to see the full debug output to understand what you changed. You changed the path in your channel definition? Or in your debugged URL? It sounds to me like it's working, but I'm judging from your email that something is still not working like you expect?

It is correct that currently the module does _not_ check URL aliases. I believe there's already a feature request for this. As to whether it's using absolute or regular paths, I forget now - perhaps for locally served ads it's always relative. And if so, then you simply need to configure your channel correctly.

jeremy’s picture

Status: Postponed (maintainer needs more info) » Fixed

No further feedback, I guess you got it working. Closing issue.

Status: Fixed » Closed (fixed)

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