When attempting to install via a makefile, drush returns invalid version type error for both 7.24 and 7.23

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

Any chance this happens for Drupal 7.20, 7.21 and 7.22 also - but not Drupal 7.19?

If so, it may be related to #2137201: [META] Regressions in project_release handling of version element fields and release-history XML.

dubois’s picture

Using drush 4.6 and drush_make 6.x-2.3 (required for aegir-1.x) I observed failures with errors like:

Project information for admin_menu retrieved.                                                                                                                                                                                                                                                               [ok]
Invalid version 3.0-rc4 for admin_menu.                                                                                                                                                                                                                                                                            [error]

The abovementioned version of drush_make expects every stable version to have a version_patch attribute. However, it appears this attribute is currently only available for non-zero patch versions. Contrast http://updates.drupal.org/release-history/panels/7.x to http://updates.drupal.org/release-history/admin_menu/7.x. I worked around this by checking if version_patch attribute is set and if not setting it to 0. This was good enough to get my makefiles working:

+++ b/drush_make.drush.inc
@@ -312,6 +312,7 @@ function drush_make_update_xml_download($project) {
     $version = (string) $release->version_major;
     // there should be version_patch attribute for every stable release
     // so checking whether the attribute exists should be enough
+    if (empty($release->version_patch)) { $release->version_patch = 0; }
     if (isset($release->version_patch) && ((string) $release->version_extra) != 'dev') {
       $version .= '.' . (string) $release->version_patch;
     }
ddille’s picture

I'm seeing failures on Drupal 7.20, 7.21 and 7.22 also. Seeing failures with contrib modules where the version is specified as well.

Project information for drupal retrieved. ... [ok]
Invalid version 7.20 for drupal.

If you don't specify a core version (projects[drupal][version] = 7) it will download 7.19.

FatherShawn’s picture

Experiencing the same symptoms

jmcclelland’s picture

Same problems (also using aegir so dependent on this outdated version of drush make). It was working fine two days ago. Today it doesn't work. Maybe something changed in the way drupal is publishing package information?

In any event, the patch in comment #2 worked for errors I was getting with third party modules, but still wasn't work with Drupal core. The following patch works for both:

--- drush_make.drush.inc.orig	2013-11-22 10:22:39.000000000 -0500
+++ drush_make.drush.inc	2013-11-22 11:05:40.000000000 -0500
@@ -312,8 +312,14 @@
     $version = (string) $release->version_major;
     // there should be version_patch attribute for every stable release
     // so checking whether the attribute exists should be enough
+    if (empty($release->version_patch)) { $release->version_patch = 0; }
     if (isset($release->version_patch) && ((string) $release->version_extra) != 'dev') {
-      $version .= '.' . (string) $release->version_patch;
+      if (isset($release->version_minor) ) {
+        $version .= '.' . (string) $release->version_minor;
+      } 
+      else {
+        $version .= '.' . (string) $release->version_patch;
+      }
     }
     // if version_patch attribute does not exist, then it should be a dev release
     // and the version string should be in format MAJOR_VERSION.x-dev
jmcclelland’s picture

Aha. This must be related to https://drupal.org/node/2132659

dnotes’s picture

For people using BOA (Barracuda Octopus) version of Aegir, alternate versions of Drush are included in the scripted server builds. I had the problems above (even after updating to most recent BOA 2.1.3) but I used the command "drush5 make [etc]" and it seems to have worked. I'm sure a similar server setup could be used for other servers running Aegir.

fenstrat’s picture

Here's #5 in patch format.

For those on the stable 1.x version of Aegir (which requires Drush 4.x and stand alone drush_make) the attached patch fixes these build errors on our production Aegir box.

j0nathan’s picture

izmeez’s picture

Thanks patch works great.

FatherShawn’s picture

dww’s picture

FYI: The upstream problems on d.o are all fixed, so this should be resolved. Can someone please confirm and mark this fixed?

Thanks!
-Derek

izmeez’s picture

Does this mean the patch is no longer required?

dww’s picture

Correct.

izmeez’s picture

+1 Yes. Patch reversed and tested drush_make successfully.
Might wants others to weigh in, just in case?

dww’s picture

Status: Active » Fixed

Nah, I know the feeds are now correct, and you confirmed it's working, so there's no need to spend any extra time testing this.

Thanks,
-Derek

izmeez’s picture

ok. Thanks.

fenstrat’s picture

Confirming drush_make-4.x-2.3 now works without this patch. Great work @dww!

Status: Fixed » Closed (fixed)

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