M0ses / kanku

Kanku - Bridging the gap between Open-Build-Service and DevOPS
http://m0ses.github.io/kanku/
GNU General Public License v3.0
10 stars 6 forks source link

kanku up breaks #55

Closed denknorr closed 5 months ago

denknorr commented 5 months ago

Hi, as discussed, if i want to set up kanku in developer mode, things do not work for me on current tumbleweed:

benutzer01@linux:~> mkdir -p kankutest
benutzer01@linux:~> cd kankutest
benutzer01@linux:~/kankutest> rm -rf ~/.kanku ~/.cache/kanku
benutzer01@linux:~/kankutest> sudo kanku setup --devel
[sudo] Passwort für root: 
[2024/04/29 17:11:17][DEBUG](1742) Running developer setup
Please enter the username of the user who will run kanku [benutzer01]

[2024/04/29 17:11:19][DEBUG](1742) _chown '/home/benutzer01/.kanku' (1000/1000)
[2024/04/29 17:11:19][ INFO](1742) Adding commands for user benutzer01 in /etc/sudoers.d/kanku
[2024/04/29 17:11:19][DEBUG](1742) Setting user benutzer01 in /etc/libvirt/qemu.conf
[2024/04/29 17:11:19][DEBUG](1742) Create backup of config /etc/libvirt/qemu.conf -> /etc/libvirt/qemu.conf.kanku-bak1714403479.1742
[2024/04/29 17:11:19][DEBUG](1742) Create backup of config /etc/libvirt/libvirtd.conf -> /etc/libvirt/libvirtd.conf.kanku-bak1714403479.1742
[2024/04/29 17:11:19][DEBUG](1742) Running command 'usermod -aG libvirt benutzer01'
[2024/04/29 17:11:19][DEBUG](1742) Running command 'systemctl enable libvirtd'
[2024/04/29 17:11:19][DEBUG](1742) Running command 'systemctl restart libvirtd'
[2024/04/29 17:11:20][ INFO](1742) Created config file /etc/kanku/dancer/config.yml
[2024/04/29 17:11:20][DEBUG](1742) Using dsn: dbi:SQLite:dbname=/home/benutzer01/.kanku/kanku-schema.db
Since this database is not versioned, we will assume version 18
Reading configurations from /usr/share/kanku/fixtures/18/conf
Reading configurations from /usr/share/kanku/fixtures/18/conf
Restored set /usr/share/kanku/fixtures/18/install to database
[2024/04/29 17:11:20][DEBUG](1742) _chown '/home/benutzer01/.kanku/kanku-schema.db' (1000/1000)
[2024/04/29 17:11:21][ INFO](1742) Found pool default - enabling autostart
[2024/04/29 17:11:21][ INFO](1742) Found network 'kanku-devel' - enabling autostart
[2024/04/29 17:11:21][DEBUG](1742) No backup of config /home/benutzer01/.kanku/kanku-config.yml - File does not exist
[2024/04/29 17:11:21][ INFO](1742) Created config file /home/benutzer01/.kanku/kanku-config.yml
[2024/04/29 17:11:21][ INFO](1742) Developer mode setup successfully finished!
[2024/04/29 17:11:21][ INFO](1742) Please reboot to make sure, libvirtd is coming up properly
benutzer01@linux:~/kankutest> kanku init
[2024/04/29 17:11:25][DEBUG](1974) Found Config file '/home/benutzer01/.kanku/kanku-config.yml'!
[2024/04/29 17:11:25][ INFO](1974) KankuFile written
[2024/04/29 17:11:25][DEBUG](1974) domain_name: kanku-vm
[2024/04/29 17:11:25][DEBUG](1974) domain_memory: 2G
[2024/04/29 17:11:25][DEBUG](1974) domain_cpus: 2
[2024/04/29 17:11:25][DEBUG](1974) default_job: kanku-job
[2024/04/29 17:11:25][DEBUG](1974) project: devel:kanku:images
[2024/04/29 17:11:25][DEBUG](1974) package: openSUSE-Leap-15.6-JeOS
[2024/04/29 17:11:25][DEBUG](1974) repository: images_leap_15_6
[2024/04/29 17:11:25][DEBUG](1974) pool: default
[2024/04/29 17:11:25][ INFO](1974) Now you can make your modifications
[2024/04/29 17:11:25][ INFO](1974) Or start you new VM:
[2024/04/29 17:11:25][ INFO](1974) 
[2024/04/29 17:11:25][ INFO](1974) kanku up
benutzer01@linux:~/kankutest> kanku up
[2024/04/29 17:11:28][DEBUG](1977) Kanku::Cli::up->execute()
[2024/04/29 17:11:28][DEBUG](1977) Initial read of config file '/home/benutzer01/kankutest/KankuFile'
[2024/04/29 17:11:28][DEBUG](1977) Searching for domain: kanku-vm
[2024/04/29 17:11:28][DEBUG](1977) offline mode: 0
[2024/04/29 17:11:28][DEBUG](1977) Loading definition for job: kanku-job
[2024/04/29 17:11:28][DEBUG](1977) Starting job: kanku-job (1)
[2024/04/29 17:11:28][DEBUG](1977) --- trigger_user 
[2024/04/29 17:11:28][DEBUG](1977) --- final_args{host_interface => 'eth0'}
[2024/04/29 17:11:28][DEBUG](1977) Starting task with handler: Kanku::Handler::SetJobContext
[2024/04/29 17:11:28][DEBUG](1977) Trying to load module Kanku::Handler::SetJobContext
[2024/04/29 17:11:28][DEBUG](1977) Trying to load module Kanku::Handler::SetJobContext
[2024/04/29 17:11:28][DEBUG](1977) Setting variable host_interface in context to eth0
[2024/04/29 17:11:28][DEBUG](1977) -- Kanku::Handler::SetJobContext->prepare: Nothing to do!
[2024/04/29 17:11:28][DEBUG](1977) -- Kanku::Handler::SetJobContext->execute: Sucessfully prepared job context
[2024/04/29 17:11:28][DEBUG](1977) -- Kanku::Handler::SetJobContext->finalize: Nothing to do!
[2024/04/29 17:11:28][DEBUG](1977) --- trigger_user 
[2024/04/29 17:11:28][DEBUG](1977) --- final_args{api_url => 'https://api.opensuse.org/public',arch => 'x86_64',package => 'openSUSE-Leap-15.6-JeOS',project => 'devel:kanku:images',repository => 'images_leap_15_6',use_oscrc => '0'}
[2024/04/29 17:11:28][DEBUG](1977) Starting task with handler: Kanku::Handler::OBSCheck
[2024/04/29 17:11:28][DEBUG](1977) Trying to load module Kanku::Handler::OBSCheck
[2024/04/29 17:11:29][DEBUG](1977) Trying to load module Kanku::Handler::OBSCheck
[2024/04/29 17:11:29][DEBUG](1977) Checking project: devel:kanku:images
[2024/04/29 17:11:29][DEBUG](1977) Found Config file '/home/benutzer01/.kanku/kanku-config.yml'!
[2024/04/29 17:11:29][DEBUG](1977) use_oscrc: 0
[2024/04/29 17:11:29][DEBUG](1977) Using Net::OBS::Client config
[2024/04/29 17:11:29][DEBUG](1977) auth_config: {use_oscrc => '0'}
[2024/04/29 17:11:29][DEBUG](1977) all_images = $VAR1 = {
          'qcow2' => {
                       'filename' => 'Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2',
                       'prefix' => '',
                       'mtime' => '1714267050',
                       'size' => '347013120'
                     }
        };

