how you authorize the indexer for requesting pages from drupal6-site?

[ROOT@psrLAMP01:/opt/sphinx] bin/indexer --all
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/opt/sphinx/etc/sphinx.conf'...
indexing index 'index_platforms_main0'...
ERROR: index 'index_platforms_main0': xmlpipe: expected '<document>', got 'Not authorized.
'.
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'index_platforms_main1'...
ERROR: index 'index_platforms_main1': xmlpipe: expected '<document>', got 'Not authorized.
'.
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'index_platforms_delta'...
ERROR: index 'index_platforms_delta': xmlpipe: expected '<document>', got 'Not authorized.
'.
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
distributed index 'index_platforms_join' can not be directly indexed; skipping.

saluti
roberto

Comments

markus_petrux’s picture

Access to the XMLPipe generator is controlled by IP. Please, look at the Sphinx search settings panel, field "Sphinx indexer IP addresses".

roberto.ch’s picture

my entry in "Sphinx indexer IP addresses"
is same as in drupal-log (10.14.5.93).

i adjust the sphinxsearch.xmlpipe.inc

/* $access_xmlpipe = FALSE; */
  $access_xmlpipe = TRUE;

but that is not the best solution :-)

saluti
roberto

markus_petrux’s picture

When the indexer is executed and it founds that the requester's IP address does not match the rules in module settings, then a watchdog report is recorded for review.

Goto Administer > Reports > Recent log entries, then filter for message of type "sphinxsearch". Enter to see details of the reports "Not authorized.". The hostname row should tell you the IP address of the client who attempted to execute the XMLPipe generator.

If the Sphinx process runs on the same Apache box the site is installed, maybe you need to authorize 127.0.0.1 in the sphinxsearch settings panel?

premanup’s picture

Category: support » bug

in sphinxsearch.xmlpipe.inc function named sphinxsearch_ip_check_cidr() there is a line:

$ip_mask = ~((1 << (32 - $mask)) - 1);

Probably for working in 64 bit environment you need change int 32 to 64:

$ip_mask = ~((1 << (64 - $mask)) - 1);

So, I think it is a bug because it prevent module to work in 64bit env.

premanup’s picture

We can easily check is it 64 or 32 bit machine using PHP_INT_SIZE constant, so this code should works in both cases:
$ip_mask = ~((1 << ((PHP_INT_SIZE==8 ? 64 : 32) - $mask)) - 1);

zerolab’s picture

premanup's solutions works well. Tested on both 32 and 64 systems.

markus_petrux’s picture

Title: how you authorize the indexer for requesting pages from drupal6-site? » Support variable PHP integer architecture when checking IPs
Status: Active » Fixed

Committed a slight variation of the fix.

- http://drupalcode.org/project/sphinxsearch.git/commit/4d5bc51

Thank you!

Status: Fixed » Closed (fixed)

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