[SOLVED] DAB latest on PVE 8.2 fails LXC creation - workaround

apmuthu

Renowned Member
Feb 26, 2009
868
11
83
Chennai - India & Singapore
github.com
Code:
install: libmpfr6
install: gawk
install: galera-4
install: mysql-common
install: mariadb-common
install: mariadb-server-10.5
install: mariadb-server
command 'lxc-attach -n 13ca25b2-6c55-44ad-be28-dc0b235a5267 --rcfile /var/lib/vz/template/builds/debian-11-bullseye-lamp-64/config --clear-env -- defenv /usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --skip-bdb  --skip-innodb --skip-ndbcluster' failed with exit code 2
command 'lxc-attach -n 13ca25b2-6c55-44ad-be28-dc0b235a5267 --rcfile /var/lib/vz/template/builds/debian-11-bullseye-lamp-64/config --clear-env -- defenv /usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --skip-bdb  --skip-innodb --skip-ndbcluster' failed with exit code 2
make: *** [Makefile:8: all] Error 2

The test Makefile is:
Code:
BASEDIR:=$(shell dab basedir)

all: info/init_ok
    dab bootstrap
#    # Bullseye now defaults to without-password - set to need password
    sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' ${BASEDIR}/etc/ssh/sshd_config
    dab task mysql --password random
    sed -e 's/\[mysqld\]/[mysqld]\ncharacter-set-server=utf8/' -i ${BASEDIR}/etc/mysql/my.cnf
    dab install apache2-mpm-prefork apache2
    dab install zip unzip bzip2 screen rsync curl mlocate
    dab task php --memlimit 128
    sed -e 's/^\s*display_errors\s*=\s*On/display_errors = Off/' -i ${BASEDIR}/etc/php5/apache2/php.ini
    dab install php5-mysql php5-curl php5-xsl php5-imap php5-xmlrpc
    sed -e 's/^\s*display_errors\s*=.*/display_errors = Off/' -i ${BASEDIR}/etc/php5/apache2/php.ini
    sed -e 's/^\s*max_execution_time\s*=.*/max_execution_time = 120/' -i ${BASEDIR}/etc/php5/apache2/php.ini
    sed -e 's/^\s*upload_max_filesize\s*=.*/upload_max_filesize = 16M/' -i ${BASEDIR}/etc/php5/apache2/php.ini
    sed -e 's/^\s*post_max_size\s*=.*/post_max_size = 16M/' -i ${BASEDIR}/etc/php5/apache2/php.ini
    sed -e 's/^\s*error_reporting\s*=.*/error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_NOTICE/' -i ${BASEDIR}/etc/php5/apache2/php.ini
    mkdir ${BASEDIR}/var/www/webroot
    install -m 0644 index.html ${BASEDIR}/var/www/webroot/index.html
    dab exec chown -R www-data:www-data /var/www/webroot
    find ${BASEDIR}/var/www/webroot -type f -exec chmod 644 \{\} \;
    find ${BASEDIR}/var/www/webroot -type d -exec chmod 755 \{\} \;
    install -m 0644 webroot.conf ${BASEDIR}/etc/apache2/sites-available/webroot.conf
#    install -m 0755 webroot.mysql ${BASEDIR}/etc/webroot.mysql
    install -m 0755 webroot_setup ${BASEDIR}/etc/init.d/
    dab exec insserv webroot_setup
    export LC_ALL=C
    dab exec a2enmod rewrite
    dab exec a2dissite 000-default
    dab exec a2ensite webroot
    dab finalize

info/init_ok: dab.conf
    dab init
    touch $@

.PHONY: clean
clean:
    dab clean
    rm -f *~

.PHONY: dist-clean
dist-clean:
    dab dist-clean
    rm -f *~

Even if dab task mysql --password random is replaced by dab task mysql the issue still remains.
 
Last edited:
Commenting out the initial lines for mysql/mariadb and the webroot_setup lines we now get the following erros:
Code:
unpack: python3-minimal
unpack: python3
unpack: python3-apt
unpack: apt-listchanges
configure standard packages
Masking problematic systemd unit 'sys-kernel-config.mount'
Masking problematic systemd unit 'sys-kernel-debug.mount'
Masking problematic systemd unit 'systemd-journald-audit.socket'
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' /var/lib/vz/template/builds/debian-11-bullseye-lamp-64/rootfs/etc/ssh/sshd_config
dab install apache2-mpm-prefork apache2
hint: ignoring provides for 'apache2-mpm-prefork' - package not in 'available' list.
no such package 'apache2-mpm-prefork' at /usr/share/perl5/PVE/DAB.pm line 1158.
no such package 'apache2-mpm-prefork' at /usr/share/perl5/PVE/DAB.pm line 1158.
make: *** [Makefile:8: all] Error 255

Latest DAB
Latest updates for PVE 8.2
 
Kindly correct DAB.pm and related scripts to allow installation of MySQL through it.

In debian bullseye the location of cnf is at /etc/mysql/mariadb.conf.d/50-server.cnf

In old versions of MySQL, the location of cnf file was at /etc/mysql/my.cnf

Also the location php.ini that was at /etc/php5/apache2/php.ini is now at /etc/php/7.4/apache2/php.ini

These paths and file names should be appropriately coded to be transparent to the user in the DAB.pm and other scripts
 
The first boot script fails to get implemented in dab in debian bullseye using the standard
Code:
    install -m 0755 webroot_setup ${BASEDIR}/etc/init.d/
    dab exec insserv webroot_setup