[2024/04/29 17:11:29][DEBUG](1977) Change detected
[2024/04/29 17:11:29][DEBUG](1977) Change detected
[2024/04/29 17:11:29][DEBUG](1977) Change detected
[2024/04/29 17:11:29][DEBUG](1977) -- Kanku::Handler::OBSCheck->prepare: Preparation finished successfully
[2024/04/29 17:11:29][DEBUG](1977) -- Kanku::Handler::OBSCheck->execute: Sucessfully checked project devel:kanku:images under url https://api.opensuse.org/public
 (vm_image_url: http://download.opensuse.org/repositories/devel:/kanku:/images/images_leap_15_6/Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2, obs_direct_url: https://api.opensuse.org/public/build/devel:kanku:images/images_leap_15_6/x86_64/openSUSE-Leap-15.6-JeOS?view=cpio)
[2024/04/29 17:11:29][DEBUG](1977) -- Kanku::Handler::OBSCheck->finalize: Nothing to do!
[2024/04/29 17:11:29][DEBUG](1977) --- trigger_user 
[2024/04/29 17:11:29][DEBUG](1977) --- final_args{}
[2024/04/29 17:11:29][DEBUG](1977) Starting task with handler: Kanku::Handler::ImageDownload
[2024/04/29 17:11:29][DEBUG](1977) Trying to load module Kanku::Handler::ImageDownload
[2024/04/29 17:11:29][DEBUG](1977) Trying to load module Kanku::Handler::ImageDownload
[2024/04/29 17:11:29][DEBUG](1977) Using output file: Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2
[2024/04/29 17:11:29][ INFO](1977) Downloading http://download.opensuse.org/repositories/devel:/kanku:/images/images_leap_15_6/Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2
[2024/04/29 17:11:29][DEBUG](1977)   to file /home/benutzer01/.cache/kanku/Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2
[2024/04/29 17:11:29][DEBUG](1977) url: http://download.opensuse.org/repositories/devel:/kanku:/images/images_leap_15_6/Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2
[2024/04/29 17:11:30][ERROR](1977) Can't write to '/home/benutzer01/.cache/kanku/Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2-1977': No such file or directory at /usr/lib/perl5/vendor_perl/5.38.2/LWP/Protocol.pm line 122. at /usr/lib/kanku/lib/Kanku/Util/CurlHttpDownload.pm line 105.

[2024/04/29 17:11:30][DEBUG](1977) setting job state to failed: '{"error_message":"Can't write to '/home/benutzer01/.cache/kanku/Kanku_Leap_15.6_JeOS.x86_64-0.15.6-Build12.15.qcow2-1977': No such file or directory at /usr/lib/perl5/vendor_perl/5.38.2/LWP/Protocol.pm line 122. at /usr/lib/kanku/lib/Kanku/Util/CurlHttpDownload.pm line 105.\n"} at /usr/lib/kanku/lib/Kanku/Dispatch/Local.pm line 86.
'
[2024/04/29 17:11:30][DEBUG](1977) Finished job: kanku-job (1) with state 'failed'
[2024/04/29 17:11:30][DEBUG](1977) No Job Group ID found
[2024/04/29 17:11:30][ERROR](1977) Failed to create domain: kanku-vm
benutzer01@linux:~/kankutest> cat /etc/os-release 
NAME="openSUSE Tumbleweed"
# VERSION="20240427"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20240427"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
# CPE 2.3 format, boo#1217921
CPE_NAME="cpe:2.3:o:opensuse:tumbleweed:20240427:*:*:*:*:*:*:*"
#CPE 2.2 format
#CPE_NAME="cpe:/o:opensuse:tumbleweed:20240427"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"
benutzer01@linux:~/kankutest> 

I am not sure what i can do to make this work :)

M0ses commented 5 months ago

short term mkdir -p /home/benutzer01/.cache/kanku/

But also fixed with https://github.com/M0ses/kanku/commit/1846d20b3b87342dd6cddf5d548ad71566d4d2db

I see a 0.17.1 "come soon" ;-)