Carlos Vercelino's picture

I am moving the discution regarding the Odoo App (v16.0) form the post "v16.0 Stable Release #2 - 10 more ISOs, Hub & Proxmox/LXC builds" to this topic.

Please, refer to the posts , , , and to know what has been discussed up to now.

 

Forum: 
Carlos Vercelino's picture

Hi Jeremy,

I have tried to build an ISO for the Odoo appliance using TKLdev v 16.0 but I have not succeed. For sure I will try to do the same using TKLdev v15.0 just to confirm that the build will succeed as expected.

Until then, please, can you or someone else give me an idea of whats is going on?

See below the console output showing the error:

root@tkl-tkldev16-vm ~# cd products
/turnkey/fab/products
root@tkl-tkldev16-vm .../fab/products# git-clone https://github.com/turnkeylinux-apps/odoo.git
Cloning into 'odoo'...
remote: Enumerating objects: 3189, done.
remote: Total 3189 (delta 0), reused 0 (delta 0), pack-reused 3189
Receiving objects: 100% (3189/3189), 1.76 MiB | 2.38 MiB/s, done.
Resolving deltas: 100% (1243/1243), done.
root@tkl-tkldev16-vm .../fab/products# cd odoo
/turnkey/fab/products/odoo
root@tkl-tkldev16-vm .../products/odoo# make
deck /turnkey/fab/bootstraps/buster build/bootstrap
fab-apply-overlay /turnkey/fab/common/overlays/bootstrap_apt build/bootstrap;
fab-chroot build/bootstrap "echo nameserver 8.8.8.8 > /etc/resolv.conf";
fab-chroot build/bootstrap "echo nameserver 8.8.4.4 >> /etc/resolv.conf";
fab-chroot build/bootstrap --script /turnkey/fab/common/conf/bootstrap_apt;
gpg: keybox '/usr/share/keyrings/tkl-buster-main.gpg' created
gpg: directory '/root/.gnupg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
...
...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-4.19.0-9-amd64 (4.19.118-2) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.19.0-9-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-4.19.0-9-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-4.19.0-9-amd64
I: /initrd.img is now a symlink to boot/initrd.img-4.19.0-9-amd64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-9-amd64
Setting up linux-image-amd64 (4.19+105+deb10u4) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
update-initramfs: Generating /boot/initrd.img-4.19.0-9-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-gdata is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-gdata' has no installation candidate
Traceback (most recent call last):
  File "/usr/lib/fab/wrapper.py", line 34, in <module>
    CliWrapper.main()
  File "/usr/lib/python2.7/dist-packages/pyproject.py", line 388, in main
    commands.run(name, args)
  File "/usr/lib/python2.7/dist-packages/pyproject.py", line 261, in run
    command.module.main()
  File "/usr/lib/fab/pylib/cmd_install.py", line 129, in main
    installer.install(packages, ignore_errors)
  File "/usr/lib/fab/pylib/installer.py", line 279, in install
    self._install(packages, ignore_errors)
  File "/usr/lib/fab/pylib/installer.py", line 137, in _install
    self.chroot.system("apt-get", *(args + packages))
  File "/usr/lib/python2.7/dist-packages/chroot.py", line 80, in system
    executil.system(*self._prepare_command(*command))
  File "/usr/lib/python2.7/dist-packages/executil.py", line 56, in system
    raise ExecError(command, exitcode)
