Bug 234771 - freebsd-update(8) fails with opaque error attempting to upgrade from other than a release
Summary: freebsd-update(8) fails with opaque error attempting to upgrade from other th...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Ed Maste
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2019-01-09 00:52 UTC by Yuri Victorovich
Modified: 2019-03-05 19:13 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2019-01-09 00:52:27 UTC
Here is the log:

# freebsd-update -r 11.2-CURRENT upgrade
Fetching public key from update2.freebsd.org... failed.
Fetching public key from update1.freebsd.org... failed.
Fetching public key from update4.freebsd.org... failed.
No mirrors remaining, giving up.

# uname -a
FreeBSD hp 11.1-STABLE FreeBSD 11.1-STABLE #1 r326681M: Thu Dec  7 22:18:45 PST 2017     xx@hp:/usr/obj/usr/src/sys/GENERIC  amd64
Comment 1 Yuri Victorovich freebsd_committer 2019-01-09 00:53:09 UTC
The same failure occurs with
# freebsd-update -r 12.0-RELEASE upgrade
Comment 2 Xin LI freebsd_committer 2019-01-09 01:01:23 UTC
My understanding is that you can't upgrade from a -STABLE (or -CURRENT) with freebsd-update.  You should either upgrade by source, or update your system to a releng/ or release/ version via source, then use freebsd-update.

