Answers.Body: <p>If you can upgrade civi to 5.52+ then do that.</p>
  <p>If not you could restrict zeta mail to an earlier version, e.g. <code>composer require zetacomponents/mail:1.9.2</code>, but then remember to remove that from composer.json when you do upgrade civi later.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-07T18:36:40.877Z
Answers.LastActivityDate: 2022-09-07T18:36:40.877Z
Answers.UserDisplayName: Demerit
Body: <p>I try to update a Drupalmachine on 9.4.5 site via composer 2.4.1.
  <code>~/bin/composer.phar update drupal/core &quot;drupal/core-*&quot; --with-all-dependencies</code> (see below for composer.json)</p>
  <p>first try i can run it and get into interactive question that drupal/coder has multiple files changed (439) and what i want to do:</p>
  <pre><code>y - discard changes and apply the update
  n - abort the update and let you manually clean things up
  v - view modified files
  d - view local modifications (diff)
  s - stash changes and try to reapply them after the update
  ? - print help
  </code></pre>
  <p>i try to choose 'yes', but unfortunately i ran into a problem that patch 86 from zetacomponents/mail can not be applied and the update crashed. This patch seemed to be <a href="https://github.com/zetacomponents/Mail/pull/86" rel="nofollow noreferrer">merged</a> and old
  composer try to install zetamail in version 1.9.3.
  I tried to apply the patch manually on the files, but this
  doesnt work either.</p>
  <p>Here is the shortend version of the run through the update to the  error. After gathering the patches it got this errormessage, that the patches doesnt apply.</p>
  <pre><code>Applying patches for zetacomponents/mail
      https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
      https://github.com/zetacomponents/Mail/pull/86.patch (Allow single quotes to be used in return path)
     Could not apply patch! Skipping. The error was: Cannot apply patch https://github.com/zetacomponents/Mail/pull/86.patch
  
  In Patches.php line 326:
                                                                                                                              
    Cannot apply patch Allow single quotes to be used in return path (https://github.com/zetacomponents/Mail/pull/86.patch)!  
  </code></pre>
  <p>Like suggested I provide the composer.json:</p>
  <pre><code>{
    &quot;name&quot;: &quot;drupal-composer/drupal-project&quot;,
    &quot;description&quot;: &quot;Project template for Drupal 8 projects with composer&quot;,
    &quot;type&quot;: &quot;project&quot;,
    &quot;license&quot;: &quot;GPL-2.0-or-later&quot;,
    &quot;authors&quot;: [
      {
        &quot;name&quot;: &quot;&quot;,
        &quot;role&quot;: &quot;&quot;
      }
    ],
    &quot;repositories&quot;: [
      {
        &quot;type&quot;: &quot;composer&quot;,
        &quot;url&quot;: &quot;https://packages.drupal.org/8&quot;
      }
    ],
    &quot;require&quot;: {
      &quot;php&quot;: &quot;&gt;=7.0.8&quot;,
      &quot;civicrm/civicrm-asset-plugin&quot;: &quot;~1.1&quot;,
      &quot;civicrm/civicrm-core&quot;: &quot;5.49.4&quot;,
      &quot;civicrm/civicrm-drupal-8&quot;: &quot;5.49.4&quot;,
      &quot;civicrm/civicrm-packages&quot;: &quot;5.49.4&quot;,
      &quot;composer/installers&quot;: &quot;^1.2&quot;,
      &quot;cweagans/composer-patches&quot;: &quot;^1.6.5&quot;,
      &quot;drupal/admin_toolbar&quot;: &quot;^3.0&quot;,
      &quot;drupal/civicrm_entity&quot;: &quot;^3.0@beta&quot;,
      &quot;drupal/console&quot;: &quot;^1.0.2&quot;,
      &quot;drupal/content_access&quot;: &quot;^1.0@alpha&quot;,
      &quot;drupal/context&quot;: &quot;^4.1&quot;,
      &quot;drupal/core&quot;: &quot;^9.0.0&quot;,
      &quot;drupal/core-composer-scaffold&quot;: &quot;^9&quot;,
      &quot;drupal/core-project-message&quot;: &quot;^9&quot;,
      &quot;drupal/core-recommended&quot;: &quot;^9&quot;,
      &quot;drupal/entity&quot;: &quot;^1.2&quot;,
      &quot;drupal/honeypot&quot;: &quot;^2.0&quot;,
      &quot;drupal/libraries&quot;: &quot;^3.0@beta&quot;,
      &quot;drupal/role_delegation&quot;: &quot;^1.1&quot;,
      &quot;drupal/rules&quot;: &quot;^3.0@alpha&quot;,
      &quot;drupal/token&quot;: &quot;^1.10&quot;,
      &quot;drupal/typed_data&quot;: &quot;^1.0@beta&quot;,
      &quot;drupal/upgrade_status&quot;: &quot;^3.12&quot;,
      &quot;drupal/views_aggregator&quot;: &quot;^2.0&quot;,
      &quot;drupal/views_data_export&quot;: &quot;^1.1&quot;,
      &quot;drupal/webform&quot;: &quot;^6.1&quot;,
      &quot;drupal/webform_civicrm&quot;: &quot;^6.0&quot;,
      &quot;drush/drush&quot;: &quot;^9.7.1 | ^10.0.0&quot;,
      &quot;howtomakeaturn/pdfinfo&quot;: &quot;1.*&quot;,
      &quot;vlucas/phpdotenv&quot;: &quot;^4.0&quot;,
      &quot;webflo/drupal-finder&quot;: &quot;^1.0.0&quot;,
      &quot;zaporylie/composer-drupal-optimizations&quot;: &quot;^1.0&quot;
    },
    &quot;require-dev&quot;: {
      &quot;drupal/core-dev&quot;: &quot;^9&quot;
    },
    &quot;conflict&quot;: {
      &quot;drupal/drupal&quot;: &quot;*&quot;
    },
    &quot;minimum-stability&quot;: &quot;dev&quot;,
    &quot;prefer-stable&quot;: true,
    &quot;config&quot;: {
      &quot;sort-packages&quot;: true,
      &quot;allow-plugins&quot;: {
        &quot;composer/installers&quot;: true,
        &quot;cweagans/composer-patches&quot;: true,
        &quot;civicrm/composer-compile-plugin&quot;: true,
        &quot;civicrm/composer-downloads-plugin&quot;: true,
        &quot;civicrm/civicrm-asset-plugin&quot;: true,
        &quot;drupal/console-extend-plugin&quot;: true,
        &quot;drupal/core-composer-scaffold&quot;: true,
        &quot;drupal/core-project-message&quot;: true,
        &quot;zaporylie/composer-drupal-optimizations&quot;: true,
        &quot;dealerdirect/phpcodesniffer-composer-installer&quot;: true
      }
    },
    &quot;autoload&quot;: {
      &quot;classmap&quot;: [
        &quot;scripts/composer/ScriptHandler.php&quot;
      ],
      &quot;files&quot;: [
        &quot;load.environment.php&quot;
      ]
    },
    &quot;scripts&quot;: {
      &quot;pre-install-cmd&quot;: [
        &quot;DrupalProject\\composer\\ScriptHandler::checkComposerVersion&quot;
      ],
      &quot;pre-update-cmd&quot;: [
        &quot;DrupalProject\\composer\\ScriptHandler::checkComposerVersion&quot;
      ],
      &quot;post-install-cmd&quot;: [
        &quot;DrupalProject\\composer\\ScriptHandler::createRequiredFiles&quot;
      ],
      &quot;post-update-cmd&quot;: [
        &quot;DrupalProject\\composer\\ScriptHandler::createRequiredFiles&quot;
      ]
    },
    &quot;extra&quot;: {
      &quot;composer-exit-on-patch-failure&quot;: true,
      &quot;patchLevel&quot;: {
        &quot;drupal/core&quot;: &quot;-p2&quot;
      },
      &quot;drupal-scaffold&quot;: {
        &quot;locations&quot;: {
          &quot;web-root&quot;: &quot;web/&quot;
        }
      },
      &quot;installer-paths&quot;: {
        &quot;web/core&quot;: [
          &quot;type:drupal-core&quot;
        ],
        &quot;web/libraries/{$name}&quot;: [
          &quot;type:drupal-library&quot;
        ],
        &quot;web/modules/contrib/{$name}&quot;: [
          &quot;type:drupal-module&quot;
        ],
        &quot;web/profiles/contrib/{$name}&quot;: [
          &quot;type:drupal-profile&quot;
        ],
        &quot;web/themes/contrib/{$name}&quot;: [
          &quot;type:drupal-theme&quot;
        ],
        &quot;drush/Commands/contrib/{$name}&quot;: [
          &quot;type:drupal-drush&quot;
        ]
      },
      &quot;civicrm-asset&quot;: {
        &quot;path&quot;: &quot;web/libraries/civicrm&quot;,
        &quot;url&quot;: &quot;/libraries/civicrm&quot;,
        &quot;assets:packages&quot;: {
          &quot;+include&quot;: [
            &quot;kcfinder/**&quot;
          ]
        }
      },
      &quot;enable-patching&quot;: &quot;true&quot;,
      &quot;compile-whitelist&quot;: [
        &quot;civicrm/civicrm-core&quot;,
        &quot;civicrm/composer-compile-lib&quot;
      ],
      &quot;compile-mode&quot;: &quot;all&quot;
    }
  }
  </code></pre>
  <p>I it save to try <code>&quot;composer-exit-on-patch-failure&quot;: false</code> or is that safe? I find this question <a href="https://civicrm.stackexchange.com/questions/42439/update-civicrm-with-composer-fails-during-patching-cannot-apply-patch-allow-si">here</a> but there is the Answer that the Patch is  not important anymore, but no
  statement how to get around the Error. Also I am stuck at a place that that the update
  fail, regardless of the use of <code>composer upgrade</code> or <code>composer update</code>, i cant
  get to the [y,n,v,d,s,?] decision anymore.
  Is there a method to get the update done?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-13T15:24:35.310Z
Comments.Text: Did you find a solution for that? I keep getting this error but strangely only on our production environment. For all local development versions as well as for the dev/stage remote version this problem does not appear. we just updated to CiviCRM 5.54 but the issue still exists.
Comments.UserDisplayName: Tobias Krause
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-15T08:01:39.197Z
Comments.Text: I used to upgrade civi as @demerit suggested, then i updated drupal. The civi update removes the old zeta patch and then the drupal update works just fine.
Comments.UserDisplayName: gzwg
Tags: <email><upgrade><composer><failure>
Title: Composer Drupal Update fails because unappliable Patch of Civicrms zetacomponents/mail
ThreadText: # Composer Drupal Update fails because unappliable Patch of Civicrms zetacomponents/mail
  
  (Asked by: username_0 on 2022-09-07)
  
  I try to update a Drupalmachine on 9.4.5 site via composer 2.4.1.
  `~/bin/composer.phar update drupal/core "drupal/core-*" --with-all-dependencies` (see below for composer.json)
  
  first try i can run it and get into interactive question that drupal/coder has multiple files changed (439) and what i want to do:
  
  ```
  y - discard changes and apply the update
  n - abort the update and let you manually clean things up
  v - view modified files
  d - view local modifications (diff)
  s - stash changes and try to reapply them after the update
  ? - print help
  
  ```
  
  i try to choose 'yes', but unfortunately i ran into a problem that patch 86 from zetacomponents/mail can not be applied and the update crashed. This patch seemed to be [merged](https://github.com/zetacomponents/Mail/pull/86) and old
  composer try to install zetamail in version 1.9.3.
  I tried to apply the patch manually on the files, but this
  doesnt work either.
  
  Here is the shortend version of the run through the update to the error. After gathering the patches it got this errormessage, that the patches doesnt apply.
  
  ```
  Applying patches for zetacomponents/mail
      https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
      https://github.com/zetacomponents/Mail/pull/86.patch (Allow single quotes to be used in return path)
     Could not apply patch! Skipping. The error was: Cannot apply patch https://github.com/zetacomponents/Mail/pull/86.patch
  
  In Patches.php line 326:
                                                                                                                              
    Cannot apply patch Allow single quotes to be used in return path (https://github.com/zetacomponents/Mail/pull/86.patch)!  
  
  ```
  
  Like suggested I provide the composer.json:
  
  ```
  {
    "name": "drupal-composer/drupal-project",
    "description": "Project template for Drupal 8 projects with composer",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
      {
        "name": "",
        "role": ""
      }
    ],
    "repositories": [
      {
        "type": "composer",
        "url": "https://packages.drupal.org/8"
      }
    ],
    "require": {
      "php": ">=7.0.8",
      "civicrm/civicrm-asset-plugin": "~1.1",
      "civicrm/civicrm-core": "5.49.4",
      "civicrm/civicrm-drupal-8": "5.49.4",
      "civicrm/civicrm-packages": "5.49.4",
      "composer/installers": "^1.2",
      "cweagans/composer-patches": "^1.6.5",
      "drupal/admin_toolbar": "^3.0",
      "drupal/civicrm_entity": "^3.0@beta",
      "drupal/console": "^1.0.2",
      "drupal/content_access": "^1.0@alpha",
      "drupal/context": "^4.1",
      "drupal/core": "^9.0.0",
      "drupal/core-composer-scaffold": "^9",
      "drupal/core-project-message": "^9",
      "drupal/core-recommended": "^9",
      "drupal/entity": "^1.2",
      "drupal/honeypot": "^2.0",
      "drupal/libraries": "^3.0@beta",
      "drupal/role_delegation": "^1.1",
      "drupal/rules": "^3.0@alpha",
      "drupal/token": "^1.10",
      "drupal/typed_data": "^1.0@beta",
      "drupal/upgrade_status": "^3.12",
      "drupal/views_aggregator": "^2.0",
      "drupal/views_data_export": "^1.1",
      "drupal/webform": "^6.1",
      "drupal/webform_civicrm": "^6.0",
      "drush/drush": "^9.7.1 | ^10.0.0",
      "howtomakeaturn/pdfinfo": "1.*",
      "vlucas/phpdotenv": "^4.0",
      "webflo/drupal-finder": "^1.0.0",
      "zaporylie/composer-drupal-optimizations": "^1.0"
    },
    "require-dev": {
      "drupal/core-dev": "^9"
    },
    "conflict": {
      "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
      "sort-packages": true,
      "allow-plugins": {
        "composer/installers": true,
        "cweagans/composer-patches": true,
        "civicrm/composer-compile-plugin": true,
        "civicrm/composer-downloads-plugin": true,
        "civicrm/civicrm-asset-plugin": true,
        "drupal/console-extend-plugin": true,
        "drupal/core-composer-scaffold": true,
        "drupal/core-project-message": true,
        "zaporylie/composer-drupal-optimizations": true,
        "dealerdirect/phpcodesniffer-composer-installer": true
      }
    },
    "autoload": {
      "classmap": [
        "scripts/composer/ScriptHandler.php"
      ],
      "files": [
        "load.environment.php"
      ]
    },
    "scripts": {
      "pre-install-cmd": [
        "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
      ],
      "pre-update-cmd": [
        "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
      ],
      "post-install-cmd": [
        "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
      ],
      "post-update-cmd": [
        "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
      ]
    },
    "extra": {
      "composer-exit-on-patch-failure": true,
      "patchLevel": {
        "drupal/core": "-p2"
      },
      "drupal-scaffold": {
        "locations": {
          "web-root": "web/"
        }
      },
      "installer-paths": {
        "web/core": [
          "type:drupal-core"
        ],
        "web/libraries/{$name}": [
          "type:drupal-library"
        ],
        "web/modules/contrib/{$name}": [
          "type:drupal-module"
        ],
        "web/profiles/contrib/{$name}": [
          "type:drupal-profile"
        ],
        "web/themes/contrib/{$name}": [
          "type:drupal-theme"
        ],
        "drush/Commands/contrib/{$name}": [
          "type:drupal-drush"
        ]
      },
      "civicrm-asset": {
        "path": "web/libraries/civicrm",
        "url": "/libraries/civicrm",
        "assets:packages": {
          "+include": [
            "kcfinder/**"
          ]
        }
      },
      "enable-patching": "true",
      "compile-whitelist": [
        "civicrm/civicrm-core",
        "civicrm/composer-compile-lib"
      ],
      "compile-mode": "all"
    }
  }
  
  ```
  
  I it save to try `"composer-exit-on-patch-failure": false` or is that safe? I find this question [here](https://civicrm.stackexchange.com/questions/42439/update-civicrm-with-composer-fails-during-patching-cannot-apply-patch-allow-si) but there is the Answer that the Patch is not important anymore, but no
  statement how to get around the Error. Also I am stuck at a place that that the update
  fail, regardless of the use of `composer upgrade` or `composer update`, i cant
  get to the [y,n,v,d,s,?] decision anymore.
  Is there a method to get the update done?
  
  **Tags:** email, upgrade, composer, failure
  
  > **Comments:**
  > **username_1**: Did you find a solution for that? I keep getting this error but strangely only on our production environment. For all local development versions as well as for the dev/stage remote version this problem does not appear. we just updated to CiviCRM 5.54 but the issue still exists.  
  > **username_0**: I used to upgrade civi as @username_2 suggested, then i updated drupal. The civi update removes the old zeta patch and then the drupal update works just fine.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-09-07. Score: 1 | Accepted answer
  
  If you can upgrade civi to 5.52+ then do that.
  
  If not you could restrict zeta mail to an earlier version, e.g. `composer require zetacomponents/mail:1.9.2`, but then remember to remove that from composer.json when you do upgrade civi later.
  
  
  ---
  
  