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

$ wget https://gitlab.com/dokos/docli/raw/master/playbooks/install.py
"Resolving gitlab.com … ERROR 404: Not Found

Bonjour, il me semble que la documentation anglaise n’est pas à jour. La commande pour télécharger install.py est en fait celle-ci :

wget https://gitlab.com/dokos/docli/raw/master/bench/install.py

La documentation en français est, elle, bien à jour :

1 « J'aime »

Merci @corentin et @punkyard,

J’ai corrigé le lien sur la documentation en anglais.

@punkyard, pour le moment nous n’avons pas documenté le processus d’installation détaillé, mais fournissons un script d’installation rapide.
Pour faire une installation manuelle, vous pouvez suivre les étapes présentées ici: Installation
Il faut juste changer le lien d’installation de la ligne de commande bench:

Au lieu de pip3 install frappe-bench il faut utiliser pip3 install dokos-cli

A noter, le script d’installation rapide n’a pas encore été testé sur Ubuntu 22.04

Bonne journée!

Package python-pip 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
However the following packages replace it:
python3-pip

E: Package ‹ python-pip â€º has no installation candidate

bench init frappe-bench
ERROR: There was a problem while creating frappe-bench

j’ai essayé bench init dokos-cli
même erreur

L’installation rapide termine ainsi:

ERROR: [Errno 2] No such file or directory: ‘./config/supervisor.conf’…
FileNotFoundError: [Errno 2] No such file or directory: ‘./config/supervisor.conf’

cette version d’installation par script demande les étapes suivantes:

ssh root@111.222.333.444

apt update && apt upgrade -y
apt-get install python3-minimal
apt-get install build-essential python3-setuptools -y

sudo adduser DOKOSUSER
sudo usermod -aG sudo DOKOSUSER
su - DOKOSUSER

wget https://gitlab.com/dokos/docli/raw/master/bench/install.py
sudo python3 install.py --production --user DOKOSUSER --verbose
sudo bench setup production DOKOSUSER -y

Bonjour @punkyard,

Je viens de retester sur un VPS vierge (Ubuntu 20.04) en suivant les instructions de la doc et tout fonctionne correctement chez moi.
Voilà les étapes que j’ai suivi:

  1. Création d’un utilisateur ubuntu avec droits sudo

  2. sudo apt-get update

  3. sudo apt-get upgrade

  4. sudo apt install python3-pip => J’ai l’impression qu’il manque cette étape dans vos commandes

  5. sudo apt install build-essential python3-setuptools (non nécessaire sur Ubuntu)

  6. wget https://gitlab.com/dokos/docli/raw/master/bench/install.py

  7. export LC_ALL=C.UTF-8 (Peut être lancé quand c’est demandé par le script, puis il suffit de relancer le script)

  8. sudo python3 install.py --production --user ubuntu --verbose

  9. sudo bench setup production ubuntu

Ensuite je peux me connecter à l’adresse IP de mon VPS pour accéder à Dokos

Par contre, même si je ne pense pas que ce soit la cause des problèmes d’installation, 4go de Ram ça risque d’être très limite.
Je recommanderai au minimum 8Go.

avec 8go, peut-on envisager de partager le serveur avec d’autres applis ? (drupal, nextcloud)

il manquait cette étape de relance de install.py après la commande export :+1:

1 « J'aime »

POUR RECAPITULER :

CONNECTION SSH
ssh root@111.222.333
ROOTPASSWORD

MISE A JOUR DU SERVEUR
apt update && apt upgrade -y
sudo apt install python3-pip

AJOUT D’UN UTILISATEUR AVEC DROITS
sudo adduser DOKOSUSER
sudo usermod -aG sudo DOKOSUSER
su - DOKOSUSER

TELECHARGER LE SCRIPT
wget https://gitlab.com/dokos/docli/raw/master/bench/install.py

LANCER LE SCRIPT
sudo python3 install.py --production --user DOKOSUSER --verbose
DEFINIR MYSQLPASSWORD
DEFINIR ADMINSQLPASSWORD

APRES AFFICHAGE DE L’ERREUR
export LC_ALL=C.UTF-8

RELANCER LE SCRIPT
sudo python3 install.py --production --user DOKOSUSER --verbose
DEFINIR MYSQLPASSWORD
DEFINIR ADMINSQLPASSWORD

PATIENTER AU MOINS 20 MIN D’INSTALLATION
cd dokos-bench ?
sudo bench setup production DOKOSUSER -y

ERROR: [Errno 2] No such file or directory: ‘./config/supervisor.conf’