executil.ExecError: non-zero exitcode (100) for command: chroot '/turnkey/fab/products/odoo/build/root.build'  'sh'  '-c'  "env -i  'LC_ALL=C'  'CREDIT_ANCHORTEXT=Turnkey Odoo Appliance'  'AMD64=y'  'DEBIAN_FRONTEND=noninteractive'  'FAB_ARCH=amd64'  'HOME=/root'  'RELEASE=debian/buster'  'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/sbin'  'DEBIAN=y'  'TERM=xterm-256color'  'HOSTNAME=odoo'  'FAB_HTTP_PROXY=http://127.0.0.1:8124'  'DEBIAN_PRIORITY=critical'  'WEBMIN_FW_TCP_INCOMING=22 80 443 12320 12321 12322'  'CODENAME=buster'  'DISTRO=debian' apt-get 'install'  '--assume-yes'  'libgcc1'  'busybox'  'libnet-ssleay-perl'  'less'  'kbd'  'webmin-filemin'  'libreadline7'  'passwd'  'findutils'  'webmin-sshd'  'php-pgsql'  'systemd'  'util-linux'  'libsystemd0'  'libncursesw6'  'whiptail'  'authbind'  'apache2'  'shellinabox'  'gpg-agent'  'iptables'  'libunistring2'  'libpam-modules'  'libcom-err2'  'liblzma5'  'libcap-ng0'  'bash-completion'  'libacl1'  'debian-archive-keyring'  'ssh'  'readline-common'  'grep'  'libgpg-error0'  'webmin-net'  'libpam0g'  'bind9-host'  'webmin-updown'  'stunnel4'  'sysvinit-utils'  'libseccomp2'  'webmin'  'psmisc'  'tklbam'  'net-tools'  'hubdns'  'systemd-sysv'  'udhcpc'  'libfile-mimeinfo-perl'  'debconf'  'webmin-authentic-theme'  'libpam-modules-bin'  'rsyslog'  'liblz4-1'  'syslinux-common'  'webmin-passwd'  'cron'  'firmware-linux-free'  'sed'  'live-tools'  'rsync'  'localepurge'  'nano'  'inithooks'  'python3-bottle'  'libselinux1'  'dehydrated'  'live-boot-initramfs-tools'  'libsqlite3-0'  'jitterentropy-rngd'  'python3-pip'  'libsmartcols1'  'fdisk'  'acpi-support-base'  'postgresql-client'  'libpam-runtime'  'libss2'  'xfonts-75dpi'  'ntp'  'screen'  'libpcre3'  'libdebconfclient0'  'libmount1'  'libattr1'  'webmin-useradmin'  'gzip'  'wget'  'libext2fs2'  'python3-requests'  'gpgconf'  'bash'  'dtach'  'mawk'  'postgresql'  'di-live'  'webmin-software'  'pinentry-curses'  'xfonts-base'  'libp11-kit0'  'libudev1'  'php-cli'  'login'  'python3'  'etckeeper'  'gpg'  'lvm2'  'python3-dialog'  'gpgv'  'apt'  'python-gdata'  'init-system-helpers'  'libc-bin'  'syslinux'  'live-boot'  'webmin-phpini'  'adduser'  'cron-apt'  'tzdata'  'webmin-syslog'  'webmin-apache'  'netbase'  'libaudit-common'  'webmin-raid'  'turnkey-sysinfo'  'webmin-custom'  'libsepol1'  'traceroute'  'libzstd1'  'turnkey-version'  'libsemanage1'  'bsd-mailx'  'libgmp10'  'libgcrypt20'  'hdparm'  'debianutils'  'bsdutils'  'webmin-tklbam'  'git'  'ncurses-base'  'confconsole'  'iputils-ping'  'webmin-fdisk'  'libffi6'  'mount'  'libapache2-mod-php'  'resolvconf'  'libidn2-0'  'libdb5.3'  'gnupg'  'libapt-pkg5.0'  'python3-setuptools'  'procps'  'gcc-8-base'  'libtasn1-6'  'ethtool'  'ifupdown'  'man-db'  'libsemanage-common'  'perl-openssl-defaults'  'dash'  'logrotate'  'unzip'  'fail2ban'  'file'  'base-files'  'curl'  'tar'  'libassuan0'  'dpkg'  'libtinfo6'  'libfdisk1'  'hostname'  'python3-wheel'  'libaudit1'  'libgnutls30'  'coreutils'  'libnpth0'  'lsb-release'  'libstdc++6'  'webmin-postgresql'  'python-gevent'  'webmin-fail2ban'  'webmin-shell'  'libnettle6'  'python-passlib'  'libbz2-1.0'  'ncurses-bin'  'webmin-postfix'  'iproute2'  'adminer'  'zlib1g'  'libc6'  'webmin-firewall'  'libhogweed4'  'eject'  'postfix'  'diffutils'  'ncurses-term'  'isolinux'  'e2fsprogs'  'libuuid1'  'perl-base'  'initramfs-tools'  'vim-tiny'  'webmin-lvm'  'libblkid1'  'base-passwd'"
make: *** [/usr/share/fab/product.mk:540: build/stamps/root.build] Error 1
root@tkl-tkldev16-vm .../products/odoo#

