xtrime-ru / TelegramApiServer

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

Not an issue - observation with supabase #115

Closed johndpope closed 1 year ago

johndpope commented 1 year ago

I bring your attention to supabase. With this - you can remove the need for extra docker service.

Supabase has real time access to tables - which you can subscribe to and it's very nice ui / can do sql editor etc. For my needs building an app - it's very powerful. There's a free tier to 500mb database and many client libraries - eg. here's one for php https://github.com/rafaelwendel/phpsupabase

here I connect to database

I will use the memory option for now and avoid database. but it would be good if this worked. supabase has a REST api out of the box - so you can get all this data.

Screenshot 2023-02-01 at 10 39 30 am

Screenshot 2023-02-01 at 10 38 51 am

composer require amphp/postgres

DB_TYPE=postgres
#   MYSQL Settings. Required, when DB_TYPE=mysql
DB_HOST=db.1234.supabase.co
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=1234
DB_DATABASE=postgres
DB_MAX_CONNECTIONS=10
DB_IDLE_TIMEOUT=60

the db creation is fine - but session is flacky - keeps dropping out and reconnecting. I used DB_MAX_CONNECTIONS=1

supabase has pgbouncer https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pool

php server.php --session=session

[2023-01-31 23:36:23] [warning]
Starting MadelineProto...

[2023-01-31 23:36:24] [warning] Serialization is out of date, reconstructing object!
[2023-01-31 23:36:34] [error] The operation was cancelled
[2023-01-31 23:36:34] [warning] Creating/checking table 847052656_MTProto_chats
[2023-01-31 23:36:34] [error] The operation was cancelled
[2023-01-31 23:36:34] [warning] Creating/checking table 847052656_MTProto_full_chats
[2023-01-31 23:36:34] [error] The operation was cancelled
[2023-01-31 23:36:34] [warning] Creating/checking table 847052656_MTProto_sponsoredMessages
[2023-01-31 23:36:37] [error] Converting danog\MadelineProto\Db\MemoryArray to danog\MadelineProto\Db\PostgresArray
[2023-01-31 23:36:37] [error] Converting database done.
[2023-01-31 23:36:37] [error] Converting danog\MadelineProto\Db\MemoryArray to danog\MadelineProto\Db\PostgresArray
[2023-01-31 23:36:37] [error] Converting danog\MadelineProto\Db\MemoryArray to danog\MadelineProto\Db\PostgresArray
[2023-01-31 23:36:37] [error] Converting database done.
[2023-01-31 23:36:38] [warning] Creating/checking table 847052656_MTProto_usernames
[2023-01-31 23:36:38] [warning] Creating/checking table 847052656_MTProto_channelParticipants
[2023-01-31 23:36:38] [error] ERROR:  duplicate key value violates unique constraint "pg_proc_proname_args_nsp_index"
DETAIL:  Key (proname, proargtypes, pronamespace)=(update_ts, , 2200) already exists.

