I've just upgraded drush, having been 'pursuaded' by the nag message: A newer version of drush, 7.x-5.0-rc3, is available. You are currently running drush version 4.5; to update, run `drush self-update`.

When I now run: drush dl commerce_downloads
and select option [2] : 7.x-1.0-beta3 - 2011-Aug-05 - Supported

I immediately get the warning: Invalid argument supplied for foreach() wget.inc:42

It still seems to do the download (after a while), so not sure whether this warning is a problem.

As an aside, only after getting this problem, did I check the drush project page and discovered that drush 5.0 is not the recommended version yet, 4.5 still is, so it seems strange that drush should be giving the nag message about a newer version at this stage.

Comments

jonhattan’s picture

Status: Active » Postponed (maintainer needs more info)

Unable to reproduce.

Larry Jones’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Saw the same warning today:
Invalid argument supplied for foreach() wget.inc:42
when I ran
drush dl openpublic --select
while building an additional site on a production shared hosting environment that is working fine for Drupal 7 and drush 5.4.

The warning occurred after the package was selected and before the openpublic-beta8 package was downloaded.
The warning points to
/drush/commands/pm/package_handler/wget.inc; line 42 is

    foreach ($files as $key => $file) {
      if ((string)$file->variant == drush_get_option('variant', 'full') && (string)$file->archive_type == 'tar.gz') {
        $release['download_link'] = (string)$file->url;
        $release['mdhash'] = (string)$file->md5;
        break;
      }

That looked too hard to figure out, so I tried something else. I copied
/drush/examples/examples.drush.ini to
/drush/drush.ini, deleted the previously downloaded openpublic package folder, then re-ran "drush dl openpublic --select".

Problem solved. The drush.ini file includes
memory_limit = 128M
which cures random looking problems like this. Basically, when memory limit is reached, php throws an error on whatever command it is on. More memory fixed it.

May I change status to "closed (fixed)"?

jonhattan’s picture

Version: » 8.x-6.x-dev
Status: Closed (fixed) » Active

This is still a bug when the project has no recommended release.

# drush pm-releases apisite-6.x
------- RELEASES FOR 'APISITE' PROJECT -------
 Release         Date         Status      
 6.x-1.x-dev     2012-Mar-13  Development
# drush dl apisite-6.x
There are no stable releases for project apisite.                                                                                                                                                       [warning]
Choose one of the available releases for apisite:
 [0]  :  Cancel                                      
 [1]  :  6.x-1.x-dev  -  2012-Mar-13  -  Development
1
Undefined index: files wget.inc:41                                                                                                                                                                      [warning]
Invalid argument supplied for foreach() wget.inc:42                                                                                                                                                     [warning]
Unable to download apisite-6.x-1.x-dev.tar.gz_date=1331596969 to /tmp/drush_tmp_1366911238_5179690643fbb from http://ftp.drupal.org/files/projects/apisite-6.x-1.x-dev.tar.gz?date=1331596969           [error]
jonhattan’s picture

Status: Active » Fixed

In addition, this is a problem only for install profiles. Committed a fix to 6.x and 5.x http://drupalcode.org/project/drush.git/commit/423c6c8

OTOH, there's a infraestructure problem. tarballs for old profiles are not available. See http://drupal.org/node/687358/release or http://drupal.org/node/1592456/release

jhedstrom’s picture

Priority: Normal » Major
Status: Fixed » Active

This commit somehow broke this command:

drush make -y --md5 --no-core --contrib-destination=profiles/drupal_forum /PATH_TO_DRUSH/drush/tests/makefiles/recursion.make

Which is part of a test, that somehow is still passing (I'm looking into why that test is passing).

jhedstrom’s picture

Status: Active » Fixed

Committed a fix in dadc6cf. The previously committed code was checking the wrong variable ($request instead of $release). As for the failing test, these were failing, but I don't know why travis didn't catch it.

Status: Fixed » Closed (fixed)

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