xtrime-ru / TelegramApiServer

Fast, simple, async php telegram api server: MadelineProto + Amp HTTP Server
https://tg.i-c-a.su
MIT License
529 stars 116 forks source link

Mysql problem #141

Closed bbonia closed 7 months ago

bbonia commented 7 months ago

Hi. Can you help me? when I`m connecting to my tg account I get the problem. errorT

xtrime-ru commented 7 months ago

Please describe steps to reproduce this issue?

bbonia commented 7 months ago

I installed all dependencies, started containers by docker-compose up from docker-compose.yml. All starts well but it give me that fault if I connect to TG account. Everything works well if I launch it using memory or not database

xtrime-ru commented 7 months ago

If you having issues with db, then you probably edit DB settings and made an error. You must not edit DB settings in env.docker file.

I need full log to be sure, because this error tells me nothing...

bbonia commented 7 months ago

image

bbonia commented 7 months ago
# ENV file version
# Check for outdated .env files
VERSION=1

SERVER_ADDRESS=0.0.0.0
SERVER_PORT=9503

MEMORY_LIMIT=256M
TIMEZONE=UTC

# List of allowed clients. Separate with comma.
# Leave blanc, to allow requests from all IP (THIS WILL MAKE API UNSECURE!)
# To recieve requests from internet also need to (THIS WILL MAKE API UNSECURE!):
#   1) remove `127.0.0.1:` from ports in docker-compose.yml. Should be: ` - "9503:9503"`.
#   2) recreate container `docker-compose up -d`
IP_WHITELIST=

There are some settings but I can`t show it
# TELEGRAM CLIENT
LOGGER_LEVEL=2
TELEGRAM_PROXY_ADDRESS

# DB
#   memory
#       Keep all data in memory/session file.
#       This is default behavior
#   mysql
#       Keep part of data in mysql database.
#       Reduce memory consumption and session size. Beta function.
#       MariaDb + InnoDb Preffered.
#       Tables and DB will be created if not exists.

#   Change this type to convert session:
DB_TYPE=memory
#   MYSQL Settings. Required, when DB_TYPE=mysql
DB_HOST=mysql
DB_PORT=3306
DB_USER=root
DB_PASSWORD=
DB_DATABASE=MadelineProto
DB_MAX_CONNECTIONS=20
DB_IDLE_TIMEOUT=60
#   Recent data will be stored in memory this amount of time:
DB_CACHE_TTL="+5 minutes"

# HEALTHCHECK
# If server stops responding to requests it will be stoped
# Requests made each 30 seconds by default.
HEALTHCHECK_ENABLED=0
HEALTHCHECK_INTERVAL=30
HEALTHCHECK_REQUEST_TIMEOUT=10
xtrime-ru commented 7 months ago

I see you increased DB_MAX_CONNECTIONS. But DB_HOST is correct.

I suggest you to make clean install, copy .env.docker.example to .env.docker, fill API_ID and API_HASH and authorize again. Dont need to install dependencies and edit other settings. Just follow instalations steps in README.

bbonia commented 7 months ago

ok. Thanks

xtrime-ru commented 7 months ago

@bbonia All is working now?

bbonia commented 7 months ago

no

bbonia commented 7 months ago

I reinstalled many times using different OS but it so hard to install composer without errors. And if I install it database doesn`t work anyway. But it works with Memory usage

xtrime-ru commented 7 months ago

but it so hard to install composer without errors.

composer dependencies installed automatically during first start. You don't follow install steps precisely, this can lead to errors. Its not safe to run composer update, because it will install new and unsupported versions of dependencies.

bbonia commented 7 months ago

but it so hard to install composer without errors.

composer dependencies installed automatically during first start. You don't follow install steps precisely, this can lead to errors. Its not safe to run composer update, because it will install new and unsupported versions of dependencies.

I did by different ways. I tried to install only with instruction but have got error like something wrong with composer. What OS and it`s version can you advise?