[2023-01-31 23:36:38] [warning] Creating/checking table 847052656_MTProto_session
[2023-01-31 23:36:40] [error] Converting danog\MadelineProto\Db\MemoryArray to danog\MadelineProto\Db\PostgresArray
[2023-01-31 23:36:40] [error] Converting danog\MadelineProto\Db\MemoryArray to danog\MadelineProto\Db\PostgresArray
[2023-01-31 23:36:40] [error] Converting database done.
[2023-01-31 23:36:55] [warning] Loading data to table 847052656_MTProto_chats: 90/90
[2023-01-31 23:36:55] [error] Converting database done.
[2023-01-31 23:36:56] [warning] Loading data to table 847052656_MTProto_usernames: 48/48
[2023-01-31 23:36:56] [error] Converting database done.
[2023-01-31 23:36:58] [warning] Creating/checking table 847052656_ReferenceDatabase_db
[2023-01-31 23:37:00] [warning] Creating/checking table 847052656_MinDatabase_db
[2023-01-31 23:37:01] [warning] Creating/checking table 847052656_MTProto_chats
[2023-01-31 23:37:03] [warning] Creating/checking table 847052656_MTProto_full_chats
[2023-01-31 23:37:05] [warning] Creating/checking table 847052656_MTProto_sponsoredMessages
[2023-01-31 23:37:08] [warning] Creating/checking table 847052656_MTProto_channelParticipants
[2023-01-31 23:37:09] [warning] Creating/checking table 847052656_MTProto_usernames
[2023-01-31 23:37:11] [warning] Creating/checking table 847052656_MTProto_session
[2023-01-31 23:37:11] [critical]
{
    "exception": "Amp\\CancelledException",
    "message": "The operation was cancelled",
    "file": "\/Users\/johndpope\/Documents\/gitWorkspace\/TelegramApiServer\/vendor\/amphp\/amp\/lib\/CancellationTokenSource.php",
    "line": 161,
    "code": 0,
    "backtrace": [
        {
            "file": "\/Users\/johndpope\/Documents\/gitWorkspace\/TelegramApiServer\/vendor\/amphp\/amp\/lib\/TimeoutCancellationToken.php",
            "line": 30,
            "function": "cancel",
            "class": "Amp\\CancellationTokenSource",
            "type": "->",
            "args": [
                {}
            ]
        },
        {
            "file": "\/Users\/johndpope\/Documents\/gitWorkspace\/TelegramApiServer\/vendor\/amphp\/amp\/lib\/Loop\/NativeDriver.php",
            "line": 142,
            "function": "Amp\\{closure}",
            "class": "Amp\\TimeoutCancellationToken",
            "type": "::",
            "args": [
                "fq",
                null
            ]
        },
        {
            "file": "\/Users\/johndpope\/Documents\/gitWorkspace\/TelegramApiServer\/vendor\/amphp\/amp\/lib\/Loop\/Driver.php",
            "line": 138,
            "function": "dispatch",
            "class": "Amp\\Loop\\NativeDriver",
            "type": "->",
            "args": [
                true
            ]
        }
    ]
}
[2023-01-31 23:37:11] [critical] Loop exceptionally stopped without resolving the promise
[2023-01-31 23:37:11] [critical] Amp\TimeoutException: Operation timed out
TimeoutCancellationToken was created here:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/TimeoutConnector.php:39 Amp\TimeoutCancellationToken->__construct()
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:269 Amp\Postgres\TimeoutConnector->connect()
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/Pool.php:79 Amp\Sql\Common\ConnectionPool->pop()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:337 Amp\Postgres\Pool->pop()
#4 Amp\Sql\Common\ConnectionPool->Amp\Sql\Common\{closure}()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#7 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:336 Amp\call()
#8 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/PostgresArray.php:116 Amp\Sql\Common\ConnectionPool->query()
#9 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DriverArray.php:112 danog\MadelineProto\Db\PostgresArray->prepareTable()
#10 danog\MadelineProto\Db\DriverArray::danog\MadelineProto\Db\{closure}()
#11 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#12 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#13 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DriverArray.php:110 Amp\call()
#14 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DbPropertiesFactory.php:75 danog\MadelineProto\Db\DriverArray::getInstance()
#15 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DbPropertiesTrait.php:44 danog\MadelineProto\Db\DbPropertiesFactory::get()
#16 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProtoTools/MinDatabase.php:83 danog\MadelineProto\MTProtoTools\MinDatabase->initDb()
#17 danog\MadelineProto\MTProtoTools\MinDatabase->init()
#18 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php:71 Generator->current()
#19 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php:456 danog\MadelineProto\Coroutine->__construct()
#20 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php:317 danog\MadelineProto\Tools::call()
#21 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1067 danog\MadelineProto\Tools::all()
#22 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:624 danog\MadelineProto\MTProto->cleanupProperties()
#23 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1188 danog\MadelineProto\MTProto->__construct_async()
#24 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1280 danog\MadelineProto\MTProto->upgradeMadelineProto()
#25 danog\MadelineProto\MTProto->wakeupAsync()
#26 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php:112 Generator->send()
#27 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Success.php:41 danog\MadelineProto\Coroutine->danog\MadelineProto\{closure}()
#28 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Internal/Placeholder.php:143 Amp\Success->onResolve()
#29 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Deferred.php:53 Amp\Promise@anonymous in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/TimeoutCancellationToken.php:30
Stack trace:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/NativeDriver.php(142): Amp\TimeoutCancellationToken::Amp\{closure}('fq', NULL)
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#4 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/src/Server/Server.php(40): Amp\Loop::run()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/server.php(101): TelegramApiServer\Server\Server->__construct(Array, Array)
#6 {main}

