Closed Bug 1558973 Opened 5 years ago Closed 5 years ago

Transplant does not clean the working directory when falling back to `patch`, resulting in weird error message "uncommitted changes"

Categories

(Conduit Graveyard :: Transplant, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: smacleod, Assigned: glob)

References

Details

(Keywords: conduit-triaged)

Attachments

(2 files)

There was a failed landing attempt on Lando with a strange errors message[1]. Here is a snippet I pulled from the transplant log output[2] for the attempted landing.

$ hg import -s 95 --no-commit /tmp/tmpG4mVy8
    > applying /tmp/tmpG4mVy8
    > patching file devtools/server/tests/unit/test_logpoint-01.js
    > Hunk #2 FAILED at 64
    > 1 out of 2 hunks FAILED -- saving rejects to file devtools/server/tests/unit/test_logpoint-01.js.rej
    > abort: patch failed to apply

import failed, trying with 'patch': (255, 'applying /tmp/tmpG4mVy8\npatching file devtools/server/tests/unit/test_logpoint-01.js\nHunk #2 FAILED at 64\n1 out of 2 hunks FAILED -- saving rejects to file devtools/server/tests/unit/test_logpoint-01.js.rej\nabort: patch failed to apply', '')

$ hg import -s 95 --no-commit --config ui.patch=patch /tmp/tmpG4mVy8
    > abort: uncommitted changes

The initial hg import failed due to a conflict, which left the working directory in an unclean state (I guess at least one file in the patch applied successfully). The next attempt to import using patch rather than the internal patcher failed because the files were modified.

This manifests as a pretty cryptic abort: uncommitted changes error message in Lando. We'll need to make sure Transplant cleans up the working directory before falling back, and ensure we're sending a good error message.

[1] https://lando.services.mozilla.com/D32721/
[2] Full log output from Transplant for the failed application:

Jun 12 21:54:19 autoland.mozilla.org python[10650]: INFO initiating transplant from tree: gecko rev: D32711 to destination: upstream, attempt 1
Jun 12 21:54:20 autoland.mozilla.org python[10650]: INFO D32711 $ hg identify upstream -r default
Jun 12 21:54:20 autoland.mozilla.org python[10650]: INFO D32711 > 9e7f207a57e5
Jun 12 21:54:20 autoland.mozilla.org python[10650]: INFO D32711 $ hg strip --no-backup -r 'not public()'
Jun 12 21:54:20 autoland.mozilla.org python[10650]: INFO D32711 > abort: empty revision set
Jun 12 21:54:20 autoland.mozilla.org python[10650]: INFO D32711 $ hg --quiet revert --no-backup --all
Jun 12 21:54:23 autoland.mozilla.org python[10650]: INFO D32711 $ hg purge --all
Jun 12 21:54:25 autoland.mozilla.org python[10650]: INFO D32711 $ hg pull upstream
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > pulling from https://hg.mozilla.org/integration/autoland
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > searching for changes
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > adding changesets
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > adding manifests
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > adding file changes
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > added 18 changesets with 457 changes to 436 files
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > new changesets 28c26b4a8e98:9e7f207a57e5
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 > (run 'hg update' to get a working copy)
Jun 12 21:54:32 autoland.mozilla.org python[10650]: INFO D32711 $ hg rebase --abort -r 9e7f207a57e5
Jun 12 21:54:33 autoland.mozilla.org python[10650]: INFO D32711 > abort: no rebase in progress
Jun 12 21:54:33 autoland.mozilla.org python[10650]: INFO D32711 $ hg update --clean -r 9e7f207a57e5
Jun 12 21:54:35 autoland.mozilla.org python[10650]: INFO D32711 > 436 files updated, 0 files merged, 18 files removed, 0 files unresolved
Jun 12 21:54:35 autoland.mozilla.org python[10650]: INFO D32711 $ hg status --modified --added --removed --deleted --unknown --ignored
Jun 12 21:54:37 autoland.mozilla.org python[10650]: INFO D32711 $ hg update 9e7f207a57e5
Jun 12 21:54:37 autoland.mozilla.org python[10650]: INFO D32711 > 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
Jun 12 21:54:38 autoland.mozilla.org python[10650]: INFO D32711 $ hg import -s 95 --no-commit /tmp/tmpG4mVy8
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO D32711 > applying /tmp/tmpG4mVy8
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO D32711 > patching file devtools/server/tests/unit/test_logpoint-01.js
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO D32711 > Hunk #2 FAILED at 64
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO D32711 > 1 out of 2 hunks FAILED -- saving rejects to file devtools/server/tests/unit/test_logpoint-01.js.rej
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO D32711 > abort: patch failed to apply
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO import failed, trying with 'patch': (255, 'applying /tmp/tmpG4mVy8\npatching file devtools/server/tests/unit/test_logpoint-01.js\nHunk #2 FAILED at 64\n1 out of 2 hunks FAILED -- saving rejects to file devtools/server/tests/unit/test_logpoint-01.js.rej\nabort: patch failed to apply', '')
Jun 12 21:54:39 autoland.mozilla.org python[10650]: INFO D32711 $ hg import -s 95 --no-commit --config ui.patch=patch /tmp/tmpG4mVy8
Jun 12 21:54:41 autoland.mozilla.org python[10650]: INFO D32711 > abort: uncommitted changes
Jun 12 21:54:41 autoland.mozilla.org python[10650]: INFO D32711 $ hg strip --no-backup -r 'not public()'
Jun 12 21:54:41 autoland.mozilla.org python[10650]: INFO D32711 > abort: empty revision set
Jun 12 21:54:41 autoland.mozilla.org python[10650]: INFO D32711 $ hg --quiet revert --no-backup --all
Jun 12 21:54:43 autoland.mozilla.org python[10650]: INFO D32711 $ hg purge --all
Jun 12 21:54:45 autoland.mozilla.org python[10650]: ERROR abort: uncommitted changes
Jun 12 21:54:45 autoland.mozilla.org python[10650]: Traceback (most recent call last):
Jun 12 21:54:45 autoland.mozilla.org python[10650]: File "autoland.py", line 159, in handle_pending_transplants
Jun 12 21:54:45 autoland.mozilla.org python[10650]: result = tp.push()
Jun 12 21:54:45 autoland.mozilla.org python[10650]: File "/home/autoland/autoland-transplant/autoland/transplant.py", line 124, in push
Jun 12 21:54:45 autoland.mozilla.org python[10650]: rev = self.apply_changes(target_cset)
Jun 12 21:54:45 autoland.mozilla.org python[10650]: File "/home/autoland/autoland-transplant/autoland/transplant.py", line 371, in apply_changes
Jun 12 21:54:45 autoland.mozilla.org python[10650]: self._apply_patch_from_io_buff(io_buf)
Jun 12 21:54:45 autoland.mozilla.org python[10650]: File "/home/autoland/autoland-transplant/autoland/transplant.py", line 429, in _apply_patch_from_io_buff
Jun 12 21:54:45 autoland.mozilla.org python[10650]: raise Exception(hg_error.out)
Jun 12 21:54:45 autoland.mozilla.org python[10650]: Exception: abort: uncommitted changes

:glob, is there any chance you could fix this up? I won't have time before my flight tomorrow.

Flags: needinfo?(glob)

i can write the patch, however, i doubt there'll be time for a review & deploy before i travel.

Assignee: nobody → glob
Flags: needinfo?(glob)
Summary: Transplant does not clean the working directory when falling back to `patch` → Transplant does not clean the working directory when falling back to `patch`, resulting in weird error message "uncommitted changes"

Failing to clean up the repo before retrying to apply a patch using
patch as the backend results in the patch fallback failing if
hg import was partially applied, with an accompanying cryptic error
message of "uncommitted changes".

Clean up the repo and fix the test.

I just wanted to mention that you also see this warning if you try
to land again a changeset which has already landed on autoland:
https://lando.services.mozilla.com/D33673/

Attached image Screenshot

I just ran into this "uncommitted changes" mystery error as well, on initial landing attempt.

sorry about the delays here; i've been quite unwell since whistler. this is top of my list to address after i've dealt with my backlog of email.

edit: i was not as well as i thought i was last week and had to take another full week off

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Product: Conduit → Conduit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: