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

Can`t start container #153

Open bbonia opened 3 months ago

bbonia commented 3 months ago

Hi. I try to start container like it`s written here but it goes to error. Help me please.

err1 err2

There is the same error with memory usage settings. That works interactively only

xtrime-ru commented 3 months ago

Please authorise in interactive mode. It is one time operation.

bbonia commented 3 months ago

Please authorise in interactive mode. It is one time operation.

I wanna do it in multi session mode. I can`t get access to the container remotely. It works only in interactive mode. err3

xtrime-ru commented 3 months ago

After you successfully login you need to stop temporary container and start it in background with "up -d" command.

If you need to start multiple sessions, create docker-compose.override.yml. Add additional containers there. Use unique ports and session names in command.

You can autorize sessions remotely, but i do not support this function anymore, use it at your own risk: https://github.com/xtrime-ru/TelegramApiServer?tab=readme-ov-file#multiple-sessions-support

To enable multi session mode and skip session creation during start use -s=* instead of session name here: https://github.com/xtrime-ru/TelegramApiServer/blob/master/docker-compose.yml#L24

bbonia commented 3 months ago

After you successfully login you need to stop temporary container and start it in background with "up -d" command.

If you need to start multiple sessions, create docker-compose.override.yml. Add additional containers there. Use unique ports and session names in command.

You can autorize sessions remotely, but i do not support this function anymore, use it at your own risk: https://github.com/xtrime-ru/TelegramApiServer?tab=readme-ov-file#multiple-sessions-support

To enable multi session mode and skip session creation during start use -s=* instead of session name here: https://github.com/xtrime-ru/TelegramApiServer/blob/master/docker-compose.yml#L24

Have I just to create file docker-compose.override.yml and just start container like docker compose up -d? Is there anything else?

bbonia commented 3 months ago

I lost session after reload container. Why are sessions not saved? I need session files required for start. It needs for multiple sessions

bbonia commented 3 months ago

I did that you said but I`ve get an error when I try to connect remotely. But session is created. help please errNew4

xtrime-ru commented 3 months ago

create file docker-compose.override.yml and just start container like docker compose up -d

Yes. Override port and command, or add new container.

xtrime-ru commented 3 months ago

I lost session after reload container.

How you created the session?

bbonia commented 3 months ago

remotely. with link http://IP:9503/system/addSession?session=users/xtrime

xtrime-ru commented 3 months ago

have done all requests to authorize it? https://github.com/xtrime-ru/TelegramApiServer?tab=readme-ov-file#authorizing-session-remotely

You could try to call http://127.0.0.1:9503/api/%session%/serialize after authorisation.

But as i said, i provide no support for this feature...

bbonia commented 3 months ago

ok. thanks a lot

bbonia commented 3 months ago

I solved the problem with session. But It doesn`t write session correctly after restart container. errNew5

xtrime-ru commented 3 months ago

You need to authorise this session, and make sure its serialized before restarting (call serialize method, or wait 10 minutes before automatic serialization happens)

bbonia commented 3 months ago

Do you mean my session didn't have time to save at vps? But there is file with session on vps. I just stop and start again the container

bbonia commented 3 months ago

and I`ve get this mistake all time but chats download well. Can you explain this one please? errNew6

bbonia commented 3 months ago

http://IP:9521/api/users/number/serialize gives me that error errNew7

xtrime-ru commented 3 months ago

Serialization method was moved in other place, probably this is why your session not saved after manual login via http. I pushed fix: https://github.com/xtrime-ru/TelegramApiServer/commit/6a045fdfb1c59cfc0d065e30d40e3fbe4eb6fa75

Please update to latest master and try to call serizalize again after manual login.

xtrime-ru commented 3 months ago

Dont know anything about Undefined array key "user" What method you calling? Also i suggest to ask in madelineProto support group.

bbonia commented 3 months ago

Dont know anything about Undefined array key "user" What method you calling? Also i suggest to ask in madelineProto support group.

Everything is from https://github.com/xtrime-ru/TelegramApiServer/tree/master#session-management

bbonia commented 3 months ago

Serialization method was moved in other place, probably this is why your session not saved after manual login via http. I pushed fix: 6a045fd

Please update to latest master and try to call serizalize again after manual login.

thanks. It works well

bbonia commented 3 months ago

hi. help me one else please After successful logging I have good working app but I can`t delete the session. I deleted container and session files from server, reboot the OS but it says me error when I try to log in again with the same number errNew8

bbonia commented 3 months ago

that error goes when I add new session. It is copied to each container.

xtrime-ru commented 3 months ago

Is you use -s=* it means to load all sessions in container. Please use globe syntax to select sessions for each container: https://en.wikipedia.org/wiki/Glob_(programming)

xtrime-ru commented 3 months ago

Deleting session is complicated. You need to stop container, then remove session folder, then remove session tables from mysql database.

bbonia commented 2 months ago

hi. thanks a lot. But how can I do that (deleting from table)? Is it real only by modifying table with another program or something docker command? And one else question/ What is the different to use session in mysql or memory?