Next Amp\CancelledException: The operation was cancelled in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/CancellationTokenSource.php:161
Stack trace:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/TimeoutCancellationToken.php(30): Amp\CancellationTokenSource->cancel(Object(Amp\TimeoutException))
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/NativeDriver.php(142): Amp\TimeoutCancellationToken::Amp\{closure}('fq', NULL)
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#4 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/src/Server/Server.php(40): Amp\Loop::run()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/server.php(101): TelegramApiServer\Server\Server->__construct(Array, Array)
#7 {main}
PHP Fatal error:  Uncaught Amp\TimeoutException: Operation timed out
TimeoutCancellationToken was created here:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/TimeoutConnector.php:39 Amp\TimeoutCancellationToken->__construct()
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:269 Amp\Postgres\TimeoutConnector->connect()
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/Pool.php:79 Amp\Sql\Common\ConnectionPool->pop()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:337 Amp\Postgres\Pool->pop()
#4 Amp\Sql\Common\ConnectionPool->Amp\Sql\Common\{closure}()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#7 /Users/j
Fatal error: Uncaught Amp\TimeoutException: Operation timed out
TimeoutCancellationToken was created here:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/TimeoutConnector.php:39 Amp\TimeoutCancellationToken->__construct()
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:269 Amp\Postgres\TimeoutConnector->connect()
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/Pool.php:79 Amp\Sql\Common\ConnectionPool->pop()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:337 Amp\Postgres\Pool->pop()
#4 Amp\Sql\Common\ConnectionPool->Amp\Sql\Common\{closure}()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#7 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:336 Amp\call()
#8 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/PostgresArray.php:116 Amp\Sql\Common\ConnectionPool->query()
#9 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DriverArray.php:112 danog\MadelineProto\Db\PostgresArray->prepareTable()
#10 danog\MadelineProto\Db\DriverArray::danog\MadelineProto\Db\{closure}()
#11 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#12 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#13 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DriverArray.php:110 Amp\call()
#14 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DbPropertiesFactory.php:75 danog\MadelineProto\Db\DriverArray::getInstance()
#15 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DbPropertiesTrait.php:44 danog\MadelineProto\Db\DbPropertiesFactory::get()
#16 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProtoTools/MinDatabase.php:83 danog\MadelineProto\MTProtoTools\MinDatabase->initDb()
#17 danog\MadelineProto\MTProtoTools\MinDatabase->init()
#18 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php:71 Generator->current()
#19 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php:456 danog\MadelineProto\Coroutine->__construct()
#20 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php:317 danog\MadelineProto\Tools::call()
#21 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1067 danog\MadelineProto\Tools::all()
#22 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:624 danog\MadelineProto\MTProto->cleanupProperties()
#23 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1188 danog\MadelineProto\MTProto->__construct_async()
#24 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1280 danog\MadelineProto\MTProto->upgradeMadelineProto()
#25 danog\MadelineProto\MTProto->wakeupAsync()
#26 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php:112 Generator->send()
#27 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Success.php:41 danog\MadelineProto\Coroutine->danog\MadelineProto\{closure}()
#28 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Internal/Placeholder.php:143 Amp\Success->onResolve()
#29 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Deferred.php:53 Amp\Promise@anonymous in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/TimeoutCancellationToken.php:30
Stack trace:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/NativeDriver.php(142): Amp\TimeoutCancellationToken::Amp\{closure}('fq', NULL)
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#4 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/src/Server/Server.php(40): Amp\Loop::run()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/server.php(101): TelegramApiServer\Server\Server->__construct(Array, Array)
#6 {main}

Next Amp\CancelledException: The operation was cancelled in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/CancellationTokenSource.php:161
Stack trace:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/TimeoutCancellationToken.php(30): Amp\CancellationTokenSource->cancel(Object(Amp\TimeoutException))
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/NativeDriver.php(142): Amp\TimeoutCancellationToken::Amp\{closure}('fq', NULL)
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#4 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/src/Server/Server.php(40): Amp\Loop::run()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/server.php(101): TelegramApiServer\Server\Server->__construct(Array, Array)
#7 {main}
  thrown in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/CancellationTokenSource.php on line 161