Any help will be very welcome!

Carlos Vercelino's picture

Hi Jeremy,

Just to be sure that my set up for TKLdev (v16.0) enviroment was done properly, I executed the same procedure for the Core App. Everything has worket fine!

 

Jeremy Davis's picture

[update] I just realised that it's probably worth explicitly noting that the reason why you are hitting errors is because v16.0 TKLDev is trying to build a v16.x based Odoo appliance. But the Odoo buildcode hasn't yet been updated to build on/for v16.0! So hitting errors is somewhat expected.

Ultimately, that's what a major version transition requires; working through each appliance updating the code so that it works as required. It's what we're doing at the moment behind the scenes, then rebuilding the updated appliances... :)

If you make a start on the v16.0 Odoo appliance, that'd be awesome! The rest of this post covers a few bits that might help you get a bit further.


Backing up a bit, the plan (i.e. the plan/main file in the case of individual appliances) contains the names of the packages that will be installed when building the appliance.

In this case, it's failing on python-gdata. It existed in Debian Stretch but isn't in Buster.

It's also worth noting that in Debian, the package names denote the python version that they are for, and as per the executable, "python" denotes Python2 and "python3" denotes Python3. E.g. python-NAME is the Python2 package for NAME & python3-NAME is the Python3 package for NAME. So for v16.0 Odoo (using Python3) we'll instead want to install the Python3 dependencies.

Looking at the current Odoo plan, we seem to installing a mix of python 2 & 3 packages?! IIRC the most recent TurnKey Odoo appliance was hosting Odoo via Python3. I suspect that most of the python-... packages still in the plan are an oversight. So I'll cover those Python2 packages first.

In the case of python-gdata, there doesn't appear to ever have been a python3 package, plus it's not in Buster. Assuming I'm correct about Odoo running on Python3, it probably wasn't even being used in the previous Odoo appliance anyway. As such I imagine just removing that one altogether would be the best plan.

Again, I don't think python-gevent was being used by Odoo, although if it needs it, we could install it by updating the package name (to 'python3-gevent'). For now probably best just to remove it though.

It looks like python-passlib was being used by the Odoo inithook (provided by us). As we've updated the v16.0 inithooks package to use Python3 in v16.0, that will (most likely) need to be updated to the python3 version. And the inithook itself will need to be updated to python3 too. We can discuss that further, but I won't touch that for now.

So to summarise the Python2 packges, python-gdata & python-gevent could just be removed completely for now and python-passlib can be updated to python3-passlib.

Re the Python3 packages, 'python3' itself can be removed as it's installed by default in v16.0/Buster anyway. I'm not sure if the python3 pip, setuptools & wheel packages are still required or not?! I guess it depends on whether we need to manually install psycogreen via pip or not? TBH, I suspect not if we're installing via apt. I suspect that if Odoo needs them, it would either provide them, or install them from Debian (where available) but I'm not 100% sure... You could always remove them (and the line that uses them from the conf script) and see how you go?!

We might wish to tweak and/or add back in some python3 dependencies later, but as we're installing Odoo via apt, it should hopefully install any Debian dependencies itself. FWIW it's not a huge deal to allow Odoo to install it's own Debian dependencies at install time, but I do prefer to install them via the plan where possible. And there is a possiblity that there are some dependencies not provided by Debian or Odoo (in which case, we'd need to install them manually via some other method). We can always circle back on that later though.

