After upgrade to 7.63, 8.5.10, 8.6.7, 9.4.0 get TYPO3 phar error for drush

Created on 17 January 2019, almost 6 years ago
Updated 5 December 2023, about 1 year ago

Problem/Motivation

There seem to be some ongoing issues as a result of this release and it would be really helpful to have a stronger sense of why they are happening. So far it's just "seems to happen for some people, but not others."

Drupal 8.6.6/8.5.9/7.62 sites still trying to update to 8.6.7/8.5.10/7.63

If you updated to 7.62, 8.5.9., or 8.6.6 using Drush, received errors, and then ran into difficulty getting the site updated to the hotfix releases (which some users have reported), try using the manual update instructions to get your site onto a version of Drupal that better supports Drush: 8.6.7 , 8.5.10 , or 7.63

Sites updated to 8.6.7, 8.5.10, or 7.63

If you have upgraded to 8.6.7 , 8.5.10 , or 7.63 and are still affected by the Fatal error: Uncaught TYPO3\PharStreamWrapper\Exception when running Drush commands, can you do a few things. First:

  1. Ensure the site has been fully updated to the hotfix release by running update.php and then checking the version on the stats report. If you installed the security releases first, you may see the errors when updating to the newer releases, but it might be fixed afterward.
  2. Test Drush again after you've verified the site is on one of 8.6.7, 8.5.10, or 7.63.
  3. If you get errors mentioning cache_get(), double-check that the new libraries at http://cgit.drupalcode.org/drupal/tree/misc/typo3?h=7.x were correctly deployed to your server.

Then, try some of the following:

  1. Try upgrading Drush to the most recent version of Drush 8. Drush 8.1.18 reportedly has a fix that helps resolve the issue.
  2. Try renaming the drush CLI command file back to drush.phar and create a symlink for drush to that file, i.e.:
    mv drush drush.phar ; ln -s drush.phar drush
  3. Attempt your calls using drush.phar instead of drush.
  4. Run drush cc drush outside of a drupal site root after your code is upgraded. Links to drush paths are found in drush cache. 🐛 After upgrade to 7.63, 8.5.10, 8.6.7, 9.4.0 get TYPO3 phar error for drush Fixed
  5. If you can, install Drush with Composer/upgrade Drush to version 9. (This is more involved as some Drush commands have changed and some have been removed, but it's also likely to completely fix the problem).
  6. Try replicating the problem with the same codebase/database in different environments - e.g. does it work locally but fail on your hosting provider? Or vice-versa?
  7. Try replicating the problem with a brand new codebase/database install in the same environment. Does that still cause the problem?
  8. Take note of the directory paths where Drush and Drupal are installed. Are there symlinks? Is Drupal installed in a subdirectory? Etc.

If you can report with details of where you were before/after and what worked/didn't - that will all be enormously helpful.

Proposed resolution

TBD; we need to determine the exact source of the problem.

Remaining tasks

Needs further triage.

User interface changes

N/A

API changes

TBD

Data model changes

N/A

Release notes snippet

TBD

Original report

Porting from https://www.drupal.org/project/drupal/issues/3026386#comment-12929709

Upgraded to drupal 7.63 and still have this issue. Note in the uploaded screeny I tried drush up drupal for kicks but I already had 7.63 in the repository... Doesn't happen on all my sites on this server using the same drush setup... just this one...

the drush command on this server is an alias to a script that calls the drush.phar. Adding a symlink and calling that via the script does nothing for us. example

which drush

alias drush='sudo -u apache /usr/local/bin/scldrush'
    /bin/sudo

scldrush looks like

#!/bin/bash
. /opt/rh/rh-php56/enable
/usr/local/bin/drush "$@"

Where /usr/local/bin/drush is the phar version of drush....

Even following step 3 didn't seem to work here...

What did work was pulling out a composer version of drush... but now I got to get the server admins to get that out there so that cron and the like is using it.

I'm concerned that the way we are looking through the backtrace isn't fool proof. We may want to explore to see if this also allows other phars to slip under the radar is they are good enough to imploy the work around using symlinks?

🐛 Bug report
Status

Fixed

Version

7.0 ⚰️

Component
Base 

Last updated about 11 hours ago

Created by

🇺🇸United States generalredneck

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇬🇧United Kingdom catch

    This should have been split into separate Drupal 8+ and Drupal 7 issues in the first place. I don't think there's anything outstanding for Drupal 9 now, and since this already had multiple commits against Drupal 7 moving back there. This shouldn't be re-opened for Drupal 9/10 again, if there's any follow-up to do, please open a new issue and link it.

    • mcdruid committed 4f3af226 on 7.x
      Issue #3026560 by alexpott, mcdruid, generalredneck, pbirk, plach, xjm,...
  • Status changed to Fixed about 1 year ago
  • 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺

    Having another go at committing #20 again (without reversing it this time).

    With any luck that should address some of the issues people have experienced in D7 (and seems fairly low risk).

    Per #174 let's please not re-open this issue (it was me that reopened it last); if anything else needs to be looked at, let's do so in a follow-up that's specific to the relevant Drupal version.

    Not much chance I've got credit perfectly correct in this issue; apologies if I missed anyone.

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

Production build 0.71.5 2024