Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 835633 - "ERROR: state finish mismatch" when exiting mock --shell
Summary: "ERROR: state finish mismatch" when exiting mock --shell
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-26 16:37 UTC by Ville Skyttä
Modified: 2012-11-20 19:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-15 02:32:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
[PATCH] fix state start/finish mismatch in --chroot (822 bytes, patch)
2012-08-22 03:06 UTC, Mathieu Bridon
no flags Details | Diff
[PATCH] fix state start/finish mismatch on 'device setup' (5.70 KB, patch)
2012-09-04 09:09 UTC, Mathieu Bridon
no flags Details | Diff
[PATCH] Handle failures in the various setups before --shell (1.24 KB, patch)
2012-09-04 09:11 UTC, Mathieu Bridon
no flags Details | Diff
[PATCH] fix state start/finish mismatch when 'rpmbuild -bs' fails (2.02 KB, patch)
2012-09-04 10:40 UTC, Mathieu Bridon
no flags Details | Diff

Description Ville Skyttä 2012-06-26 16:37:59 UTC
With current mock upstream git master:

$ mock --shell
INFO: mock.py version unreleased_version starting...
[...]
Start: shell
<mock-chroot>[root@box /]# exit
logout
ERROR: state finish mismatch: current: shell, state: lock buildroot

I suppose the error message is bogus or something forgets to set a state somewhere.

Comment 1 Clark Williams 2012-06-29 15:14:18 UTC
Yes, sorry I just caught this. It's a bogus error and I have the fix queued for the next release.

Comment 2 Mathieu Bridon 2012-08-22 03:06:03 UTC
Created attachment 606100 [details]
[PATCH] fix state start/finish mismatch in --chroot

The same problem happens with --chroot:
    $ mock --chroot ls
    INFO: mock.py version 1.1.26 starting...
    [... snip ...]
    ERROR: state finish mismatch: current: chroot ls, state: lock buildroot

Attached patch is similar to the Git commit which fixed the error with --shell (ff524a6713538299463c6553d965b5af6193b1fa)

