K
K
kokotokokoto02020-09-22 17:01:11
Python
kokotokokoto0, 2020-09-22 17:01:11

Can't install telegram bot on ubuntu server?

Hey! I can't deploy a telegram bot on Ubuntu 18.04
I did everything according to these instructions:

Dependencies:

firebase==3.0.1
firebase-admin==4.3.0
pyTelegramBotAPI==3.7.1
grpcio==1.29.0
requests==2.23.0

I installed this on the server itself:

build-essential
libssl-dev
libffi-dev
python3-pip
python3-dev
python3-setuptools
python3-venv

After installing the virtual environment, I went to /etc/systemd/system/ and made the service uba.service

uba.service

[Unit]
Description=uba
After=network.target

[Service]
User=uba
Group=uba

WorkingDirectory=/home/kokoto/uba/
Environment="PYTHONPATH=/home/kokoto/uba/"
ExecStart=/home/kokoto/uba /.venv/bin/python /home/kokoto/uba/bot_bd.py

[Install]
WantedBy=multi-user.target


After launch, the following error occurs:

uba.service - uba
Loaded: loaded (/etc/systemd/system/uba.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-09-21 17:48:05 MSK ; 16h ago
Process: 10282 ExecStart=/home/kokoto/uba/.venv/bin/python /home/kokoto/uba/bot_bd.py (code=exited, status=216/GROUP)
Main PID: 10282 (code=exited, status=216/GROUP)

Sep 21 17:48:05 s307229 systemd[1]: Started uba.
Sep 21 17:48:05 s307229 systemd[10282]: uba.service: Failed to determine group credentials: No such process
Sep 21 17:48:05 s307229 systemd[10282]: uba.service: Failed at step GROUP spawning /home /kokoto/uba/.venv/bin/python: No such process
Sep 21 17:48:05 s307229 systemd[1]: uba.service: Main process exited, code=exited, status=216/GROUP
Sep 21 17:48:05 s307229 systemd[1]: uba.service: Failed with result 'exit-code'.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valdemar Smorman, 2020-09-22
@smorman

I would venture to guess offhand ...
Not very strong in Telegram bots ...
you have ExecStart=/home/kokoto/uba/.venv/bin/python
ie. The 2nd Python is launched (by default in 18.04 both the 2nd and the 3rd are installed)
And this is all installed for the 3rd Python:

python3-pip
python3-dev
python3-setuptools
python3-venv

And the 2nd and 3rd ones, as it were, are not ale with each other ...
You have the following conclusion:
Failed at step GROUP spawning /home/kokoto/uba/.venv/bin/python: No such
process missing...
Can change
/home/kokoto/uba/.venv/bin/python
to
/home/kokoto/uba/.venv/bin/python3
?

V
vreitech, 2020-09-22
@fzfx

and the user uba is definitely in the system?
and the uba group is definitely in the system?
Is there a directory /home/kokoto in the system?
does the uba user have access to the /home/kokoto directory?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question