Bug 205273 - ports-mgmt/poudriere: Failed update deletes jail
Summary: ports-mgmt/poudriere: Failed update deletes jail
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-12 18:42 UTC by leeb
Modified: 2018-01-24 20:39 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bdrewery)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description leeb 2015-12-12 18:42:02 UTC
I attempted to update my jail with poudriere 3.1.10 using the following:

poudriere jail -u -j 101amd64 -f none -M /usr/local/SystemBuilder/src/10.1-releng

However the pathname was wrong.

The result was removal of the jail.  It would be much friendlier if the original jail was retained.
10.1-RELEASE-p4 FreeBSD 10.1-RELEASE-p4 #0
Comment 1 Bryan Drewery freebsd_committer freebsd_triage 2015-12-15 17:31:52 UTC
Yes this is wrong. It should just rollback to the good version.
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2016-01-06 18:01:15 UTC
What method was the jail created with?

The only case I see where an update will delete a jail is when '-m url=' is used. There is no way for -u to work with a URL, so it deletes it first then recreates it from the latest image.

allbsd|gjb|url=*)
        [ -z "${VERSION}" ] && VERSION=$(jget ${JAILNAME} version)
        [ -z "${ARCH}" ] && ARCH=$(jget ${JAILNAME} arch)
        delete_jail
        create_jail
        ;;
Comment 3 leeb 2016-01-06 19:06:30 UTC
The jail would have been created with '-m url='.  My internet is too slow, so I spin my own world.

It seems the url and directory are retained somewhere:

# poudriere jail -l
101amd64 10.1-RELEASE-p24 amd64 url=/usr/local/SystemBuilder/export/Server_Std/release/ftp 2015-12-12 10:30:12 /usr/local/poudriere/jails/101amd64

So could it not rename the jail directory first, attempt the create, then take appropriate action on success/failure?

-----

Looking further I see my use of -M was wrong, my intention was not to null-mount, but to use the produced .txz's, so I suspect my intuition of using:

poudriere jail -u -j 101amd64

probably barfed because the original url no longer existed (I just tried that on another jail and it worked correctly, as you describe, delete, create).

Maybe in this case, poudriere should balk and tell me it was created with url= so cannot be updated to null-mount?
Comment 4 Walter Schwarzenfeld 2018-01-17 07:27:45 UTC
Is this still relevant?
Comment 5 Bryan Drewery freebsd_committer freebsd_triage 2018-01-24 20:39:16 UTC
Yup this was fixed in 3.2.