Getting stuck at "INFO - Login via password" #1

Open
opened 2023-07-19 18:23:29 +00:00 by jakobkilian · 15 comments
jakobkilian commented 2023-07-19 18:23:29 +00:00 (Migrated from github.com)

Hi! Thanks for providing this repo. Very cool idea that I would like to experiment with for deaf people.

I am using the Yunohost package synapse_ynh. I followed the instructions and edited the config.json according to my server dates. Unfortunately when starting the the docker image with sudo docker compose up this is the output (won't change in 1 hour):

[+] Running 1/0
 ✔ Container matrix-stt-bot  Created                                                                                                                                0.0s 
Attaching to matrix-stt-bot
matrix-stt-bot  | 2023-07-19 18:15:05,645 - INFO - Bot started!
matrix-stt-bot  | 2023-07-19 18:15:11,946 - INFO - Login via password

I restarted the system and double checked the login credentials. Using Cinny I can login just fine.

This is my current config.json

{
    "homeserver": "https://matrix.MYDOMAIN.de",
    "user_id": "@botwhisper:MYDOMAIN.de",
    "password": "************",
    "device_id": "GMIAZSVFF",
    "room_id": "!mDqFzeYMAuCTDOlrBh:MYDOMAIN.de",
    "model_size": "medium",
    "import_keys_path": "element-keys.txt",
    "import_keys_password": "************"
}

Any idea? How can I get more verbose logging on why the login doesn't work?

Hi! Thanks for providing this repo. Very cool idea that I would like to experiment with for deaf people. I am using the Yunohost package [synapse_ynh](https://github.com/YunoHost-Apps/synapse_ynh). I followed the instructions and edited the config.json according to my server dates. Unfortunately when starting the the docker image with `sudo docker compose up` this is the output (won't change in 1 hour): ``` [+] Running 1/0 ✔ Container matrix-stt-bot Created 0.0s Attaching to matrix-stt-bot matrix-stt-bot | 2023-07-19 18:15:05,645 - INFO - Bot started! matrix-stt-bot | 2023-07-19 18:15:11,946 - INFO - Login via password ``` I restarted the system and double checked the login credentials. Using [Cinny](https://github.com/cinnyapp/cinny) I can login just fine. This is my current config.json ``` { "homeserver": "https://matrix.MYDOMAIN.de", "user_id": "@botwhisper:MYDOMAIN.de", "password": "************", "device_id": "GMIAZSVFF", "room_id": "!mDqFzeYMAuCTDOlrBh:MYDOMAIN.de", "model_size": "medium", "import_keys_path": "element-keys.txt", "import_keys_password": "************" } ``` Any idea? How can I get more verbose logging on why the login doesn't work?
hibobmaster commented 2023-07-20 01:22:20 +00:00 (Migrated from github.com)

Hi, I just tested it without problem, It seems you stuck at model downloading step? Can you provide your working directory screenshot for me?

If you have downloaded model before, you can start to use the bot when getting INFO - Login via password.

Besides, you can try without importing e2ee keys, here is my test configuration.
config.json

{
    "homeserver": "https://xxxxx.xxx",
    "user_id": "@lullap:xxx.xxxx",
    "password": "xxxxxxxxxx@NABYGaS^9",
    "device_id": "DFYEOKVPLG",
    "room_id": "!pgFjjtPUiAXSMyTmTU:matrix.qqs.tw",
    "model_size": "base"
}

compose.yaml

services:
  app:
    image: ghcr.io/hibobmaster/matrix-stt-bot:latest
    container_name: matrix-stt-bot
    restart: always
    # build:
    #   context: .
    #   dockerfile: ./Dockerfile
    # env_file:
    #   - .env
    volumes:
      # use env file or config.json
      - ./config.json:/app/config.json
      # use touch to create an empty file stt_db, for persist database only
      - ./stt_db:/app/db
      # import_keys path
      # - ./element-keys.txt:/app/element-keys.txt
      # store whisper models that program will download
      - ./models:/app/models
    networks:
      - matrix_network

networks:
  matrix_network:

Some errors can be ignored if you are not using E2EE room.

image
image
image

Hi, I just tested it without problem, It seems you stuck at model downloading step? Can you provide your working directory screenshot for me? **If you have downloaded model before, you can start to use the bot when getting `INFO - Login via password`.** Besides, you can try without importing e2ee keys, here is my test configuration. `config.json` ```json { "homeserver": "https://xxxxx.xxx", "user_id": "@lullap:xxx.xxxx", "password": "xxxxxxxxxx@NABYGaS^9", "device_id": "DFYEOKVPLG", "room_id": "!pgFjjtPUiAXSMyTmTU:matrix.qqs.tw", "model_size": "base" } ``` `compose.yaml` ```yaml services: app: image: ghcr.io/hibobmaster/matrix-stt-bot:latest container_name: matrix-stt-bot restart: always # build: # context: . # dockerfile: ./Dockerfile # env_file: # - .env volumes: # use env file or config.json - ./config.json:/app/config.json # use touch to create an empty file stt_db, for persist database only - ./stt_db:/app/db # import_keys path # - ./element-keys.txt:/app/element-keys.txt # store whisper models that program will download - ./models:/app/models networks: - matrix_network networks: matrix_network: ``` Some errors can be ignored if you are not using E2EE room. ![image](https://github.com/hibobmaster/matrix-stt-bot/assets/32976627/b9aba592-e7fa-4b4d-9d3b-09fd8b92f574) ![image](https://github.com/hibobmaster/matrix-stt-bot/assets/32976627/edaa507f-5109-4151-b1ad-4abc825fda40) ![image](https://github.com/hibobmaster/matrix-stt-bot/assets/32976627/dec8bb1b-4a2d-48f0-92c7-11f79526ab34)
jakobkilian commented 2023-07-20 06:25:40 +00:00 (Migrated from github.com)

Hi! Thanks for the quick reply.

Model download worked just fine i think. I used "medium" and the model could be found in the dir. I tested again now with "model_size": "base" and without E2EE. So my config and compose are identical to yours (except of URL and credentials of course). This is the log:

[+] Running 1/0
 ✔ Container matrix-stt-bot  Created                                                                                                                                                                                                       0.0s 
Attaching to matrix-stt-bot
matrix-stt-bot  | 2023-07-20 05:55:06,642 - INFO - Bot started!
Downloading model.bin:   0%|          | 0.00/145M [00:00<?, ?B/s]
matrix-stt-bot  | 
matrix-stt-bot  | 
Downloading (…)88d7250a/config.json: 100%|██████████| 2.31k/2.31k [00:00<00:00, 5.22MB/s]
matrix-stt-bot  | 
matrix-stt-bot  | 
matrix-stt-bot  | 0a/vocabulary.txt:   0%|          | 0.00/460k [00:00<?, ?B/s]
matrix-stt-bot  | 
Downloading model.bin:  14%|█▍        | 21.0M/145M [00:00<00:00, 151MB/s]
Downloading model.bin:  36%|███▌      | 52.4M/145M [00:00<00:00, 196MB/s], ?B/s]
matrix-stt-bot  | 
matrix-stt-bot  | 
Downloading (…)7250a/vocabulary.txt: 100%|██████████| 460k/460k [00:00<00:00, 1.62MB/s]
Downloading model.bin:  58%|█████▊    | 83.9M/145M [00:00<00:00, 206MB/s]
matrix-stt-bot  | 
matrix-stt-bot  | 
matrix-stt-bot  | 
Downloading (…)7250a/tokenizer.json: 100%|██████████| 2.20M/2.20M [00:00<00:00, 4.57MB/s]
matrix-stt-bot  | 
matrix-stt-bot  | 
Downloading model.bin:  79%|███████▉  | 115M/145M [00:00<00:00, 215MB/s] 
Downloading model.bin: 100%|██████████| 145M/145M [00:00<00:00, 214MB/s]
Downloading model.bin: 100%|██████████| 145M/145M [00:00<00:00, 204MB/s]
matrix-stt-bot  | 2023-07-20 05:55:09,165 - INFO - Login via password

Here it gets stuck again. When going to the channel there is no response and it is saying that the bot is offline...
This is my working dir:

ls -lShR
.:
total 72K
-rw-r--r-- 1 admin 1007  24K Jul 19 14:55 bot.py
drwxr-xr-x 2 root  root 4.0K Jul 19 15:17 models
drwxr-xr-x 2 root  root 4.0K Jul 19 15:17 stt_db
-rw-r--r-- 1 admin 1007 3.1K Jul 19 14:55 README.md
-rw-r--r-- 1 admin 1007 1.3K Jul 19 14:55 send_message.py
-rw-r--r-- 1 admin 1007 1.2K Jul 19 14:55 log.py
-rw-r--r-- 1 admin 1007 1.1K Jul 19 14:55 LICENSE
-rw-r--r-- 1 admin 1007 1.1K Jul 19 14:55 requirements.txt
-rw-r--r-- 1 admin 1007  660 Jul 19 14:55 Dockerfile
-rw-r--r-- 1 admin 1007  657 Jul 19 15:16 compose.yaml
-rw-r--r-- 1 admin 1007  296 Jul 19 14:55 config.json.example
-rw-r--r-- 1 admin 1007  227 Jul 20 05:59 config.json
-rw-r--r-- 1 admin 1007  167 Jul 19 15:15 element-keys.txt

./models:
total 142M
-rw-r--r-- 1 root root 139M Jul 20 05:55 model.bin
-rw-r--r-- 1 root root 2.2M Jul 20 05:55 tokenizer.json
-rw-r--r-- 1 root root 450K Jul 20 05:55 vocabulary.txt
-rw-r--r-- 1 root root 2.3K Jul 20 05:55 config.json
-rw-r--r-- 1 root root    4 Jul 20 05:55 model.txt

./stt_db:
total 0

I also added some more logs to the code and can now be sure that it gets stuck in line 484 (resp = await self.client.login(password=self.password)). It never enters the following if not isinstance(resp, LoginResponse):

Any idea? Could it be a whitelisting problem or so? Bot and Matrix are on the same machine, should not be a problem I think..

Hi! Thanks for the quick reply. Model download worked just fine i think. I used "medium" and the model could be found in the dir. I tested again now with ` "model_size": "base"` and **without E2EE**. So my config and compose are identical to yours (except of URL and credentials of course). This is the log: ``` [+] Running 1/0 ✔ Container matrix-stt-bot Created 0.0s Attaching to matrix-stt-bot matrix-stt-bot | 2023-07-20 05:55:06,642 - INFO - Bot started! Downloading model.bin: 0%| | 0.00/145M [00:00<?, ?B/s] matrix-stt-bot | matrix-stt-bot | Downloading (…)88d7250a/config.json: 100%|██████████| 2.31k/2.31k [00:00<00:00, 5.22MB/s] matrix-stt-bot | matrix-stt-bot | matrix-stt-bot | 0a/vocabulary.txt: 0%| | 0.00/460k [00:00<?, ?B/s] matrix-stt-bot | Downloading model.bin: 14%|█▍ | 21.0M/145M [00:00<00:00, 151MB/s] Downloading model.bin: 36%|███▌ | 52.4M/145M [00:00<00:00, 196MB/s], ?B/s] matrix-stt-bot | matrix-stt-bot | Downloading (…)7250a/vocabulary.txt: 100%|██████████| 460k/460k [00:00<00:00, 1.62MB/s] Downloading model.bin: 58%|█████▊ | 83.9M/145M [00:00<00:00, 206MB/s] matrix-stt-bot | matrix-stt-bot | matrix-stt-bot | Downloading (…)7250a/tokenizer.json: 100%|██████████| 2.20M/2.20M [00:00<00:00, 4.57MB/s] matrix-stt-bot | matrix-stt-bot | Downloading model.bin: 79%|███████▉ | 115M/145M [00:00<00:00, 215MB/s] Downloading model.bin: 100%|██████████| 145M/145M [00:00<00:00, 214MB/s] Downloading model.bin: 100%|██████████| 145M/145M [00:00<00:00, 204MB/s] matrix-stt-bot | 2023-07-20 05:55:09,165 - INFO - Login via password ``` Here it gets stuck again. When going to the channel there is no response and it is saying that the bot is offline... This is my working dir: ``` ls -lShR .: total 72K -rw-r--r-- 1 admin 1007 24K Jul 19 14:55 bot.py drwxr-xr-x 2 root root 4.0K Jul 19 15:17 models drwxr-xr-x 2 root root 4.0K Jul 19 15:17 stt_db -rw-r--r-- 1 admin 1007 3.1K Jul 19 14:55 README.md -rw-r--r-- 1 admin 1007 1.3K Jul 19 14:55 send_message.py -rw-r--r-- 1 admin 1007 1.2K Jul 19 14:55 log.py -rw-r--r-- 1 admin 1007 1.1K Jul 19 14:55 LICENSE -rw-r--r-- 1 admin 1007 1.1K Jul 19 14:55 requirements.txt -rw-r--r-- 1 admin 1007 660 Jul 19 14:55 Dockerfile -rw-r--r-- 1 admin 1007 657 Jul 19 15:16 compose.yaml -rw-r--r-- 1 admin 1007 296 Jul 19 14:55 config.json.example -rw-r--r-- 1 admin 1007 227 Jul 20 05:59 config.json -rw-r--r-- 1 admin 1007 167 Jul 19 15:15 element-keys.txt ./models: total 142M -rw-r--r-- 1 root root 139M Jul 20 05:55 model.bin -rw-r--r-- 1 root root 2.2M Jul 20 05:55 tokenizer.json -rw-r--r-- 1 root root 450K Jul 20 05:55 vocabulary.txt -rw-r--r-- 1 root root 2.3K Jul 20 05:55 config.json -rw-r--r-- 1 root root 4 Jul 20 05:55 model.txt ./stt_db: total 0 ``` I also added some more logs to the code and can now be sure that it gets stuck in line 484 (`resp = await self.client.login(password=self.password)`). It never enters the following `if not isinstance(resp, LoginResponse):` Any idea? Could it be a whitelisting problem or so? Bot and Matrix are on the same machine, should not be a problem I think..
hibobmaster commented 2023-07-20 06:46:37 +00:00 (Migrated from github.com)

room_id correct? Try remove it.

{
    "homeserver": "https://matrix.MYDOMAIN.de",
    "user_id": "@botwhisper:MYDOMAIN.de",
    "password": "************",
    "device_id": "GMIAZSVFF",
    "model_size": "medium",
    "import_keys_path": "element-keys.txt",
    "import_keys_password": "************"
}
room_id correct? Try remove it. ```json { "homeserver": "https://matrix.MYDOMAIN.de", "user_id": "@botwhisper:MYDOMAIN.de", "password": "************", "device_id": "GMIAZSVFF", "model_size": "medium", "import_keys_path": "element-keys.txt", "import_keys_password": "************" } ```
jakobkilian commented 2023-07-20 06:53:24 +00:00 (Migrated from github.com)

already tried without room_id yes :( like so:

{
    "homeserver": "https://matrix.MYDOMAIN.de",
    "user_id": "@botwhisper:MYDOMAIN.de",
    "password": "************",
    "device_id": "GMIAZSVFF",
    "model_size": "base"
}
already tried without room_id yes :( like so: ````json { "homeserver": "https://matrix.MYDOMAIN.de", "user_id": "@botwhisper:MYDOMAIN.de", "password": "************", "device_id": "GMIAZSVFF", "model_size": "base" } ````
hibobmaster commented 2023-07-20 08:19:08 +00:00 (Migrated from github.com)

I just update dependencies, can you pull the latest image and try again?

I just update dependencies, can you pull the latest image and try again?
jakobkilian commented 2023-07-20 10:05:32 +00:00 (Migrated from github.com)

unfortunately I am still stuck at "INFO - Login via password"
I wonder how I could debug the login process further. I already double checked the credentials... If an connection from my local computer is possible it should be also possible from the same machine( the server) ...

unfortunately I am still stuck at "INFO - Login via password" I wonder how I could debug the login process further. I already double checked the credentials... If an connection from my local computer is possible it should be also possible from the same machine( the server) ...
hibobmaster commented 2023-07-20 10:42:28 +00:00 (Migrated from github.com)

Try using a new device id, such as FMIAZSVFF. Besides, you can debug the code easily if you have python environment.

  1. git clone https://github.com/hibobmaster/matrix-stt-bot
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python bot.py

f20b1d5d40/bot.py (L454-L468)

    # bot login
    async def login(self) -> None:
        if self.access_token is not None:
            logger.info("Login via access_token")
        else:
            logger.info("Login via password")
            try:
                resp = await self.client.login(password=self.password)
                if not isinstance(resp, LoginResponse):
                    logger.error("Login Failed")
                    print(f"Login Failed: {resp}")
                    sys.exit(1)
+                logger.info("Login Success")
            except Exception as e:
                logger.error(f"Error: {e}", exc_info=True)

or mount bot.py in container.

services:
  app:
    image: ghcr.io/hibobmaster/matrix-stt-bot:latest
    container_name: matrix-stt-bot
    restart: always
    # build:
    #   context: .
    #   dockerfile: ./Dockerfile
    # env_file:
    #   - .env
    volumes:
      # use env file or config.json
      - ./config.json:/app/config.json
      # use touch to create an empty file stt_db, for persist database only(first time only!!!)
      - ./stt_db:/app/db
      # import_keys path
      # - ./element-keys.txt:/app/element-keys.txt
      # store whisper models that program will download
      - ./models:/app/models
+      - ./bot.py:/app/bot.py
    networks:
      - matrix_network

networks:
  matrix_network:
Try using a new device id, such as `FMIAZSVFF`. Besides, you can debug the code easily if you have python environment. 1. git clone https://github.com/hibobmaster/matrix-stt-bot 2. python -m venv venv 3. source venv/bin/activate 4. pip install -r requirements.txt 5. python bot.py https://github.com/hibobmaster/matrix-stt-bot/blob/f20b1d5d40df65866cb9650856757ab223e61a9e/bot.py#L454-L468 ```diff # bot login async def login(self) -> None: if self.access_token is not None: logger.info("Login via access_token") else: logger.info("Login via password") try: resp = await self.client.login(password=self.password) if not isinstance(resp, LoginResponse): logger.error("Login Failed") print(f"Login Failed: {resp}") sys.exit(1) + logger.info("Login Success") except Exception as e: logger.error(f"Error: {e}", exc_info=True) ``` or mount `bot.py` in container. ```diff services: app: image: ghcr.io/hibobmaster/matrix-stt-bot:latest container_name: matrix-stt-bot restart: always # build: # context: . # dockerfile: ./Dockerfile # env_file: # - .env volumes: # use env file or config.json - ./config.json:/app/config.json # use touch to create an empty file stt_db, for persist database only(first time only!!!) - ./stt_db:/app/db # import_keys path # - ./element-keys.txt:/app/element-keys.txt # store whisper models that program will download - ./models:/app/models + - ./bot.py:/app/bot.py networks: - matrix_network networks: matrix_network: ```
jakobkilian commented 2023-07-20 14:40:02 +00:00 (Migrated from github.com)

Ok cool, got it working at least with the bot.py script (without docker):
I ran into issues with the dependencies first and then had to sudo chown -R admin:1007 * in the repo folder because the /model/ dir had root:root rights only and so I couldn't run bot.py without sudo.
After doing so I could run python bot.py and I could sucessfully transcribe messages.

sudo docker compose up however still doesn't work. Changing device_id had no effect. logger.info("Login Success") never gets called (as said before) it blocks at resp = await self.client.login(password=self.password)

I am not so experienced in docker. Maybe I need to do some network settings or so?

Ok cool, got it working at least with the bot.py script (without docker): I ran into issues with the dependencies first and then had to `sudo chown -R admin:1007 *` in the repo folder because the `/model/` dir had root:root rights only and so I couldn't run bot.py without `sudo`. After doing so I could run `python bot.py` and I could sucessfully transcribe messages. `sudo docker compose up` however still doesn't work. Changing device_id had no effect. `logger.info("Login Success")` never gets called (as said before) it blocks at `resp = await self.client.login(password=self.password)` I am not so experienced in docker. Maybe I need to do some network settings or so?
hibobmaster commented 2023-07-20 14:55:57 +00:00 (Migrated from github.com)

That's so weird. Can you provide your compose file and docker version?

That's so weird. Can you provide your compose file and docker version?
jakobkilian commented 2023-07-20 15:05:32 +00:00 (Migrated from github.com)

you mean the compose.yaml? Just like yours:

services:
  app:
    image: ghcr.io/hibobmaster/matrix-stt-bot:latest
    container_name: matrix-stt-bot
    restart: always
    # build:
    #   context: .
    #   dockerfile: ./Dockerfile
    # env_file:
    #   - .env
    volumes:
      # use env file or config.json
      - ./config.json:/app/config.json
      # use touch to create an empty file stt_db, for persist database only(first time only!!!)
      - ./stt_db:/app/db
      # import_keys path
      # - ./element-keys.txt:/app/element-keys.txt
      # store whisper models that program will download
      - ./models:/app/models
      - ./bot.py:/app/bot.py
    networks:
      - matrix_network

networks:
  matrix_network:

And the docker version: Docker version 24.0.4, build 3713ee1

This is my folder now, after the chown thing:

drwxr-xr-x 9 admin 1007 4.0K Jul 20 15:03 .
-rw-r--r-- 1 admin 1007 128K Jul 20 14:38 db
drwxr-xr-x 2 admin 1007 4.0K Jul 20 14:33 output
-rw-r--r-- 1 admin 1007  241 Jul 20 14:29 bot.log
drwxr-xr-x 3 admin 1007 4.0K Jul 20 14:29 models
drwxr-xr-x 6 admin 1007 4.0K Jul 20 14:25 venv
drwxr-xr-x 2 admin 1007 4.0K Jul 20 14:00 __pycache__
-rw-r--r-- 1 admin 1007  686 Jul 20 13:59 compose.yaml
-rw-r--r-- 1 admin 1007  23K Jul 20 13:58 bot.py
-rw-r--r-- 1 admin 1007  227 Jul 20 10:46 config.json
drwxr-xr-x 2 admin 1007 4.0K Jul 20 10:02 stt_db
-rw-r--r-- 1 admin 1007  296 Jul 20 10:02 config.json.example
-rw-r--r-- 1 admin 1007  660 Jul 20 10:02 Dockerfile
-rw-r--r-- 1 admin 1007  213 Jul 20 10:02 .dockerignore
-rw-r--r-- 1 admin 1007  227 Jul 20 10:02 .env.example
drwxr-xr-x 8 admin 1007 4.0K Jul 20 10:02 .git
drwxr-xr-x 3 admin 1007 4.0K Jul 20 10:02 .github
-rw-r--r-- 1 admin 1007 1.9K Jul 20 10:02 .gitignore
-rw-r--r-- 1 admin 1007 1.1K Jul 20 10:02 LICENSE
-rw-r--r-- 1 admin 1007 1.2K Jul 20 10:02 log.py
-rw-r--r-- 1 admin 1007 3.1K Jul 20 10:02 README.md
-rw-r--r-- 1 admin 1007  949 Jul 20 10:02 requirements.txt
-rw-r--r-- 1 admin 1007 1.3K Jul 20 10:02 send_message.py
drwxr-xr-x 3 admin 1007 4.0K Jul 20 10:02 ..

thanks for your patience!

you mean the compose.yaml? Just like yours: ```` services: app: image: ghcr.io/hibobmaster/matrix-stt-bot:latest container_name: matrix-stt-bot restart: always # build: # context: . # dockerfile: ./Dockerfile # env_file: # - .env volumes: # use env file or config.json - ./config.json:/app/config.json # use touch to create an empty file stt_db, for persist database only(first time only!!!) - ./stt_db:/app/db # import_keys path # - ./element-keys.txt:/app/element-keys.txt # store whisper models that program will download - ./models:/app/models - ./bot.py:/app/bot.py networks: - matrix_network networks: matrix_network: ```` And the docker version: `Docker version 24.0.4, build 3713ee1` This is my folder now, after the `chown` thing: ```` drwxr-xr-x 9 admin 1007 4.0K Jul 20 15:03 . -rw-r--r-- 1 admin 1007 128K Jul 20 14:38 db drwxr-xr-x 2 admin 1007 4.0K Jul 20 14:33 output -rw-r--r-- 1 admin 1007 241 Jul 20 14:29 bot.log drwxr-xr-x 3 admin 1007 4.0K Jul 20 14:29 models drwxr-xr-x 6 admin 1007 4.0K Jul 20 14:25 venv drwxr-xr-x 2 admin 1007 4.0K Jul 20 14:00 __pycache__ -rw-r--r-- 1 admin 1007 686 Jul 20 13:59 compose.yaml -rw-r--r-- 1 admin 1007 23K Jul 20 13:58 bot.py -rw-r--r-- 1 admin 1007 227 Jul 20 10:46 config.json drwxr-xr-x 2 admin 1007 4.0K Jul 20 10:02 stt_db -rw-r--r-- 1 admin 1007 296 Jul 20 10:02 config.json.example -rw-r--r-- 1 admin 1007 660 Jul 20 10:02 Dockerfile -rw-r--r-- 1 admin 1007 213 Jul 20 10:02 .dockerignore -rw-r--r-- 1 admin 1007 227 Jul 20 10:02 .env.example drwxr-xr-x 8 admin 1007 4.0K Jul 20 10:02 .git drwxr-xr-x 3 admin 1007 4.0K Jul 20 10:02 .github -rw-r--r-- 1 admin 1007 1.9K Jul 20 10:02 .gitignore -rw-r--r-- 1 admin 1007 1.1K Jul 20 10:02 LICENSE -rw-r--r-- 1 admin 1007 1.2K Jul 20 10:02 log.py -rw-r--r-- 1 admin 1007 3.1K Jul 20 10:02 README.md -rw-r--r-- 1 admin 1007 949 Jul 20 10:02 requirements.txt -rw-r--r-- 1 admin 1007 1.3K Jul 20 10:02 send_message.py drwxr-xr-x 3 admin 1007 4.0K Jul 20 10:02 .. ````` thanks for your patience!
hibobmaster commented 2023-07-20 15:10:08 +00:00 (Migrated from github.com)

I can't find what wrong with that. Try sudo docker compose down and rm -r models then sudo docker compose up.

If still no luck, you can run the bot in a screen session(~~~).

I can't find what wrong with that. Try `sudo docker compose down` and `rm -r models` then `sudo docker compose up`. If still no luck, you can run the bot in a screen session(~~~).
jakobkilian commented 2023-07-20 15:33:02 +00:00 (Migrated from github.com)

no sucess with compose down and up again.
You mean just use the .py as e.g. systemd service?

no sucess with compose down and up again. You mean just use the .py as e.g. systemd service?
hibobmaster commented 2023-07-20 15:57:41 +00:00 (Migrated from github.com)

You can write a systemd service or use screen or tmux to run bot in background.

You can write a systemd service or use screen or tmux to run bot in background.
hibobmaster commented 2023-07-21 00:48:38 +00:00 (Migrated from github.com)

Hi, we can debug it by adding a timeout for login step.
bot.py

    # bot login
    async def login(self) -> None:
        if self.access_token is not None:
            logger.info("Login via access_token")
        else:
            logger.info("Login via password")
            try:
+               # wait 5 seconds for login
+               resp = await asyncio.wait_for(self.client.login(password=self.password), 5.0)
                if not isinstance(resp, LoginResponse):
                    logger.error("Login Failed")
                    print(f"Login Failed: {resp}")
                    sys.exit(1)
+                logger.info("Login Success")
            except Exception as e:
                logger.error(f"Error: {e}", exc_info=True)
Hi, we can debug it by adding a timeout for login step. bot.py ```diff # bot login async def login(self) -> None: if self.access_token is not None: logger.info("Login via access_token") else: logger.info("Login via password") try: + # wait 5 seconds for login + resp = await asyncio.wait_for(self.client.login(password=self.password), 5.0) if not isinstance(resp, LoginResponse): logger.error("Login Failed") print(f"Login Failed: {resp}") sys.exit(1) + logger.info("Login Success") except Exception as e: logger.error(f"Error: {e}", exc_info=True) ```
hibobmaster commented 2023-07-21 05:06:25 +00:00 (Migrated from github.com)

During local debugging, I accidentally triggered the same issue, and magically, the program resumed responsiveness when I pressed the Enter key.

During local debugging, I accidentally triggered the same issue, and magically, the program resumed responsiveness when I pressed the Enter key.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: bobmaster/matrix-stt-bot#1
No description provided.