I upgraded to the latest 4.2 today. Now, when I use drush up command, it goes in a loop with the following two lines getting repeated:

WD php: strpos(): Empty delimiter in                                 [error]
/usr/local/share/drush/commands/pm/pm.drush.inc on line 1057.

I am not sure if this is drush issue or one of the module;s drush file.

Comments

moshe weitzman’s picture

Assigned: Unassigned » jonhattan
Priority: Normal » Major

I did not confirm this but it is new code I think so plausible.

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Working fine for me in drush-HEAD.

Are you updating a Drupal-6 or Drupal-7 site? Which modules?

msonnabaum’s picture

Also can't reproduce with D6 or D7.

jonhattan’s picture

That's great! this issue is theorically impossible to happen :D

      // Option 4: no one is a prefix of the other. Find the common
      // prefix by iteratively strip the rigthtmost piece of $path.
      // We will iterate until a prefix is found or path = '.', that on the
      // other hand is a condition theorically impossible to reach.
      do {
        $path = dirname($path);
        if (strpos($path2, $path) === 0) {
          break;
        }
      } while ($path != '.');

To reproduce this we need the output of drush with --debug in order to see what project and modules are involved.
Also,.. now that I remember the patch in #1023120: drush upc rules seems to do something odd make the implied function more fail proof. I'll commit that issue's patch now.

Anyway I'd like to see what's the exact problem to shield that theorically impossible condition.

greg.1.anderson’s picture

Not impossible:

php > print dirname(".");
.
php > print dirname("");
php >

There may be others... Anyway, I see that you check for '.', but if $path starts off empty for some reason, that could be the cause of this.

pfrenssen’s picture

StatusFileSize
new5.7 KB

I'm experiencing this with the latest 4.5-dev. I attached a debug log, but it is probably of not much use, as it keeps generating errors indefinitely after bootstrapping.

pfrenssen’s picture

StatusFileSize
new14.4 KB

Here's the list of modules. The site runs 6.x.

pfrenssen’s picture

In my case the problem was caused by having a custom module and a custom theme installed which both declared "project = 'projectname'" in their .info files. So we had a project containing both a module and a theme (which is probably illegal), and neither were coming from drupal.org.

Custom modules and themes should not declare "project" in their .info files but this happens in the wild when .info files from existing projects are copy/pasted.

jonhattan’s picture

Title: drush up fails with 4.2 » discard custom projects in drush up
Version: All-versions-4.2 »
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.92 KB

so having a module and a theme with the same project name produces a call to drupal_get_path('module', 'the_theme') returning "".

Attached patch does prevent this case by discarding custom projects: those without a project in drupal.org or any kind of external server.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I didn't try this but it seems reasonable to me.

jonhattan’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

jonhattan’s picture

Version: » All-versions-4.x-dev
Assigned: jonhattan » msonnabaum
Status: Fixed » Patch (to be ported)
msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Backported.

Status: Fixed » Closed (fixed)

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