1

PHP version 5.3.3
Scientific Linux release 6.5 Carbon (like CentOS/Redhat)

Can't update a Drupal 6 site using Drush 6.x. Installed Drush 6.x using composer. "drush pm-update" produces the following, which makes me think something's wrong with the hash for the end of life announcement.

# drush pm-update --verbose --no-cache
Initialized Drupal 6.38 root directory at /var/www/html/<url-removed>                      [notice]
Initialized Drupal site default at sites/default                                              [notice]
Loading release_info engine.                                                                  [notice]
Loading version_control engine.                                                               [notice]
Loading package_handler engine.                                                               [notice]
Executing: wget --version
Loading update_info engine.                                                                   [notice]
/usr/bin/php  -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d                          [notice]
magic_quotes_sybase=Off /home/<user>/.composer/vendor/drush/drush/drush.php
--php=/usr/bin/php --php-options=' -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d
magic_quotes_sybase=Off'  --backend=2 --verbose --root=/var/www/html/<url-removed>
--uri=http://default  pm-updatestatus 2>&1
Update information last refreshed: Thu, 04/14/2016 - 12:32
 Name                                    Installed     Proposed       Message                         
                                     Version       version                                        
 Backup and Migrate (backup_migrate)     6.x-2.8       6.x-2.8        Installed version not supported 
 Drupal                                  6.38          Drupal 6 has   SECURITY UPDATE available       
                                                   reached end                                    
                                                   of life                                        
 CCK Facets (cck_facets)                 6.x-1.x-dev   6.x-1.x-dev    Installed version not supported 
 Field Indexer (field_indexer)           6.x-1.0       6.x-1.0        Installed version not supported 
 Content (cck)                           6.x-2.9       6.x-2.9        Installed version not supported 
 Content Access (content_access)         6.x-1.2       6.x-1.2        Installed version not supported 
 Data export import                      6.x-1.1       6.x-1.1        Installed version not supported 
 (data_export_import)                                                                                 
 Date (date)                             6.x-2.10      6.x-2.10       Installed version not supported 
 External Links (extlink)                6.x-1.17      6.x-1.17       Installed version not supported 
 Faceted Search (faceted_search)         6.x-1.0-beta  6.x-1.0-beta3  Installed version not supported 
                                     3                                                            
 Google Analytics (google_analytics)     6.x-3.6       6.x-3.6        Installed version not supported 
 Image (image)                           6.x-1.2       6.x-1.2        Installed version not supported 
 ImageAPI (imageapi)                     6.x-1.10      6.x-1.10       Installed version not supported 
 ImageCache (imagecache)                 6.x-2.0-rc1   6.x-2.0-rc1    Installed version not supported 
 ImageField (imagefield)                 6.x-3.11      6.x-3.11       Installed version not supported 
 IMCE (imce)                             6.x-2.7       6.x-2.7        Installed version not supported 
 IMCE Wysiwyg API bridge (imce_wysiwyg)  6.x-1.1       6.x-1.1        Installed version not supported 
 jQuery UI (jquery_ui)                   6.x-1.5       6.x-1.5        Installed version not supported 
 Link (link)                             6.x-2.11      6.x-2.11       Installed version not supported 
 Menu Block (menu_block)                 6.x-2.4       6.x-2.4        Installed version not supported 
 Override node options                   6.x-1.14      6.x-1.14       Installed version not supported 
 (override_node_options)                                                                              
 Pathauto (pathauto)                     6.x-1.6       6.x-1.6        Installed version not supported 
 Poormanscron (poormanscron)             6.x-2.2       6.x-2.2        Installed version not supported 
 Site map (site_map)                     6.x-2.2       6.x-2.2        Installed version not supported 
 Token (token)                           6.x-1.19      6.x-1.19       Installed version not supported 
 Views Data Export (views_data_export)   6.x-2.0-beta  6.x-2.0-beta7  Installed version not supported 
                                     7                                                            
 Views modify query                      6.x-1.x-dev   6.x-1.x-dev    Installed version not supported 
 (views_modify_query)                                                                                 
 Webform (webform)                       6.x-3.21      6.x-3.21       Installed version not supported 
 Weight (weight)                         6.x-1.3       6.x-1.3        Installed version not supported 
 Wysiwyg (wysiwyg)                       6.x-2.4       6.x-2.4        Installed version not supported 


Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Executing: svn info '/var/www/html/<url-removed>/drupal-Drupal 6 has reached end of life'
Executing: bzr root '/var/www/html/<url-removed>/drupal-Drupal 6 has reached end of life'
Executing: wget --version
Executing: wget -q --timeout=30 -O /tmp/download_fileBIUKo0 https://www.drupal.org/about/drupal6-eol
Downloading drupal6-eol was successful.                                                       [notice]
File drupal6-eol is corrupt (wrong md5 checksum).                                          [error]
Updating project drupal failed. Attempting to roll back to previously installed version.   [error]
Rolling back update of Drupal core code ...                                                   [notice]
Executing: svn info 'drupal-Drupal 6 has reached end of life'
Executing: bzr root 'drupal-Drupal 6 has reached end of life'
Backups were restored successfully.                                                        [ok]
Command dispatch complete                                                                     [notice]
Command dispatch complete                                                                     [notice]
2
  • There is no such module as drupal6-eol, probably this break is deliberately since 6.x updates aren't supported anymore, see: Drupal 6 end of life.
    – kenorb
    Apr 14, 2016 at 18:10
  • Yea, I know about it being EOL. I was hoping to upgrade it to Drupal 7, though the first stage was to make sure everything was up to date in Drupal 6 first.
    – EchoLynx
    Apr 14, 2016 at 18:14