I hope that makes sense and helps...

Carlos Vercelino's picture

Hi Jeremy,

Following your suggestions, I have been able to create an ISO for the Odoo appliance using TKLdev v16.0 following the procedure depicted here.

I have just edited the file "/turnkey/fab/products/odoo/plan/main" as shown below:

#include <turnkey/base>
#include <turnkey/lapp>

adduser             
postgresql-client   
python3

/*python-gdata        /* Google Data Python client library */

python3-pip         /* Needed to install psycogreen */
python3-setuptools  /* Needed to install psycogreen */
python3-wheel       /* Needed to install psycogreen */

/*python-gevent       /* gevent is a coroutine-based Python networking library */

/*python-passlib      /* Needed to set admin password */
python3-passlib      /* Needed to set admin password */

xfonts-base         /* Needed for upstream wkhtmltox package */
xfonts-75dpi        /* Needed for upstream wkhtmltox package */

Fom the ISO file I have implemented a VM using this procedure.

I have just found a minor problem regarding the inihook execution at the first boot. I was not asked to set the "Odoo Master Account" password. This has not prevent me from using de VM. The user "Administrator" password for the defatult database was set to "admin" and the "Master Password" was set to an unknown value.

To recover the Master Password I used the procedure below:

  1. Edit the file "/etc/odoo/odoo.conf" (as odoo):

    admin_passwd = $pbkdf2-sha512$25000$...
    
    ;admin_passwd = admin
    
  2. Stop and start the Odoo server, using the following commands (as root):

    ssh tkl-odoo-160-buster-vm -l root
    
    /etc/init.d/odoo stop
    
    /etc/init.d/odoo start
    
  3. Please set a master password to secure it:

Despite this minor problem, it seems to me that I have got an working Odoo Appliance.

At first ,the Odoo v11.0 installed.

I have replaced it to Odoo v12.0 and then have installed all the modules I use currently for my projects. After that I have created an instance of my main project. Up to now everything going Ok.

I am quite sure that we already have a working embryo of the Odoo (v16.0). For sure there is some (or a lot of) work to be done in order to make this a viable Odoo (v16.0) appliance, and  if I could be of any help, please, tell me.

Jeremy Davis's picture

Great thanks for checking that out Carlos. I've added some notes re Odoo and we'll try to prioritise it.

Regarding the inithook, I'm not at all surprised it doesn't run/work. We've updated inithooks to be Python3 for v16.0, so the old Python2 inithooks (such as the Odoo one that sets the Admin password) will need to be updated before they'll work.

Carlos Vercelino's picture

I have replaced Odoo v12.0 to Odoo v13.0 and apparently, everything is doing ok.

I wasn't able to test any of my modules since any piece of my code will work on this new version without some sort of refactoring. For sure, I will skip version 13.0.

I kept my suggestions on .

Jeremy Davis's picture

Thanks for testing that out and reporting back. Great work!

Carlos Vercelino's picture

Hi Jeremy,

I tried to build an ISO for the Odoo appliance using TKLdev v15.0 but I have not succeed.

See below the console output showing the error:

