Problem/Motivation

Tried testing a patch with 9.3.x and got error:

Composer could not find a composer.json file in /var/lib/tugboat/stm/web

Testing with 10.0.x resulted in this error:

The requested submission failed. 113%

Steps to reproduce

  1. Use drupal 9.3.x
  2. Under advanced options, add patch: https://www.drupal.org/files/issues/2021-05-03/3191725-28.patch
  3. Click "Launch sandbox"
  4. Get error something like below
6092f4a40884135880ecb5f3# /bin/sh -c wget -O/dev/null https://simplytest.me/tugboat/update/status/stm6092f486e99a2/140

--2021-05-05 19:42:38-- https://simplytest.me/tugboat/update/status/stm6092f486e99a2/140

Resolving simplytest.me (simplytest.me)...

5.9.96.196 Connecting to simplytest.me (simplytest.me)|5.9.96.196|:443...

connected.

HTTP request sent, awaiting response...

200 OK Length: unspecified [text/html] Saving to: ‘/dev/null’ 0K

0.00 =0s 2021-05-05 19:42:38 (0.00 B/s) - ‘/dev/null’ saved [0]

6092f4a40884135880ecb5f3# /bin/sh -c cd "${DOCROOT}" && composer patch-enable --file='patches.json'

Composer could not find a composer.json file in /var/lib/tugboat/stm/web To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

Command Failed (Tugboat Error 1064): Exit code (1)

Proposed resolution

  1. Find offending code
  2. Fix it :)

Remaining tasks

  1. Research
  2. Patch
  3. Test
  4. Release

User interface changes

TBD... possibly doesn't show some releases?

API changes

Data model changes

Comments

Kristen Pol created an issue. See original summary.

mglaman’s picture

Version: 8.x-4.x-dev » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Was this on the live site or beta? I think live, we fixed it in beta with this:

  private function getComposerPatchCommand($project_name, $patch) {
    return sprintf(
      'cd stm && composer patch-add drupal/%s "STM patch %s" "%s"',
      $project_name,
      basename($patch),
      $patch
    );
  }

Composer patching needs cd stm and not docroot.