2 Answers 2

1

[I presume you meant to say that you installed Drush 6.x by Composer, since it is not possible to install Drupal 6.38 via Composer.]

If you are working with Drupal 6, you should be using Drush 8. Drupal.org changed some things in the metadata when Drupal 6 went EOL; Drush 6 and Drush 7 probably can't handle this.

6
  • Is that the only option? I'm trying to keep PHP at 5.3.3 on this system until I can upgrade to Drupal 7.
    – EchoLynx
    Apr 14, 2016 at 19:54
  • I recognize that this is a serious impediment. Try Drush 7; this version is still supported. If it does not work,you could try posting an issue in the issue queue. Please also reproduce on Drush 8 on a different system to diagnose. If there is a fix in Drush 8 that just needs to be backported, that would make things easier and faster. Note that we do not have a Drupal 6 maintainer for Drush, though. Apr 15, 2016 at 0:54
  • Will do, though I can't get to this again until next week. Stay tuned.
    – EchoLynx
    Apr 15, 2016 at 2:40
  • I'm back. I tried switching to Drush 7 after verifying that it works with php 5.3.3. I am now getting this error: Command pm-update needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command. I am working on copying the site to another host where I can freely update PHP and try Drupal 8. After some googling, it seems like getting drush 7 to work would be another SO question altogether.
    – EchoLynx
    Apr 19, 2016 at 14:50
  • Looks like Drush 7 wont run on PHP 5.3.3 because of a bug in PHP 5.3.3. Whenever I try to use drush sql-cli or drush sqlq using Drush 7, I get exception 'ReflectionException' with message 'Class Drush\Sql\Sql6 does not have a constructor, so you cannot pass any constructor arguments' in /home/user/.composer/vendor/drush/drush/includes/drush.inc:117 A quick search turned up this issue: github.com/drush-ops/drush/issues/544
    – EchoLynx
    Apr 19, 2016 at 15:03
0

Drush 6 is not supported by the drush developers anymore. Drush 7 is supported and is still compatible with PHP 5.3.x, though according to @greg_1_anderson you will be better off using Drush 8. ("Drupal.org changed some things in the metadata when Drupal 6 went EOL; Drush 6 and Drush 7 probably can't handle this.")

Unfortunately, there is a bug in PHP 5.3.3 that prevents Drupal 7 from running on it. You can verify that you are being affected by this bug by running drush sql-cli. If you get the following error, you are affected:

exception 'ReflectionException' with message 'Class Drush\Sql\Sql6 does not have a constructor, so you cannot pass any constructor arguments' in                                                  [error]
/home/user/.composer/vendor/drush/drush/includes/drush.inc:117
Stack trace:
#0 /home/user/.composer/vendor/drush/drush/includes/drush.inc(117): ReflectionClass->newInstanceArgs(Array)
#1 /home/user/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(607): drush_get_class('Drush\Sql\Sql', Array, Array)
#2 /home/user/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(590): drush_sql_get_version()
#3 /home/user/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(428): drush_sql_get_class(NULL)
#4 [internal function]: drush_sql_query()
#5 /home/user/.composer/vendor/drush/drush/includes/command.inc(361): call_user_func_array('drush_sql_query', Array)
#6 /home/user/.composer/vendor/drush/drush/includes/command.inc(212): _drush_invoke_hooks(Array, Array)
#7 [internal function]: drush_command()
#8 /home/user/.composer/vendor/drush/drush/includes/command.inc(180): call_user_func_array('drush_command', Array)
#9 /home/user/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(64): drush_dispatch(Array)
#10 /home/user/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#11 /home/user/.composer/vendor/drush/drush/drush.php(11): drush_main()
#12 {main}

Fortunately, the bug is easy to work around.

GitHub user diarmy suggests replacing a single line in your drush 7 install:

In PHP 5.3.3, the line $reflectionClass->newInstanceArgs($constructor_args) in drush_get_class throws an exception.

A clue as to why this might be the case may be found in http://php.net/manual/en/reflectionclass.newinstanceargs.php where the documentation says that a ReflectionException will be thrown if the class does not have a constructor and the args parameter contains one or more parameters.

The base class SqlVersion class does not have a constructor and yet an empty array is passed into its descendant (Sql6 or Sql7).

To work round this, the line

return $reflectionClass->newInstanceArgs($constructor_args);

should be replaced with:

return !empty($constructor_args) ? $reflectionClass->newInstanceArgs($constructor_args) : $reflectionClass->newInstanceArgs();

I had the same issue as above and this fix worked for me -7.0-dev is now working on PHP 5.3.3.

After applying this update, drush sql-cli and drush pm-update should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.