Comment 3 Clark Williams 2012-08-23 19:34:05 UTC
(In reply to comment #2)
> Created attachment 606100 [details]
> [PATCH] fix state start/finish mismatch in --chroot
> 
> The same problem happens with --chroot:
>     $ mock --chroot ls
>     INFO: mock.py version 1.1.26 starting...
>     [... snip ...]
>     ERROR: state finish mismatch: current: chroot ls, state: lock buildroot
> 
> Attached patch is similar to the Git commit which fixed the error with
> --shell (ff524a6713538299463c6553d965b5af6193b1fa)

Applied to my git tree and will show up in the next release.

Comment 4 Trond H. Amundsen 2012-08-29 13:42:11 UTC
I don't know if this is related, but I've encountered something similar on my F17 build host in our local Koji installation (using 1.1.26-2.fc17):

ERROR: state finish mismatch: current: chroot ['make', 'sources'], state: lock buildroot

It fails in SRPM build while doing 'make sources' on a Makefile that only contains this:

sources:
        @echo "Nothing to do here..."

I've been trying older mock versions and the latest that works for me is mock-1.1.22-2.1.fc17.

Comment 5 Clark Williams 2012-08-29 18:06:33 UTC
(In reply to comment #4)
> I don't know if this is related, but I've encountered something similar on
> my F17 build host in our local Koji installation (using 1.1.26-2.fc17):
> 
> ERROR: state finish mismatch: current: chroot ['make', 'sources'], state:
> lock buildroot

Yes, this is probably what you're hitting.

Comment 6 Mathieu Bridon 2012-09-04 08:02:59 UTC
(for some reason I wasn't CC-ed on this bug even though I commented, so I never received your reply)

(In reply to comment #3)
> (In reply to comment #2)
> > Created attachment 606100 [details]
> > [PATCH] fix state start/finish mismatch in --chroot
> > 
> > The same problem happens with --chroot:
> >     $ mock --chroot ls
> >     INFO: mock.py version 1.1.26 starting...
> >     [... snip ...]
> >     ERROR: state finish mismatch: current: chroot ls, state: lock buildroot
> > 
> > Attached patch is similar to the Git commit which fixed the error with
> > --shell (ff524a6713538299463c6553d965b5af6193b1fa)
> 
> Applied to my git tree and will show up in the next release.

First, I can't find the commit in the upstream Git tree. Did you apply verbatim or did you change something? (I'm asking because I rebuild mock with this patch applied, so if I got something wrong it would be nice to know :)

Also, I found another instance of the same bug: _setupDev() doesn't try/catch, so any exception it raises is raised to the caller (e.g shell() ).

So the self.finish("device setup") never gets called (because it's at the end of _setupDev(), after the exception has been raised), and instead the caller catches the exception and tries to finish its own state (e.g self.finish("shell") ), causing the mismatch.

I'll try to cook up a patch to fix it soon.

Comment 7 Mathieu Bridon 2012-09-04 09:09:07 UTC
Created attachment 609603 [details]
[PATCH] fix state start/finish mismatch on 'device setup'

This fixes the problem I described in comment 6.

Comment 8 Mathieu Bridon 2012-09-04 09:11:24 UTC
Created attachment 609604 [details]
[PATCH] Handle failures in the various setups before --shell

While the previous patch fixes the issue I described in comment 6, it only lets mock to fail on yet another start/finish mismatch later on, which this patch fixes.

Comment 9 Mathieu Bridon 2012-09-04 10:40:48 UTC
Created attachment 609624 [details]
[PATCH] fix state start/finish mismatch when 'rpmbuild -bs' fails

And one more state mismatch issue.

This one appears when building the srpm fails, for example if you forget to commit/push patches which are referenced in the spec file.

Comment 10 Clark Williams 2012-09-06 18:33:14 UTC
(In reply to comment #6)
> First, I can't find the commit in the upstream Git tree. Did you apply
> verbatim or did you change something? (I'm asking because I rebuild mock
> with this patch applied, so if I got something wrong it would be nice to
> know :)
> 

Did you look in the 'work' branch? That is where I do stuff before commiting to a build. Of course it's entirely possible that I hadn't pushed it back to the origin...


> Also, I found another instance of the same bug: _setupDev() doesn't
> try/catch, so any exception it raises is raised to the caller (e.g shell() ).
> 
> So the self.finish("device setup") never gets called (because it's at the
> end of _setupDev(), after the exception has been raised), and instead the
> caller catches the exception and tries to finish its own state (e.g
> self.finish("shell") ), causing the mismatch.
> 
> I'll try to cook up a patch to fix it soon.

I applied the three patches from #c7, #c8 and *c9 to my tree and have pushed it to the main git tree (still in the work branch).

Comment 11 Fedora Update System 2012-09-14 15:26:46 UTC
mock-1.1.27-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.27-2.el6

Comment 12 Fedora Update System 2012-09-14 15:28:01 UTC
mock-1.1.27-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mock-1.1.27-2.fc16

Comment 13 Fedora Update System 2012-09-14 15:28:59 UTC
mock-1.0.35-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.35-1.el5

Comment 14 Fedora Update System 2012-09-14 15:29:53 UTC
mock-1.1.27-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/mock-1.1.27-2.fc17

Comment 15 Fedora Update System 2012-09-16 18:28:59 UTC
Package mock-1.1.27-2.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.1.27-2.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-12915/mock-1.1.27-2.el6
then log in and leave karma (feedback).

Comment 16 Fedora Update System 2012-11-01 21:08:57 UTC
mock-1.1.28-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.28-1.el6

Comment 17 Fedora Update System 2012-11-01 21:10:21 UTC
mock-1.1.28-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc18

Comment 18 Fedora Update System 2012-11-01 21:11:33 UTC
mock-1.0.36-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.36-1.el5

Comment 19 Fedora Update System 2012-11-01 21:12:44 UTC
mock-1.1.28-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc17

Comment 20 Fedora Update System 2012-11-01 21:13:51 UTC
mock-1.1.28-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc16

Comment 21 Fedora Update System 2012-11-15 02:32:21 UTC
mock-1.1.28-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2012-11-15 02:34:46 UTC
mock-1.1.28-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2012-11-20 19:36:56 UTC
mock-1.0.36-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.