An alternative would be to extract base.txz/kernel.txz from a release iso and overwrite your system with the contents (except etc/ needs to be merged).
Comment 3 Yuri Victorovich freebsd_committer 2019-01-09 01:21:17 UTC
(In reply to Xin LI from comment #2)

Hmm, it should at least say that it can't upgrade from a -STABLE (or -CURRENT). The error above looks more like an internal failure.

Upgrading base in FreeBSD is for the most part rewriting files. It's also strange that it expects some specific versions that it can upgrade, and can't upgrade arbitrary versions.

Yuri
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-09 02:26:52 UTC
(In reply to Yuri Victorovich from comment #3)

One can also use --currently-running <release>, which is a new command line frontend for the previously environment-based variable (UNAME_r) override used to 'fake' the current versions. From man freebsd-update:

     --currently-running release
                    Do not detect the currently-running release; instead,
                    assume that the system is running the specified release.
                    This is most likely to be useful when upgrading jails.

This issue ("fetching key ... failed") is a frequently asked question/reported issue. It would be great to improve the error/messaging and user experience for these cases.
Comment 5 Ed Maste freebsd_committer 2019-01-09 20:39:55 UTC
Subject was "freebsd-update(8) fails on 11.1-STABLE: fetching public key fails", updated to reflect that this is a general issue.
Comment 6 Ed Maste freebsd_committer 2019-01-09 20:43:43 UTC
(In reply to Kubilay Kocak from comment #4)
>   --currently-running release
>                -- Update as if currently running this release

Further issues - this command does not indicate the required format of the "release" string or validate the provided release, so the same opaque error is emitted if the user specifies e.g. "11.2" instead of "11.2-RELEASE".
Comment 7 commit-hook freebsd_committer 2019-01-17 21:39:13 UTC
A commit references this bug:

Author: emaste
Date: Thu Jan 17 21:38:58 UTC 2019
New revision: 343122
URL: https://svnweb.freebsd.org/changeset/base/343122

Log:
  freebsd-update: Clarify unsupported release upgrade error message

  Notify users that upgrading from -CURRENT or -STABLE is unsupported by
  freebsd-update.

  Also ensure --currently-running provides a correctly formatted release
  (as done by -r).

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Reported by:	yuri
  Reviewed by:	bcran
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D18803

Changes:
  head/usr.sbin/freebsd-update/freebsd-update.sh
Comment 8 commit-hook freebsd_committer 2019-01-21 18:42:42 UTC
A commit references this bug:

Author: emaste
Date: Mon Jan 21 18:41:57 UTC 2019
New revision: 343268
URL: https://svnweb.freebsd.org/changeset/base/343268

Log:
  frebsd-update: fix --currently-running after r343122

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Reported by:	Brandon Schneider
  MFC with:	r343122
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D18896

Changes:
  head/usr.sbin/freebsd-update/freebsd-update.sh
Comment 9 commit-hook freebsd_committer 2019-01-21 19:21:22 UTC
A commit references this bug:

Author: emaste
Date: Mon Jan 21 19:21:11 UTC 2019
New revision: 343271
URL: https://svnweb.freebsd.org/changeset/base/343271

Log:
  freebsd-update: Allow upgrade from pre-release builds

  Update r343122 to include -ALPHA, -BETA and -RC releases as
  upgrade-able via freebsd-update.

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Reported by:	delphij, des
  Reviewed by:	delphij
  MFC with:	r343122
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D18881

Changes:
  head/usr.sbin/freebsd-update/freebsd-update.sh
Comment 10 commit-hook freebsd_committer 2019-01-24 18:49:17 UTC
A commit references this bug:

Author: emaste
Date: Thu Jan 24 18:48:16 UTC 2019
New revision: 343410
URL: https://svnweb.freebsd.org/changeset/base/343410

Log:
  freebsd-update: fix style from r343271 change

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  MFC with:	r343271
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.sbin/freebsd-update/freebsd-update.sh
Comment 11 commit-hook freebsd_committer 2019-03-05 19:02:35 UTC
A commit references this bug:

Author: emaste
Date: Tue Mar  5 19:01:58 UTC 2019
New revision: 344814
URL: https://svnweb.freebsd.org/changeset/base/344814

Log:
  MFC freebsd-update: Clarify unsupported release upgrade error message

  MFC r343122:

  freebsd-update: Clarify unsupported release upgrade error message

  Notify users that upgrading from -CURRENT or -STABLE is unsupported by
  freebsd-update.

  Also ensure --currently-running provides a correctly formatted release
  (as done by -r).

  Reported by:	yuri
  Reviewed by:	bcran

  MFC r343268:

  frebsd-update: fix --currently-running after r343122

  Reported by:	Brandon Schneider

  MFC rr343271:

  freebsd-update: Allow upgrade from pre-release builds

  Update r343122 to include -ALPHA, -BETA and -RC releases as
  upgrade-able via freebsd-update.

  Reported by:	delphij, des
  Reviewed by:	delphij

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/12/
  stable/12/usr.sbin/freebsd-update/freebsd-update.sh
Comment 12 commit-hook freebsd_committer 2019-03-05 19:08:44 UTC
A commit references this bug:

Author: emaste
Date: Tue Mar  5 19:07:46 UTC 2019
New revision: 344815
URL: https://svnweb.freebsd.org/changeset/base/344815

Log:
  MFC freebsd-update: Clarify unsupported release upgrade error message

  MFC r343122:

  freebsd-update: Clarify unsupported release upgrade error message

  Notify users that upgrading from -CURRENT or -STABLE is unsupported by
  freebsd-update.

  Also ensure --currently-running provides a correctly formatted release
  (as done by -r).

  Reported by:	yuri
  Reviewed by:	bcran

  MFC r343268:

  frebsd-update: fix --currently-running after r343122

  Reported by:	Brandon Schneider

  MFC r343271:

  freebsd-update: Allow upgrade from pre-release builds

  Update r343122 to include -ALPHA, -BETA and -RC releases as
  upgrade-able via freebsd-update.

  Reported by:	delphij, des
  Reviewed by:	delphij

  MFC r343410:

  freebsd-update: fix style from r343271 change

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/usr.sbin/freebsd-update/freebsd-update.sh
Comment 13 commit-hook freebsd_committer 2019-03-05 19:08:47 UTC
A commit references this bug:

Author: emaste
Date: Tue Mar  5 19:08:38 UTC 2019
New revision: 344816
URL: https://svnweb.freebsd.org/changeset/base/344816

Log:
  MFC r343410:

  freebsd-update: fix style from r343271 change

  PR:		234771
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/12/
  stable/12/usr.sbin/freebsd-update/freebsd-update.sh