Bug 1331864 - ValueError: Error enabling service chronyd: 1
Summary: ValueError: Error enabling service chronyd: 1
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c5b876a659cf72a7f4b103032c3...
: 1379173 1442856 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-29 20:51 UTC by Adam Williamson
Modified: 2017-04-17 19:06 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-12 17:39:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: anaconda-tb (963.12 KB, text/plain)
2016-04-29 20:51 UTC, Adam Williamson
no flags Details
File: anaconda.log (176.68 KB, text/plain)
2016-04-29 20:51 UTC, Adam Williamson
no flags Details
File: environ (459 bytes, text/plain)
2016-04-29 20:51 UTC, Adam Williamson
no flags Details
File: lsblk_output (2.21 KB, text/plain)
2016-04-29 20:51 UTC, Adam Williamson
no flags Details
File: lvm.log (168.82 KB, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details
File: nmcli_dev_list (1.20 KB, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details
File: os_info (451 bytes, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details
File: program.log (114.38 KB, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details
File: storage.log (99.79 KB, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details
File: syslog (251.29 KB, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details
File: ifcfg.log (2.40 KB, text/plain)
2016-04-29 20:52 UTC, Adam Williamson
no flags Details

Description Adam Williamson 2016-04-29 20:51:49 UTC
Description of problem:
Happens in post-install phase with current Rawhide Atomic installer nightly images, see e.g. https://openqa.stg.fedoraproject.org/tests/15371 . I believe this is caused by the setup method of the Timezone class in pyanaconda/kickstart.py, which assumes it can just add chrony to the list of packages to install and then add chronyd to the list of the services to enable, without considering the install methods (Atomic and live) where packages are not used. I believe this would also break on a live image that happened not to include chrony.

Version-Release number of selected component:
anaconda-25.9-1

The following was filed automatically by anaconda:
anaconda 25.9-1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python3.5/site-packages/pyanaconda/iutil.py", line 789, in enable_service
    raise ValueError("Error enabling service %s: %s" % (service, ret))
  File "/usr/lib64/python3.5/site-packages/pyanaconda/kickstart.py", line 1665, in execute
    iutil.enable_service(svc)
  File "/usr/lib64/python3.5/site-packages/pyanaconda/install.py", line 79, in doConfiguration
    ksdata.services.execute(storage, ksdata, instClass)
  File "/usr/lib64/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.5/site-packages/pyanaconda/threads.py", line 253, in run
    threading.Thread.run(self, *args, **kwargs)
ValueError: Error enabling service chronyd: 1

Additional info:
addons:         com_redhat_kdump, com_redhat_docker
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=Fedora-Rawhide-x86_64 quiet
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         4.6.0-0.rc5.git1.1.fc25.x86_64
product:        Fedora
release:        Cannot get release name.
reproducible:   Not sure how to reproduce the problem
type:           anaconda
version:        rawhide

Comment 1 Adam Williamson 2016-04-29 20:51:54 UTC
Created attachment 1152403 [details]
File: anaconda-tb

Comment 2 Adam Williamson 2016-04-29 20:51:56 UTC
Created attachment 1152404 [details]
File: anaconda.log

Comment 3 Adam Williamson 2016-04-29 20:51:57 UTC
Created attachment 1152405 [details]
File: environ

Comment 4 Adam Williamson 2016-04-29 20:51:58 UTC
Created attachment 1152406 [details]
File: lsblk_output

Comment 5 Adam Williamson 2016-04-29 20:52:00 UTC
Created attachment 1152407 [details]
File: lvm.log

Comment 6 Adam Williamson 2016-04-29 20:52:01 UTC
Created attachment 1152408 [details]
File: nmcli_dev_list

Comment 7 Adam Williamson 2016-04-29 20:52:02 UTC
Created attachment 1152409 [details]
File: os_info

Comment 8 Adam Williamson 2016-04-29 20:52:04 UTC
Created attachment 1152410 [details]
File: program.log

Comment 9 Adam Williamson 2016-04-29 20:52:06 UTC
Created attachment 1152411 [details]
File: storage.log

Comment 10 Adam Williamson 2016-04-29 20:52:08 UTC
Created attachment 1152412 [details]
File: syslog

Comment 11 Adam Williamson 2016-04-29 20:52:09 UTC
Created attachment 1152413 [details]
File: ifcfg.log

Comment 12 Adam Williamson 2016-04-29 20:57:15 UTC
So interestingly the setup method logic here is quite old; https://github.com/rhinstaller/anaconda/commit/db800dc1bcb62cb8f811adae09a5b07c4f71ea5f doesn't seem like its changes to kickstart.py would have triggered this. *But* I'm wondering if the move of where the setup method is actually called - from pyanaconda/ui/gui/spokes/datetime_spoke.py to pyanaconda/install.py - might be the culprit. Maybe when it was in the spoke it didn't get run on Atomic installs, but when it's in install.py it does?

Comment 13 Adam Williamson 2016-05-19 15:37:18 UTC
Still happening - https://openqa.fedoraproject.org/tests/18178 is the failure for 20160519.n.0.

Comment 14 Adam Williamson 2016-06-08 18:25:05 UTC
is anyone planning on fixing this any time soon? Install from the Atomic installer image has been broken in Rawhide for a month and a half now...

Comment 15 Seth Jennings 2016-06-16 19:13:00 UTC
I hit this as well.  I noticed that something along the way added a %packages section with chronyd in it, which of course isn't going to work on an atomic install.

Comment 16 Jan Kurik 2016-07-26 04:04:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 17 Adam Williamson 2016-08-04 21:18:58 UTC
Still broken, more than three months now. Does anyone actually care about this image?

Comment 18 Jan Sedlák 2016-08-17 10:28:58 UTC
Similar problem has been detected:

Tried to install Fedora Atomic from Fedora-25-20160815.n.2, this showed during installation in "configuring installed system" phase.

addons:         com_redhat_docker, com_redhat_kdump
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=Fedora-25-x86_64 quiet
hashmarkername: anaconda
kernel:         4.8.0-0.rc1.git0.1.fc25.x86_64
package:        anaconda-25.20-1
packaging.log:  
product:        Fedora
reason:         ValueError: Error enabling service chronyd: 1
release:        Cannot get release name.
version:        25

Comment 20 Colin Walters 2016-08-29 20:33:44 UTC
So anaconda supports both models of:

 - Kickstart explicitly specifying NTP servers
 - Propagating DHCP-specified servers

The former makes sense, but I don't think Anaconda should be in the business of the latter.  It is actively a bad idea when doing server-side image generation (e.g. Fedora cloud images, consumed downstream) - we don't want every user of those images to try to reach the (possibly/likely) internal servers, and also doesn't work for mobile clients.

Oh, actually it looks like what's breaking here is the Anaconda code explicitly parses the chrony defaults that came in the installer, then ends up trying to write them back, which seems unnecessary at best.

Basically, I think there are two paths:

 - Admin explicitly specified servers in kickstart or UI; we should suppor this probably, though we'd have to grow some abstraction over timesyncd/chrony/ntpd
 - For everything else, once NM grows support for propagating DHCP ( https://bugzilla.gnome.org/show_bug.cgi?id=746911 ), we don't need to do this in Anaconda, and it automatically works for mobile clients.


In the short term...if we patched Anaconda to keep track internally of when it used the defaults, then we wouldn't try to write the config file or start chrony, which I think is simplest.

Comment 21 Colin Walters 2016-08-29 22:10:18 UTC
I spent a while reading the code, convinced that it was datetime.py configuring ksdata.ntpservers, but what's actually going wrong is a lot simpler: ntp.py just assumes that unless `--nontp` is passed, we should install and enable chrony.

So...given Server uses ntpd, Workstation already has chrony installed an enabled, and Atomic Host uses timesyncd, it seems we could just remove the "install and enable" logic and have it be a per-product decision.

Comment 22 Colin Walters 2016-08-30 15:02:40 UTC
https://github.com/rhinstaller/anaconda/pull/761

Comment 23 Adam Williamson 2016-09-07 22:26:39 UTC
for some reason install has worked on 25 since Fedora-25-20160902.n.0...not sure why, no obviously related package changed that day. Did someone work around it in a kickstart? But this bug still occurs on Rawhide.

Comment 24 Colin Walters 2016-09-08 02:29:17 UTC
The above PR links to https://pagure.io/fedora-atomic/pull-request/11

Comment 25 Adam Williamson 2016-09-08 02:31:37 UTC
why's rawhide still hitting this, then?

Comment 26 Chris Murphy 2016-09-25 18:43:22 UTC
*** Bug 1379173 has been marked as a duplicate of this bug. ***

Comment 27 Colin Walters 2016-10-12 17:39:22 UTC
This seems to be fixed.

Comment 28 Gabriel Somlo 2017-03-09 15:30:56 UTC
Similar problem has been detected:

This crash happened during the final stage of an F25 kickstart install

addons:         com_redhat_kdump, com_redhat_docker
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img ks=http://mirror.ini.cmu.edu/ks/F25/kvmsrv25.ks nomodeset ip=eno1:dhcp
hashmarkername: anaconda
kernel:         4.8.6-300.fc25.x86_64
package:        anaconda-25.20.8-1
product:        Fedora
reason:         ValueError: Error enabling service libvirt-guests: 1
release:        Cannot get release name.
version:        25

Comment 29 Gabriel Somlo 2017-03-09 18:42:58 UTC
Similar problem has been detected:

This happens at the very end of an F25 kickstart install. Apologies if this is a dupe!

addons:         com_redhat_kdump, com_redhat_docker
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img ks=http://mirror.ini.cmu.edu/ks/F25/kvmsrv25.ks nomodeset ip=eno1:dhcp
hashmarkername: anaconda
kernel:         4.8.6-300.fc25.x86_64
package:        anaconda-25.20.8-1
product:        Fedora
reason:         ValueError: Error enabling service libvirt-guests: 1
release:        Cannot get release name.
version:        25

Comment 30 Joe Wright 2017-04-17 19:06:20 UTC
*** Bug 1442856 has been marked as a duplicate of this bug. ***


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