I've been digging into a goofy problem for weeks, no solution so posting in case someone can shed light. I'm reporting it here because at least part of it is explicitly reported as related to Domain Access.
Domain Access seems to be working fine in all aspects I can see. It is handling a bunch of subdomains. (I used it with D5, and recently added it in D6, so I think I know how to manage it.) But...
In many cases, when Googlebot is the site visitor, my Drupal log often gets 2 sequential errors:
Domain access failed to load during phase: -1
I haven't determined the cause of this error message. DA is configured just right from all I can tell, and always has been. Everything about it seems to work fine. If I go to the URL manually there's no error, I see the correct domain, etc.
Followed by 3 or 4 instances of:
You have an error in your SQL syntax...
I can see that this error is truly a SQL syntax problem. In the compound SELECT statement, one clause has "gid =" nothing, no value, which is not valid SQL. Sometimes it shows as "na.gid =". However, I can't determine where this "bad" SQL arises. Manual exploratory visits to the problem URL and related URLs don't trigger any errors.
When I go to the exact links reported by Drupal as triggering the error, the page displays fine and I get no errors. I can do this with Firefox or IE, whether authenticated or anonymous. So, I have no clue why Googlebot triggers errors that I can't recreate, and I don't see them arising other visitors either.
Just in case, I resaved modules. I re-ran Update. I checked and resaved permissions. I rebuilt all node permissions. I cleared all caches. No errors reported from these actions.
I have no code that would intentionally/knowingly mess with a Googlebot visit. I assume none of the DA modules have browser/user-agent conditional behavior.
So, it's a mystery. Anyone have a suggestion? Should I post detailed examples of the error reports?
Also -- don't know if it is related -- I sometimes get similar errors when MSNbot visits, though it really messes up the log because it frequently tries to go to URLs that I haven't head in years -- a decade in some cases (My main domain has been online since 1994). The log gets so messy that it's difficult to discover current problems vs. the fact that it seems to ignore 301 responses year after year, perpetually revisiting long-gone pages.
Domain Access 6.x-2.4, also same version of Domain Alias, Domain Configuration, Domain Content, Domain Navigation, Domain Settings, Domain Source, Domain Theme, Domain Views. (I'll probably disable Domain Theme, not needed. For a while I had Domain Prefix active but never used it so uninstalled. Domain Strict and Domain User are also in modules list but never activated.)