PHP Fatal error:  Uncaught Amp\TimeoutException: Operation timed out
TimeoutCancellationToken was created here:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/TimeoutConnector.php:39 Amp\TimeoutCancellationToken->__construct()
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:269 Amp\Postgres\TimeoutConnector->connect()
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/Pool.php:79 Amp\Sql\Common\ConnectionPool->pop()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:337 Amp\Postgres\Pool->pop()
#4 Amp\Sql\Common\ConnectionPool->Amp\Sql\Common\{closure}()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#7 /Users/j
Fatal error: Uncaught Amp\TimeoutException: Operation timed out
TimeoutCancellationToken was created here:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/TimeoutConnector.php:39 Amp\TimeoutCancellationToken->__construct()
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:269 Amp\Postgres\TimeoutConnector->connect()
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/postgres/src/Pool.php:79 Amp\Sql\Common\ConnectionPool->pop()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:337 Amp\Postgres\Pool->pop()
#4 Amp\Sql\Common\ConnectionPool->Amp\Sql\Common\{closure}()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#7 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/sql-common/src/ConnectionPool.php:336 Amp\call()
#8 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/PostgresArray.php:116 Amp\Sql\Common\ConnectionPool->query()
#9 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DriverArray.php:112 danog\MadelineProto\Db\PostgresArray->prepareTable()
#10 danog\MadelineProto\Db\DriverArray::danog\MadelineProto\Db\{closure}()
#11 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Coroutine.php:67 Generator->current()
#12 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/functions.php:96 Amp\Coroutine->__construct()
#13 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DriverArray.php:110 Amp\call()
#14 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DbPropertiesFactory.php:75 danog\MadelineProto\Db\DriverArray::getInstance()
#15 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Db/DbPropertiesTrait.php:44 danog\MadelineProto\Db\DbPropertiesFactory::get()
#16 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProtoTools/MinDatabase.php:83 danog\MadelineProto\MTProtoTools\MinDatabase->initDb()
#17 danog\MadelineProto\MTProtoTools\MinDatabase->init()
#18 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php:71 Generator->current()
#19 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php:456 danog\MadelineProto\Coroutine->__construct()
#20 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php:317 danog\MadelineProto\Tools::call()
#21 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1067 danog\MadelineProto\Tools::all()
#22 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:624 danog\MadelineProto\MTProto->cleanupProperties()
#23 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1188 danog\MadelineProto\MTProto->__construct_async()
#24 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/MTProto.php:1280 danog\MadelineProto\MTProto->upgradeMadelineProto()
#25 danog\MadelineProto\MTProto->wakeupAsync()
#26 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php:112 Generator->send()
#27 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Success.php:41 danog\MadelineProto\Coroutine->danog\MadelineProto\{closure}()
#28 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Internal/Placeholder.php:143 Amp\Success->onResolve()
#29 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Deferred.php:53 Amp\Promise@anonymous in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/TimeoutCancellationToken.php:30
Stack trace:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/NativeDriver.php(142): Amp\TimeoutCancellationToken::Amp\{closure}('fq', NULL)
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#4 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/src/Server/Server.php(40): Amp\Loop::run()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/server.php(101): TelegramApiServer\Server\Server->__construct(Array, Array)
#6 {main}

Next Amp\CancelledException: The operation was cancelled in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/CancellationTokenSource.php:161
Stack trace:
#0 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/TimeoutCancellationToken.php(30): Amp\CancellationTokenSource->cancel(Object(Amp\TimeoutException))
#1 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/NativeDriver.php(142): Amp\TimeoutCancellationToken::Amp\{closure}('fq', NULL)
#2 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(138): Amp\Loop\NativeDriver->dispatch(true)
#3 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop/Driver.php(72): Amp\Loop\Driver->tick()
#4 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/Loop.php(95): Amp\Loop\Driver->run()
#5 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/src/Server/Server.php(40): Amp\Loop::run()
#6 /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/server.php(101): TelegramApiServer\Server\Server->__construct(Array, Array)
#7 {main}
  thrown in /Users/johndpope/Documents/gitWorkspace/TelegramApiServer/vendor/amphp/amp/lib/CancellationTokenSource.php on line 161
xtrime-ru commented 1 year ago

Sorry, but im fan of open-source self-hosted solutions. Remote 3rd party database is worst solution as you can see. And even if its ok on start you will have to move somewhere else soon or you got vendor-lock :) So i don't understand why you want spent money and time on such things.

I suggest you to use docker-compose. It will install you mysql container. No setup required, all works from the box.

If you want online tool for DB you can connect your mysql container to metabase, or get some opensource online DB viewer, or even use desctop client. This is linux way: you use simple tools and pipelineing them to get what you want. AIO solutions are heavy and unreliable.

Also, there is nothing usefull in madelineProto database. Its just cache of different internal data...

johndpope commented 1 year ago

oh no, supabase is open source.

https://github.com/supabase/supabase

it also has it's own docker cli https://github.com/supabase/supabase/tree/master/docker

its impressive / robust / extendable.

xtrime-ru commented 1 year ago

Oh, thats nice! You can deploy independend postgre container and setup supabase container to use it. Thanks for sharing!