Hi I am getting this error.

I have had a look but nothing related to this.

Notice: unserialize() [function.unserialize]: Argument is not a string in /var/www/drupal/sites/all/modules/domain/domain.bootstrap.inc on line 165

I am sure its pretty obvious and my first thought is that my site is in a sub dir and my paths were incorrect I added

/**
* Add the domain module setup routine.
*/
include './drupal/sites/all/modules/domain/settings.inc';

But this didn't work either. Any suggestions or issues you could point me to.

Thanks for your time.

CommentFileSizeAuthor
#9 685872-unserialize.patch1.02 KBagentrickard

Comments

agentrickard’s picture

Um, no. Not really. That's a pretty weird error. It means the query to the {variable} table is failing.

Are you doing any table prefixing or other non-standard things with your installation?

The key to debugging is figuring out what SQL is being generated at line 165, and then testing why it fails.

It is also possible that that variable hasn't been saved, since you haven't configured the module.

BigEd’s picture

We are on a load balancer but this shouldn't effect the data base as its being replicated across.

The site as mentioned above is in a subdirectory and if i add into settings I get these errors..

Warning: include(./uk/sites/all/modules/domain/settings.inc) [function.include]: failed to open stream: No such file or directory in /var/www/drupal/sites/default/settings.php on line 233

Warning: include(./uk/sites/all/modules/domain/settings.inc) [function.include]: failed to open stream: No such file or directory in /var/www/drupal/sites/default/settings.php on line 233

Warning: include() [function.include]: Failed opening './uk/sites/all/modules/domain/settings.inc' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/drupal/sites/default/settings.php on line 233

I also test on a development server first and had no problems worked fine so i doubt its a conflict of any type as its the same as the live server.

On line 165 of the bootstrap.inc is this variable any thoughts on this?

/**
 * Retrieves the value of the variable 'domain_bootstrap_modules' from the
 * {variable} table. This function does not use Drupal's variable system.
 *
 * @return
 * An array containing module names.
 */
function _domain_bootstrap_modules_get() {
  global $conf;
  $key = 'domain_bootstrap_modules';
  $table = domain_get_primary_table('variable');
  $conf[$key] = unserialize(db_result(db_query("SELECT value FROM $table WHERE name = '%s'", $key)));
  return $conf[$key];
}

I am just checking with the server administrator to see if there is anything that could be or issue that I may have missed.

Thanks for your time.

agentrickard’s picture

Well, the first error is an internal server path problem that you need to correct by finding the right include path for the settings.inc file.

The second makes no sense, because that could should not execute is settings.inc fails to load. You also missed my comment in #1. You need to check the logs and see what SQL query is being run after line 165 is processed.

My guess is that you are having a file include problem due to the load balancer or some other server-level misconfiguration.

johnalbin’s picture

Title: Argument is not a string in /var/www/drupal/sites/all/modules/domain/domain.bootstrap.inc » Argument is not a string in domain.bootstrap.inc

Changing the title because its appearing in the Recent issues block on http://drupal.org/project/domain and the extra-long text is overlapping the project description. :-)

BigEd’s picture

@john ,No problem on the title change; I guess i was just thinking of making it easier to find if someone else comes across the same sort of issue.

@agentrickard. I didn't post a log as nothing came up in the drupal sql logs. Unlike if you remove the settings.php code you get the ..

Message	Domain access failed to load during phase: -1. Please check your settings.php file and site configuration

But noting shows up for this error other than the print to screen. I will check to see if anything comes up in the sql server logs as it might show something there.

My guess is that you are having a file include problem due to the load balancer or some other server-level misconfiguration.

Yea I am thinking the same, I have a server admin so I can direct him to make changes as needed if I can find the source of the problem. I will chat with him on Monday and will get back to you.

Thanks guys for your quick responses I appreciate you taking the time to help me out.

agentrickard’s picture

That rather generic error message is mainly to help me provide support. It simply means that the include code is missing from settings.php.

BigEd’s picture

