ilyarolf / AiogramShopBot

Aiogram Telegram bot shop with ways to deposit in BTC, LTC, USDT TRC-20, USDT ERC-20, USDD TRC-20, USDC ERC-20.
https://t.me/demo_aiogramshopbot
MIT License
63 stars 21 forks source link

Problem installing the bot #43

Closed Max33015 closed 4 months ago

Max33015 commented 4 months ago

Hello, I'm sending you this message after several unsuccessful attempts to install your project. I have a VPS running Ubuntu 22.04. I have followed your readme to the letter I installed the master branch, installed all the necessary packages using pip.

here is my configuration .env :

WEBHOOK_HOST = "localhost" WEBHOOK_PATH = "/AiogramShopBot" WEBAPP_HOST = "localhost" WEBAPP_PORT = 5000 TOKEN = "xxx" ADMIN_ID_LIST = xx SUPPORT_LINK = "" DB_NAME = "db.db" NGROK_TOKEN = "xxx" PAGE_ENTRIES = "

here's my docker-compose.yml configuration:

WEBHOOK_PATH: "" WEBAPP_HOST: "0.0.0.0" # Don't touch this WEBAPP_PORT: 5000 # Here your port TOKEN: "xxxx" # Here your bot token from botfather NGROK_TOKEN: 'xxx' # Here your ngrok token from ngrok.com ADMIN_ID_LIST: "773522875" # Telegram ID's for admins; SUPPORT_LINK: "https://t.me/hgfhfgfgh" DB_NAME: "database.db" # Here your database name PAGE_ENTRIES: 20 # Items per page

Here's the error I got after running docker-compose up :

root@hosthost:~/AiogramShopBot# docker-compose up WARNING: Python-dotenv could not parse statement starting at line 10 Traceback (most recent call last): File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, kwargs) File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get return self.get(url, self._set_request_timeout(kwargs)) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 790, in urlopen response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 496, in _make_request conn.request( TypeError: HTTPConnection.request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/docker-compose", line 33, in sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')()) File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main command_func() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command project = project_from_options('.', options) File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options return get_project( File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project client = get_client( File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client client = docker_client( File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs) File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( docker.errors.DockerException: Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument 'chunked'

Here's the error obtained after executing python run.py :

root@hosthost:~/AiogramShopBot# python3 run.py Python-dotenv could not parse statement starting at line 10 Traceback (most recent call last): File "/root/AiogramShopBot/run.py", line 5, in from bot import dp, main File "/root/AiogramShopBot/bot.py", line 3, in import config File "/root/AiogramShopBot/config.py", line 18, in PAGE_ENTRIES = int(os.environ.get("PAGE_ENTRIES")) TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

I'd like to point out that I tried several times without success before contacting you.

Here's my telegram: @MisterPicsou, please get back to me here, I really need help. I'd be delighted to give you a tip if you could help me. Thank you

ilyarolf commented 4 months ago

Hi @Max33015, I sent you a message on Telegram at 21:19 UTC+00.

ilyarolf commented 4 months ago

This issue was resolved in a Telegram dialog. The main problem was that the value for PAGE_ENTRIES was not specified. This value is needed for pagination, namely for displaying the number of records on one page. It also turned out that Dockerfile was outdated and no longer worked correctly, this problem was solved in PR #45.