While debugging another issue this Undefined index distracted me.
(I've split this issue from #1102620: provision-deploy fails silently on unavailable database )

Undefined index: profiles deploy.provision.inc:84 [1.52 sec, 5.88 MB]                                          [notice]
array_keys() expects parameter 1 to be array, null given deploy.provision.inc:84 [1.52 sec, 5.88 MB]   [warning]

In the original issue I've already posted a proposal patch (http://drupal.org/files/issues/provision-check_package_list_0.patch)

anarcat commented that the patch might conflict in situations where there are no site specific packages.

Bottom line is that if we're not 100% sure that the array index $site_packages['profiles'] exists we should test it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anarcat’s picture

Status: Needs review » Needs work

as I said over there, this needs to be tested against sites that have no site-specific packages, which i think is a perfectly valid situation that shouldn't abort. please reroll the patch to focus on making sure that we silence the warning. in fact, i wonder why we try to look for profiles in site-specific packages, that's rather weird...

stella’s picture

subscribe

Anonymous’s picture

I think this is a legacy bit of code from when we used to care about site-specific packages. We made a decision to stop doing that eventually.

I think the code is obsolete because it tries to handle incompatible target platforms. We now handle that directly in the frontend (the package comparison stuff, disabling incompatible platforms from being selected). but we should also give thought to how migrations/clones from the commandline could be possible in future, in provision directly..

helmo’s picture

Thanks, for the attention.

I'm a bit confused as to what is the best solution, hope you can come up with an appropriate fix.

anarcat’s picture

What needs to happen here is that a patch gets uploaded in this issue that doesn't crash the verify when there's no site-specific packages. It can just do a warning, that's fine.

helmo’s picture

Status: Needs work » Needs review
FileSize
3.54 KB
1.55 KB

I've tried refactoring this. The Unfortunately the diff doesn't look pretty since I've wrapped the foreach in an if. I have for that reason first included a partial patch.

But what about #3... could whole piece of code this be safely removed?

anarcat’s picture

That's true... maybe we need to just ditch that code. Sorry I missed that part there... That would need thorough testing though.

izmeez’s picture

subscribing

Steven Jones’s picture

Status: Needs review » Needs work

Yeah, so I've always seen this error since using Aegir, and given the errors that occur, this usually means the code has never run for me, I've never noticed anything bad happen. I guess we need to test the case where this code executes and make sure it still works?

Or maybe we should remove the code if it does nothing anyway, as suggested in #3.

crea’s picture

Subscribing

jacobson’s picture

Version: 6.x-1.0-rc3 » 6.x-1.1

This bug still exists. I get this error trying to migrate a drupal 7.0 site to drupal 7.4:

Undefined index: profiles deploy.provision.inc:84
array_keys() expects parameter 1 to be array, null given deploy.provision.inc:84
Undefined index: deploy.provision.inc:88
array_merge(): Argument #2 is not an array deploy.provision.inc:88
Undefined index: modules deploy.provision.inc:89
Invalid argument supplied for foreach() deploy.provision.inc:89
3rdLOF’s picture

I have the identical issue migrating a site from D6 site to D6 platforms.

Undefined index: profiles deploy.provision.inc:84
array_keys(): The first argument should be an array deploy.provision.inc:84
Undefined index: deploy.provision.inc:88
array_merge(): Argument #2 is not an array deploy.provision.inc:88
Undefined index: modules deploy.provision.inc:89
Invalid argument supplied for foreach() deploy.provision.inc:89
Yura’s picture

Since upgrading Aegir from 1.1 to 1.2, site specific modules (site/example.com/modules/) has been moved but modules under /sites/all/modules/ directory doesn't. I suppose it has related with this issue!

array_keys() expects parameter 1 to be array, null given                    [warning]
deploy.provision.inc:84
array_merge(): Argument #2 is not an array deploy.provision.inc:88          [warning]
Invalid argument supplied for foreach() deploy.provision.inc:89             [warning]
<em>module</em> <em>ca</em> is incompatible with this release of Drupal, and[warning]
will be disabled.
<em>module</em> <em>uc_cart</em> is incompatible with this release of       [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_hosting</em> is incompatible with this release of    [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_hosting_products</em> is incompatible with this      [warning]
release of Drupal, and will be disabled.
<em>module</em> <em>uc_order</em> is incompatible with this release of      [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_payment</em> is incompatible with this release of    [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_paypal</em> is incompatible with this release of     [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_product</em> is incompatible with this release of    [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_reports</em> is incompatible with this release of    [warning]
Drupal, and will be disabled.
<em>module</em> <em>uc_store</em> is incompatible with this release of      [warning]
Drupal, and will be disabled.
<em>module</em> <em>token</em> is incompatible with this release of Drupal, [warning]
and will be disabled.
lukus’s picture

I'm experiencing the same problem, trying to clone a site from Drupal 7.x.

Steven Jones’s picture

Title: Undefined index: profiles deploy.provision.inc:84 » Migrate doesn't check packages in the backend
Version: 6.x-1.1 » 6.x-1.x-dev

So, we call provision_save_site_data() before we do any of this, which basically means that we wipe out any record of the site specific packages anyway, so in reality we never check them, at all.

I'm not sure what the proper fix for this code is, but for now I'm going to commit a fix for the notice we're getting, it just doesn't look good.

So I guess the question is, should we bother checking packages in the backend at all, or should we just remove this code completely?

Lowell’s picture

subscribing

same issue migrating one site, my other 9 sites migrated perfectly.
And I am only changing the domain name, leaving db server and platform unchanged

anarcat’s picture

I support the idea of the backend being dumb and trying to do stupid stuff, while the frontend being there to keep people from shooting themselves in the foot. However, here there's the possibility of the frontend being not up to date when the task is called... Hum...

Anonymous’s picture

The method for 'updating' the frontend to reflect changes made in the backend can be done by using 'hosting-import' - I *think* that includes refreshing the package info in the frontend but I'm unsure. But I use this method to automate migrations of sites from backend only, and use hosting-import to update the site node to be 'on' the new platform.

Edit: Actually this may not help the situation here.. maybe just ignore me :)

ergonlogic’s picture

Version: 6.x-1.x-dev » 7.x-3.x-dev
Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)

Is this still an issue on the dev branch (7.x-3.x)?

  • Commit 049e995 on 7.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by Steven Jones:
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...
  • Commit 5bf1356 on 6.x-1.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by Steven Jones:
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...

  • Steven Jones committed 049e995 on
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...
  • Steven Jones committed 5bf1356 on
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...

  • Steven Jones committed 049e995 on 7.x-3.x-1966886-context-to-entity
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...
  • Steven Jones committed 5bf1356 on 7.x-3.x-1966886-context-to-entity
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...

  • Steven Jones committed 049e995 on 6.x-2.x-1995506-profile-option
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...
  • Steven Jones committed 5bf1356 on 6.x-2.x-1995506-profile-option
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...

  • Steven Jones committed 049e995 on 2358795-provision-save-on-verify
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...
  • Steven Jones committed 5bf1356 on 2358795-provision-save-on-verify
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...

  • Steven Jones committed 049e995 on 7.x-4.x
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...
  • Steven Jones committed 5bf1356 on 7.x-4.x
    Issue #1111572 by helmo, Steven Jones: Fixed Undefined index: profiles...