root@tkl-tkldev15-vm ~# cd products
/turnkey/fab/products
root@tkl-tkldev15-vm .../fab/products# git-clone https://github.com/turnkeylinux-apps/odoo.git
Cloning into 'odoo'...
remote: Enumerating objects: 3189, done.
remote: Total 3189 (delta 0), reused 0 (delta 0), pack-reused 3189
Receiving objects: 100% (3189/3189), 1.76 MiB | 1.05 MiB/s, done.
Resolving deltas: 100% (1243/1243), done.
root@tkl-tkldev15-vm .../fab/products# cd odoo
/turnkey/fab/products/odoo
root@tkl-tkldev15-vm .../products/odoo# make
deck /turnkey/fab/bootstraps/stretch build/bootstrap
fab-apply-overlay /turnkey/fab/common/overlays/bootstrap_apt build/bootstrap;
fab-chroot build/bootstrap "echo nameserver 8.8.8.8 > /etc/resolv.conf";
fab-chroot build/bootstrap "echo nameserver 8.8.4.4 >> /etc/resolv.conf";
fab-chroot build/bootstrap --scrroot@tkl-tkldev15-vm ~# cd products
/turnkey/fab/products
root@tkl-tkldev15-vm .../fab/products# git-clone https://github.com/turnkeylinux-apps/odoo.git
Cloning into 'odoo'...
remote: Enumerating objects: 3189, done.
remote: Total 3189 (delta 0), reused 0 (delta 0), pack-reused 3189
Receiving objects: 100% (3189/3189), 1.76 MiB | 1.05 MiB/s, done.
Resolving deltas: 100% (1243/1243), done.
root@tkl-tkldev15-vm .../fab/products# cd odoo
/turnkey/fab/products/odoo
root@tkl-tkldev15-vm .../products/odoo# make
deck /turnkey/fab/bootstraps/stretch build/bootstrap
fab-apply-overlay /turnkey/fab/common/overlays/bootstrap_apt build/bootstrap;
fab-chroot build/bootstrap "echo nameserver 8.8.8.8 > /etc/resolv.conf";
fab-chroot build/bootstrap "echo nameserver 8.8.4.4 >> /etc/resolv.conf";
fab-chroot build/bootstrap --script /turnkey/fab/common/conf/bootstrap_apt;
tmp/chroot-script.YWeWsc/bootstrap_apt: line 34: gpg: command not found
/usr/share/fab/product.mk:535: recipe for target 'build/stamps/bootstrap' failed
make: *** [build/stamps/bootstrap] Error 127
root@tkl-tkldev15-vm .../products/odoo#ipt /turnkey/fab/common/conf/bootstrap_apt;
tmp/chroot-script.YWeWsc/bootstrap_apt: line 34: gpg: command not found
/usr/share/fab/product.mk:535: recipe for target 'build/stamps/bootstrap' failed
make: *** [build/stamps/bootstrap] Error 127
root@tkl-tkldev15-vm .../products/odoo#

The same has happend with the Core App.

I have followed the procedure Setup: build your first image.

Any help will be very welcome!

Jeremy Davis's picture

It is possible to use the v15.x TKLDev, but not without tweaking it... And even then, unless used in a very specific way, it will only be able to build v15.x appliances.

As we're moving forward to v16.x, I won't bother going into further detail re v15.x.

As noted in my earlier post, I'm more than happy to help you to help us updating the Odoo appliance though! :)

Jeremy Davis's picture

I've just posted some doc links re TKLDev in another thread (related to development; not Odoo) and thought it might be worth reposting here too?!

Although if you're interested in learning more about working with TKLDev and appliance build code (as you've already dabbled a bit with getting TurnKey LXC guests working on your Stretch based LXC host). You can follow the links to docs from the TKLDev appliance page, but it's well worth noting that some of the TKLDev docs are a bit out of date.



For entry level TKLDev docs, there is a website page on building an ISO, thought that will only work as seamlessly as that suggests for an appliance that we have already published as v16.x (and even then, for appliances that use upstream source code, not guarantees)! Then there's a slightly more technical overview (on GitHub - within the TKLDev build code repo). Then there's a page specifically for updating/maintaining and applaince.



There are lot more docs there, some which might be useful, some not so much... If you do have a go and have questions and/or hit issues, please ask! Also, if you have suggestions feedback re the docs, I'd love to hear.

Carlos Vercelino's picture

Is TKLPatch still a viable solution for appliance customization? It seems to me that TKLPatch has not being maintained anymore.

In the past I did used it a lot in order to apply customization to my appliances on the fly with the command:

tklpatch-apply / my-patch.tar.gz

It still works as in the past?

Jeremy Davis's picture

Yes it should still work fine. FWIW we still use it ourselves within buildtasks (the toolkit that we use to build all the different formats ready for publishing).

Add new comment