Cadair / matrix-appservice-hangouts

A prototype Matrix<->Hangouts appservice written in Python 3.6 using asyncio.
MIT License
12 stars 4 forks source link

Hangouts AS try to register user again after restart #9

Closed MurzNN closed 6 years ago

MurzNN commented 6 years ago

At first start - hangoutsas successfully register and bot @hangouts:domain.tld succesfully reply to messages, but after restart I always got the error:

2017-12-28 10:55:01,380 hangouts_as  ERROR    <ClientResponse(http://localhost:8008/_matrix/client/r0/register?access_token=<redacted>) [400 Bad Request]>                                                                  
<CIMultiDictProxy('Transfer-Encoding': 'chunked', 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization', 'Content-Encoding': 'gzip', 'Server': 'Synapse/0.24.1', 'Date': 'Thu, 28 Dec 2017 07:55:01 GMT', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', 'Content-Type': 'application/json')>                                                                                                     

2017-12-28 10:55:01,380 hangouts_as  ERROR    {'errcode': 'M_USER_IN_USE', 'error': 'User ID already taken.'}

After this bot accept messages, but not reply to them, in debug mode it show:

2017-12-28 10:54:43,051 hangouts_as  DEBUG                                                                                                                                                                                                        
Received Matrix Transaction:                                                                                                                                                                                                                      
         Event: m.room.message,                                                                                                                                                                                                                   
         User: @myuser:domain.tld,                                                                                                                                                                                                                  
         Room: !FxtUbGYiKKcsbRJoXC:domain.tld,                                                                                                                                                                                                       
         Content: {'body': 'login', 'msgtype': 'm.text'}                                                                                                                                                                                          

How can I fix it? As I understand, I must tell to AS that user is already created.

MurzNN commented 6 years ago

I have found the solution via setting fixed cache file in cache_path argument. After restart error 'M_USER_IN_USE' is repeating, but all other seems works well.