IP DANS LE NAVIGATEUR : 111.222.333

Sorry!

We will be back soon.
Don’t panic. It’s not you, it’s us.
Most likely, our engineers are updating the code, and it should take a minute for the new code to load into memory.
Try refreshing after a minute or two.

après de nombreuses relances, pas de changement.

Re-bonjour @punkyard,

Je viens de refaire un test sur un droplet Digital Ocean (4CPU/8Gb Ram/Ubuntu 20.04 x64) en suivant exactement les mêmes étapes que celles décrites plus haut et je n’arrive pas à reproduire ce problème.

Le message d’erreur ERROR: [Errno 2] No such file or directory: ‘./config/supervisor.conf ressemble à problème d’autorisation pour créer les fichier de configuration de supervisor.
Essayez peut-être sudo chown -R dokos:dokos dokos-bench (si votre utilisateur s’appelle dokos et votre bench dokos-bench)

Puis relancez sudo bench setup production dokos

PS: Avez vous bien lancé la commande sudo bench setup production dokos depuis le dossier dokos-bench ?

à quelle étape aurais-je créé un bench DOKOS-BENCH ?

C’est le nom par défaut du dossier qui est créé par le script d’installation
Il est créé automatiquement à l’une des dernière étapes du script

RECAP#2 :

CONNECTION SSH

ssh root@111.222.333.444
ROOTPASSWORD

AJOUT D’UN UTILISATEUR AVEC DROITS

adduser DOKOSUSER

CREER UN MOT DE PASSE ET UNE FICHE D’IDENTITE

usermod -aG sudo DOKOSUSER
su DOKOSUSER

MISE A JOUR DU SERVEUR

sudo apt update && sudo apt upgrade -y
ENTER PASSWORD
sudo apt install python3-pip -y

TELECHARGER LE SCRIPT AU BON ENDROIT

cd ~
wget https://gitlab.com/dokos/docli/raw/master/bench/install.py

LANCER LE SCRIPT

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

APRES AFFICHAGE DE L’ERREUR, ENTRER

export LC_ALL=C.UTF-8

RELANCER LE SCRIPT

sudo python3 install.py --production --user DOKOSUSER --verbose
DEFINIR MYSQLPASSWORD
DEFINIR ADMINISTRATORPASSWORD

PATIENTER 20 MIN : Dokos has been successfully installed!

ls
cd dokos-bench
sudo bench setup production DOKOSUSER
OVERWRITE supervisor.conf & nginx.conf ? yes

NOUVEAU NAVIGATEUR

http://111.222.333.444/#login

CHARGEMENT DE LA PAGE DE CONNEXION
utilisateur : Administrator
mot de passe : MOTDEPASSEdéfiniPLUSHAUT

voilà !
C’était pas difficile !

1 « J'aime »

donc je suis ici sur le forum car lorsque je suis la documentation française, que je créé un utilisateur pour dokos et que je lance l’installation comme cela:

  • python-pip3 dit que sudo ne devrait pas être.

WARNING: Running pip as the ‹ root â€º user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.12.1 documentation

and then:…

Initializing bench dokos-bench:
Dodock Branch: master
Dokos Branch: master
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‹ all â€º
[WARNING]: Consider using the get_url or uri module rather than running ‹ curl â€º. If you need to use command because get_url or uri is
insufficient you can add ‹ warn: false â€º to this command task or set ‹ command_warnings=False â€º in ansible.cfg to get rid of this message.
[DEPRECATION WARNING]: evaluating as a bare variable, this behaviour will go away and you might need to add |bool to the expression in
the future. Also see CONDITIONAL_BARE_VARS configuration toggle… This feature will be removed in version 2.12. Deprecation warnings can
be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Consider using the file module with owner rather than running ‹ chown â€º. If you need to use command because file is insufficient
you can add ‹ warn: false â€º to this command task or set ‹ command_warnings=False â€º in ansible.cfg to get rid of this message.
Traceback (most recent call last):
File « install.py Â», line 499, in
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.

Le warning ne pose pas de problème.
Dokos est bien installé dans un environnement virtuel avec les bonnes autorisations via le script.

Par contre pour résoudre votre problème, pouvez-vous décrire précisément les étapes que vous avez suivies ? Sur quelle distribution faites vous l’installation ?
Il faut bien respecter l’ordre des étapes décrites dans la documentation ou ci-dessus: Des instructions d'installation simples et fonctionnelles pour UBUNTU serveur? - #8 by punkyard

1 « J'aime »

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:~$