Ok fixed it, I am not really sure what the issue is but heres what I did in case this helps anyone.

this is line 165 were it was failing, I think the table was being created but it was hanging and not finalising the saved data.

/**
* Retrieves the value of the variable 'domain_bootstrap_modules' from the
* {variable} table. This function does not use Drupal's variable system.
*
* @return
* An array containing module names.
*/
function _domain_bootstrap_modules_get() {
  global $conf;
  $key = 'domain_bootstrap_modules';
  $table = domain_get_primary_table('variable');
  $conf[$key] = unserialize(db_result(db_query("SELECT value FROM $table WHERE name = '%s'", $key)));
  return $conf[$key];
}

I doubt this was the solution but I first selected the users to FALSE from the line define('DOMAIN_ASSIGN_USERS', FALSE); At the top of the domain.module file. I did the because I didn't need it and it was one less action for me worry about.

I installed the Domain module only but this time we accessed the query in the 'drupal' database 'variable' table.

It seemed very strange I did get a bit of a weird response when selecting 'value' from the 'variable' table for one row-entry - I wonder if there was some sort of delayed insert going-on at the time. Anyway something kicked in and saved the data and everything is in working in order.

Given that it serializes things into strings, if it ever manages to only partially update something (in particular an array/string) (which shouldn't really happen), it could break the unserialize function.

I still need to do a few more checks but I am pretty happy.

BigEd’s picture

Status: Active » Fixed
agentrickard’s picture

Category: support » bug
Status: Fixed » Needs review
StatusFileSize
new1.02 KB

It may be safer to wrap the unserialize() in an IF rather than assuming it will work. It's an edge case, but probably worth fixing.

I wonder if we do this anywhere else in the code. (We probably do.)

BigEd’s picture

Yea the IF statement would be a likely way to solve the problem.

I am not going to test it just yet as its on my live site unless an issue comes up, but I will have a play on my development site when I get a few mins. I doubt that it would make any big difference and is just a good fall back for this type of issue.

Thanks,

agentrickard’s picture

I'm inclined to add it, since it looks like a race condition that I never saw during testing.

agentrickard’s picture

Status: Needs review » Fixed

Committed to 6--2 and HEAD.

Status: Fixed » Closed (fixed)

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

mos2710’s picture

Hi all,

I just got this error message again.

"Domain access failed to load during phase: bootstrap include. Please check your settings.php file and site configuration."

The patch is already there and don't know what else to do. Thanks in advance!

Mos2710

gfxguru’s picture

same here

TiGar’s picture

I got the same error.
Is there any solution yet?

Drupal webdesigner’s picture

Status: Closed (fixed) » Active

Same here. Subscribed.

BigEd’s picture

This isnt the same issue.

The problem above was an error on print to screen which said. ..

Warning: include(./uk/sites/all/modules/domain/settings.inc) [function.include]: failed to open stream: No such file or directory in /var/www/drupal/sites/default/settings.php on line 233

Warning: include(./uk/sites/all/modules/domain/settings.inc) [function.include]: failed to open stream: No such file or directory in /var/www/drupal/sites/default/settings.php on line 233

Warning: include() [function.include]: Failed opening './uk/sites/all/modules/domain/settings.inc' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/drupal/sites/default/settings.php on line 233

If you are getting the error in your logs below this is a diffrent issue.

Message Domain access failed to load during phase: -1. Please check your settings.php file and site configuration

This means you should try going back through the steps of installing the module as this is most likley the issue, Double check all the read me files there is three you should read through before attempting any install.

If you are still having issues post a new support request or find a related error in a previous post. If its realted to the print to screen error I stated, in which case I will do my best to describe how I managed to get around it. Although as far as I am aware this is fixed and you shouldnt need to do anything.

agentrickard’s picture

Status: Active » Fixed

Marking as fixed. This new report is unrelated, as biged states. See INSTALL.txt.

agentrickard’s picture

Status: Fixed » Closed (fixed)

Closing again.