Bug 1739150

Summary: Leapp fails on ntpd to chrony migration
Product: Red Hat Enterprise Linux 7 Reporter: Jiri Stransky <jstransk>
Component: leapp-repositoryAssignee: Leapp team <leapp-notifications>
Status: CLOSED UPSTREAM QA Contact: Alois Mahdal <amahdal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: ivasilev, mbocek, michele, mlichvar
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-16 16:36:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1708241, 1727807    
Attachments:
Description Flags
ntp.conf none

Description Jiri Stransky 2019-08-08 15:49:29 UTC
Description of problem:

[  229.616440] upgrade[329]: ============================================================
[  229.617634] upgrade[329]:                            ERRORS
[  229.618399] upgrade[329]: ============================================================
[  229.619419] upgrade[329]: 2019-08-08 11:34:55.039915 [ERROR] Actor: migrate_ntp Message: ntp2chrony failed: [Errno 2] No such file or directory: '/etc/ntp.conf'
[  229.621201] upgrade[329]: ============================================================
[  229.622222] upgrade[329]:                        END OF ERRORS
[  229.623014] upgrade[329]: ============================================================


Version-Release number of selected component (if applicable):

Leapp 0.8.1


Sorry for not providing more info but i'm unable to connect / log in after the upgrade fails this way. In case the issue is not straightforward to solve, please request a reproducer from us.

Comment 2 Jiri Stransky 2019-08-08 15:55:33 UTC
Here is some debugging info from Michele, the ntp.conf is not present, only ntp.conf.rpmsave:

    :/# mount /dev/vda1 /mnt                                        
    [  760.579066] XFS (vda1): Mounting V5 Filesystem              
    [  760.590012] XFS (vda1): Ending clean mount                  
    :/# cd /mnt                                                    
    :/mnt# ls -l                                                    
    total 24                                                        
    drwxr-xr-x   2 root root   25 Aug  8 13:38 backports            
    lrwxrwxrwx   1 root root    7 Aug 12  2018 bin -> usr/bin      
    dr-xr-xr-x   7 root root 4096 Aug  8 13:41 boot                
    drwxr-xr-x   2 root root    6 Oct 10  2018 dev                  
    drwxr-xr-x 106 root root 8192 Aug  8 13:41 etc                  
    drwxr-xr-x   5 root root   56 Aug 12  2018 home                
    lrwxrwxrwx   1 root root    7 Aug 12  2018 lib -> usr/lib      
    lrwxrwxrwx   1 root root    9 Aug 12  2018 lib64 -> usr/lib64  
    drwxr-xr-x   2 root root    6 Aug 12  2018 media                
    drwxr-xr-x   2 root root    6 Aug 12  2018 mnt                  
    drwxr-xr-x   2 root root    6 Aug 12  2018 opt                  
    drwxr-xr-x   2 root root    6 Oct 10  2018 proc                
    dr-xr-x---   8 root root 4096 Aug  8 13:41 root                
    drwxr-xr-x  23 root root 4096 Aug  8 13:40 run                  
    lrwxrwxrwx   1 root root    8 Aug 12  2018 sbin -> usr/sbin    
    drwxr-xr-x   3 root root   18 Aug 12  2018 srv                  
    drwxr-xr-x   2 root root    6 Oct 10  2018 sys                  
    drwxrwxrwt  10 root root  159 Aug  8 13:40 tmp                  
    drwxr-xr-x  12 root root  144 Aug  8 13:40 usr                  
    drwxr-xr-x  20 root root  278 Aug  8 13:37 var                  
     
    :/mnt# ls -l etc/ntp.conf*                                  
    -rw-r--r-- 1 root root 906 Jul 22 08:42 etc/ntp.conf.rpmsave

Comment 3 Jiri Stransky 2019-08-08 15:56:17 UTC
And from IRC:

https://github.com/oamg/leapp-repository/blob/5183755e3903a039136937524b06a3c26b2b89b5/repos/system_upgrade/el7toel8/actors/migratentp/libraries/library.py#L70

17:17 <podvody> i.e. at #70 we extract the configs relative to PWD
17:17 <podvody> however at #73 we reference absolute /etc/ntp.conf

Comment 4 Ina 2019-08-09 13:42:12 UTC
Could you please provide original ntp.conf that was present on the vm being upgraded? I can't easily reproduce your failure with a random non-standard configuration.

Comment 5 Ina 2019-08-09 15:01:00 UTC
Tried upgrading with ntp.conf provided by podvody (http://pastebin.test.redhat.com/787640) and the upgrade has passed flawlessly. 

I'd say we need more information about the system or vm with a repro in ideal scenario.

I was using leapp version 0.8.1 and rhel-7.6-server-x86_64-released. There should be some more factors apart from ntp package with specific config.

Comment 6 Jiri Stransky 2019-08-09 16:38:31 UTC
Created attachment 1602248 [details]
ntp.conf

Comment 7 Jiri Stransky 2019-08-09 16:42:16 UTC
Added ntp.conf, it's pretty much what you have in the pastebin with some blank lines at the end.

Let's discuss on IRC next week, i can set up a reproducer and we can look at the pre-upgrade state and the failed state.

Comment 8 Ina 2019-08-12 17:07:48 UTC
Turns out the scenario I used for reproduction had a flaw, by fixing which I was able to get a clean repro.
This PR should fix the failure you expect https://github.com/oamg/leapp-repository/pull/302 (merged in master already)

Comment 9 Jiri Stransky 2019-08-16 16:08:30 UTC
I wrote it earlier in e-mail but forgot to update the BZ: applying the patch indeed fixes the problem we had. Thanks!

Comment 10 Ina 2019-08-16 16:36:39 UTC
Glad to hear it worked for you as well! Not sure which state is appropriate for the workflow, temporarily moving to Closed/Current release