Des instructions d'installation simples et fonctionnelles pour UBUNTU serveur?

bjr
essayez les instructions de ce post RECAP#2 :wink::+1:

créer un serveur Ubuntu 20.04LTS chez Hetzner (CPU: 2, RAM: 8GB, HD: 40GB)
ssh root@IP -i .ssh/my_ssh-id

apt update && apt upgrade -y && apt install -y python3-pip

adduser dokos

  • enter the password

usermod -aG sudo dokos
su - dokos
export LC_ALL=C.UTF-8
wget https://gitlab.com/dokos/docli/raw/master/bench/install.py
sudo python3 install.py --production --user dokos --verbose

  • enter the password

  • enter the password for mysql

  • enter the password for admin

Ansible run … and crash

TASK [bench : python3 bench init] *********************************************************************
task path: /tmp/.bench/bench/playbooks/roles/bench/tasks/main.yml:46
<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 /var/tmp `"&& mkdir /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816 && echo ansible-tmp-1653886292.7687883-36413-66201028384816="` echo /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-20551cj_abs_f/tmpddyffaz8 TO /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:dokos:r-x /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816/ /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u dokos /bin/sh -c '"'"'echo BECOME-SUCCESS-wchqzzpbqmuoepgvpemmrtvwgtwxmfko ; /usr/bin/python3 /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1653886292.7687883-36413-66201028384816/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": [
        "bench",
        "init",
        "/home/dokos/dokos-bench",
        "--frappe-path",
        "https://gitlab.com/dokos/dodock",
        "--frappe-branch",
        "master",
        "--python",
        "python3"
    ],
    "delta": "0:00:15.270755",
    "end": "2022-05-30 04:51:48.274232",
    "invocation": {
        "module_args": {
            "_raw_params": "bench init /home/dokos/dokos-bench --frappe-path https://gitlab.com/dokos/dodock --frappe-branch master --python python3",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": "/home/dokos/dokos-bench",
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2022-05-30 04:51:33.003477",
    "stderr": "Cloning into 'dodock'...\nwarning: redirecting to https://gitlab.com/dokos/dodock.git/\nAborted!",
    "stderr_lines": [
        "Cloning into 'dodock'...",
        "warning: redirecting to https://gitlab.com/dokos/dodock.git/",
        "Aborted!"
    ],
    "stdout": "Setting Up Environment\n$ /usr/local/bin/virtualenv --quiet env -p python3\n$ /home/dokos/dokos-bench/env/bin/python -m pip install --quiet --upgrade pip\nGetting dodock\n$ git clone https://gitlab.com/dokos/dodock --branch master --depth 1 --origin upstream\nTraceback (most recent call last):\n  File \"/usr/local/lib/python3.8/dist-packages/bench/commands/make.py\", line 70, in init\n    init(\n  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/render.py\", line 95, in wrapper_fn\n    return fn(*args, **kwargs)\n  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/system.py\", line 79, in init\n    get_app(\n  File \"/usr/local/lib/python3.8/dist-packages/bench/app.py\", line 412, in get_app\n    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)\n  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/render.py\", line 110, in wrapper_fn\n    return fn(*args, **kwargs)\n  File \"/usr/local/lib/python3.8/dist-packages/bench/app.py\", line 190, in install\n    app_name = get_app_name(self.bench.name, self.repo)\n  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/app.py\", line 233, in get_app_name\n    with open(app_path, \"rb\") as f:\nFileNotFoundError: [Errno 2] No such file or directory: '/home/dokos/dokos-bench/apps/frappe/setup.py'\n\nERROR: There was a problem while creating /home/dokos/dokos-bench\nDo you want to rollback these changes? [y/N]: ",
    "stdout_lines": [
        "Setting Up Environment",
        "$ /usr/local/bin/virtualenv --quiet env -p python3",
        "$ /home/dokos/dokos-bench/env/bin/python -m pip install --quiet --upgrade pip",
        "Getting dodock",
        "$ git clone https://gitlab.com/dokos/dodock --branch master --depth 1 --origin upstream",
        "Traceback (most recent call last):",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/commands/make.py\", line 70, in init",
        "    init(",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/render.py\", line 95, in wrapper_fn",
        "    return fn(*args, **kwargs)",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/system.py\", line 79, in init",
        "    get_app(",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/app.py\", line 412, in get_app",
        "    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/render.py\", line 110, in wrapper_fn",
        "    return fn(*args, **kwargs)",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/app.py\", line 190, in install",
        "    app_name = get_app_name(self.bench.name, self.repo)",
        "  File \"/usr/local/lib/python3.8/dist-packages/bench/utils/app.py\", line 233, in get_app_name",
        "    with open(app_path, \"rb\") as f:",
        "FileNotFoundError: [Errno 2] No such file or directory: '/home/dokos/dokos-bench/apps/frappe/setup.py'",
        "",
        "ERROR: There was a problem while creating /home/dokos/dokos-bench",
        "Do you want to rollback these changes? [y/N]: "
    ]
}

PLAY RECAP ********************************************************************************************
localhost                  : ok=71   changed=44   unreachable=0    failed=1    skipped=59   rescued=0    ignored=0   

Traceback (most recent call last):
  File "install.py", line 499, in <module>
    install_bench(args)
  File "install.py", line 264, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 397, in run_playbook
    success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-vvvv', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=dokos']' returned non-zero exit status 2.
dokos@dokos:~$ 

Bonjour @JOduMonT,

Merci pour ces éléments.

Effectivement il y avait bien un problème avec la ligne de commande pour installer l’application.
C’est corrigé et vous pouvez reprendre l’installation en cours en utilisant les commandes suivantes:

  1. Mettez à jour la ligne de commande avec pip install dokos-cli --upgrade
  2. Supprimez le dossier dokos-bench qui a été créé et est tombé en erreur
  3. Créez un nouveau bench avec la commande bench init {nom-de-mon-bench (ex. dokos-bench)} --frappe-branch master
  4. cd {mon-bench}
  5. bench get-app https://gitlab.com/dokos/dokos
  6. bench new-site {mon-site}
  7. bench install-app erpnext
  8. sudo bench setup production {USER}

Bonne journée !

Comme étapes supplémentaires avant la création du DOKOSUSER, j’ai :

apt install sudo
apt-get install vim

puis (sans trait d’union) ((un menu détail))

su DOKOSUSER

après la création d’un utilisateur, il faut bien changer de dossier pour celui de l’utilisateur

cd ~

avant de lancer

sudo python3 install.py --production --user dokos --verbose

Cela a-t-il été utile ?