in the Makefile with the error:
Code:
dab exec insserv webroot_setup
/usr/sbin/defenv: 10: exec: insserv: not found
ve_exec failed - status 127
ve_exec failed - status 127
make: *** [Makefile:25: all] Error 127
 
The package insserv does not not exist in Proxmox VE 8.2. The error is insserv: FATAL: service mountkernfs has to exist for service udev
Code:
# apt install insserv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  bootchart2
The following NEW packages will be installed:
  insserv
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 70.1 kB of archives.
After this operation, 157 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 insserv amd64 1.24.0-1 [70.1 kB]
Fetched 70.1 kB in 0s (330 kB/s)
Selecting previously unselected package insserv.
(Reading database ... 45997 files and directories currently installed.)
Preparing to unpack .../insserv_1.24.0-1_amd64.deb ...
Unpacking insserv (1.24.0-1) ...
Setting up insserv (1.24.0-1) ...
insserv: FATAL: service mountkernfs has to exist for service udev
insserv: exiting now!
Processing triggers for man-db (2.11.2-2) ...

# apt remove insserv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  insserv
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 157 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 46012 files and directories currently installed.)
Removing insserv (1.24.0-1) ...
Processing triggers for man-db (2.11.2-2) ...

The insserv program is used by the standard SysV-based init system. PVE uses it if it exists.
 
Last edited:
Further checks show they are the same links pointing to the binary dash:
Code:
# cp /usr/bin/sh /bin/sh
cp: '/usr/bin/sh' and '/bin/sh' are the same file

# ls /usr/bin/sh -al
lrwxrwxrwx 1 root root 4 Jul  6 19:17 /usr/bin/sh -> dash

# ls /bin/sh -al
lrwxrwxrwx 1 root root 4 Jul  6 19:17 /bin/sh -> dash

# locate /bin/sh
/usr/bin/sh
/usr/bin/sha1sum
/usr/bin/sha224sum
/usr/bin/sha256sum
/usr/bin/sha384sum
/usr/bin/sha512sum
/usr/bin/shasum
/usr/bin/shred
/usr/bin/shuf

# which dash
/usr/bin/dash

# ls -al /usr/bin/dash
-rwxr-xr-x 1 root root 125560 Dec 10  2020 /usr/bin/dash
 
Finally solved it.
See attachment.

This accommodates version of PHP and and insserv / update-rc.d service for first boot and moves the random password of mysql (mariadb) to the first boot script. Used latest DAB on PVE 8.2.4.

Hope this script makes it to the Proxmox Wiki as my access there has been blocked.
 

Attachments

  • debian-11-bullseye-lamp-64.zip
    4.7 KB · Views: 0
  • Like
Reactions: leesteken
Please fix the lxc-attach lines and fix in line 1645 in DAB.pm as the old mysql options are no longer compatible with mariadb:
Code:
# lxc-attach -n 922a33e8-c3bf-41b6-aa1c-430ab930be96 --rcfile /var/lib/vz/template/builds/debian-11-bullseye-lamp-64/config --clear-env -- defenv /usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --skip-bdb  --skip-innodb --skip-ndbcluster
2024-07-07 12:04:00 0 [Note] Starting MariaDB 10.5.23-MariaDB-0+deb11u1 source revision 6cfd2ba397b0ca689d8ff1bdb9fc4a4dc516a5eb as process 18652
2024-07-07 12:04:00 0 [Note] Plugin 'InnoDB' is disabled.
2024-07-07 12:04:00 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-07-07 12:04:00 0 [Warning] 'skip-bdb' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-07-07 12:04:00 0 [ERROR] /usr/sbin/mysqld: unknown option '--skip-ndbcluster'
2024-07-07 12:04:00 0 [ERROR] Aborting

Without the offending arguments it works fine:
Code:
# lxc-attach -n 922a33e8-c3bf-41b6-aa1c-430ab930be96 --rcfile /var/lib/vz/template/builds/debian-11-bullseye-lamp-64/config --clear-env -- defenv /usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables
2024-07-07 12:08:29 0 [Note] Starting MariaDB 10.5.23-MariaDB-0+deb11u1 source revision 6cfd2ba397b0ca689d8ff1bdb9fc4a4dc516a5eb as process 18655
2024-07-07 12:08:29 0 [Note] InnoDB: Uses event mutexes
2024-07-07 12:08:29 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-07-07 12:08:29 0 [Note] InnoDB: Number of pools: 1
2024-07-07 12:08:29 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-07-07 12:08:29 0 [Note] InnoDB: Using Linux native AIO
2024-07-07 12:08:29 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2024-07-07 12:08:29 0 [Note] InnoDB: Completed initialization of buffer pool
2024-07-07 12:08:29 0 [Note] InnoDB: 128 rollback segments are active.
2024-07-07 12:08:29 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-07-07 12:08:29 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-07-07 12:08:29 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-07-07 12:08:29 0 [Note] InnoDB: 10.5.23 started; log sequence number 45079; transaction id 20
2024-07-07 12:08:29 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-07-07 12:08:29 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-07-07 12:08:29 0 [Note] InnoDB: Buffer pool(s) load completed at 240707 12:08:29

The issue remains even if line 1645 is edited to remove the error options but error is now exit code 1.
 
Last edited:
The situation for Debian 12 Bookworm is even worse,
Code:
dab install mysql --password random
hint: ignoring provides for 'mysql' - package not in 'available' list.
hint: ignoring provides for '--password' - package not in 'available' list.
hint: ignoring provides for 'random' - package not in 'available' list.
no such package 'mysql' at /usr/share/perl5/PVE/DAB.pm line 1158.
no such package 'mysql' at /usr/share/perl5/PVE/DAB.pm line 1158.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!