Closed HuangDaHui closed 3 weeks ago
This is an accidental phenomenon. Normally, it will automatically change to WORKING after a few seconds of STARTING.
Also, I would like to ask if it is possible to turn off the automatic restart of noweb?
version 2024.10.1
Suddenly a large batch changed to the failed state, and returned to normal after restarting.
I would like to ask if it is possible to turn off the automatic restart of noweb?
You need to remove
WHATSAPP_RESTART_ALL_SESSIONS
from the environemnt variablesHi,I deleted the WHATSAPP_RESTART_ALL_SESSIONS environment variable, will this have any impact on NOWEB? I think your design like this must be useful
@HuangDaHui could you try to add WAHA_AUTO_START_DELAY_SECONDS=1
environment variable?
The issue likely because all sessions starts at once (almost), but with 1 seconds delay it can help slowly run them one by one to avoid such issues.
If there's something in logs right after the start, it'd help us as well :pray:
@HuangDaHui could you try to add
WAHA_AUTO_START_DELAY_SECONDS=1
environment variable? The issue likely because all sessions starts at once (almost), but with 1 seconds delay it can help slowly run them one by one to avoid such issues.If there's something in logs right after the start, it'd help us as well 🙏
ok let me try I deleted the WHATSAPP_RESTART_ALL_SESSIONS environment variable, will this have any impact on NOWEB? I think your design like this must be useful
Could it be related to MongoDB? I have another container with relatively few sessions, and this never seems to happen.
I would like to ask if it is possible to turn off the automatic restart of noweb?
You need to remove
WHATSAPP_RESTART_ALL_SESSIONS
from the environemnt variablesDeleting it seems to have no effect. It still turns into starting in large batches and cannot be started. I don’t know why?
Soon after this happens, the container will exit on its own and I need to re-docker start id
@HuangDaHui Do you use a single MongoDB with multiple WAHA workers by any change? Lioke multiple docker container but with the same MONGO_URL string? If yes - you need to setup WAHA_WORKER_ID=waha{ID}
for each container (unique one)
Could you try to add WAHA_WORKER_RESTART_SESSIONS=False
- in this case after restart all sessions will be stopped
@HuangDaHui Do you use a single MongoDB with multiple WAHA workers by any change? Lioke multiple docker container but with the same MONGO_URL string? If yes - you need to setup
WAHA_WORKER_ID=waha{ID}
for each container (unique one)Could you try to add
WAHA_WORKER_RESTART_SESSIONS=False
- in this case after restart all sessions will be stopped
Yes, 2 containers use the same MongoDB, 1 NOWEB and 1 WEBJS Is this the reason that causes the problem?
@HuangDaHui Do you use a single MongoDB with multiple WAHA workers by any change? Lioke multiple docker container but with the same MONGO_URL string? If yes - you need to setup
WAHA_WORKER_ID=waha{ID}
for each container (unique one)Could you try to add
WAHA_WORKER_RESTART_SESSIONS=False
- in this case after restart all sessions will be stopped
docker run -it -p 15101:3000/tcp --restart=always -e "WAHA_WORKER_ID=waha15101" -e "WHATSAPP_DEFAULT_ENGINE=NOWEB" -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://192.168.18.170:27018/ -e WHATSAPP_FILES_LIFETIME=0 -e WHATSAPP_RESTART_ALL_SESSIONS=True -e WAHA_AUTO_START_DELAY_SECONDS=1 devlikeapro/waha-plus Is this okay?
No matter how I configure it, it always becomes starting and I don't know how to fix it
throw er; // Unhandled 'error' event
^
Error: Opening handshake has timed out
at ClientRequest.
Is this useful?
Will it have any impact if I run 2 MongoDB containers in docker? They use different ports
The same is NOWEB, mongodb://192.168.18.170:27017. When using this MongoDB, everything is normal, but when using this MongoDB, it often gets stuck. mongodb://192.168.18.170:27018/
I run 2 MongoDB containers in docker
Fine if it's NOWEB and WEBJS (different engines)
`--WEBJS docker run -it -p 15000:3000/tcp --restart=always -e "WHATSAPP_DEFAULT_ENGINE=WEBJS" -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://192.168.18.170:27017/ -e WHATSAPP_FILES_LIFETIME=0 -e WHATSAPP_RESTART_ALL_SESSIONS=True devlikeapro/waha-plus:chrome
docker run -it -p 15001:3000/tcp --restart=always -e "WHATSAPP_DEFAULT_ENGINE=WEBJS" -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://192.168.18.170:27018/ -e WHATSAPP_FILES_LIFETIME=0 -e WHATSAPP_RESTART_ALL_SESSIONS=True devlikeapro/waha-plus:chrome
--NOWEB docker run -it -p 15100:3000/tcp --restart=always -e "WHATSAPP_DEFAULT_ENGINE=NOWEB" -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://192.168.18.170:27017/ -e WHATSAPP_FILES_LIFETIME=0 -e WHATSAPP_RESTART_ALL_SESSIONS=True devlikeapro/waha-plus
docker run -it -p 15101:3000/tcp --restart=always -e "WHATSAPP_DEFAULT_ENGINE=NOWEB" -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://192.168.18.170:27018/ -e WHATSAPP_FILES_LIFETIME=0 -e WHATSAPP_RESTART_ALL_SESSIONS=True -e WAHA_AUTO_START_DELAY_SECONDS=1 devlikeapro/waha-plus`
This is the command I currently use to run WAHA. I don’t know if there is anything that needs to be adjusted. Everything is normal with NOWEB at port 15100:3000, and everything is normal with WEBJS. NOWEB with only port 15101:3000 often gets stuck and the container exits.
In addition, I would like to ask if it is possible not to restart if the sessions are in the scan qr code state? Because I think it doesn't make sense, restarting just takes up resources
@HuangDaHui Do you use a single MongoDB with multiple WAHA workers by any change? Lioke multiple docker container but with the same MONGO_URL string? If yes - you need to setup
WAHA_WORKER_ID=waha{ID}
for each container (unique one)Could you try to add
WAHA_WORKER_RESTART_SESSIONS=False
- in this case after restart all sessions will be stopped
Hello, WAHA_WORKER_ID=waha{ID} After setting the ID, multiple NOWEBs can use the same MongoDB, right?
After setting the ID, multiple NOWEBs can use the same MongoDB, right?
Yes and make sure to set WHATSAPP_RESTART_ALL_SESSIONS=False
as well.
Do not run the same session on two workers, no protection for it right now. On two NOWEB workers you'll see "STOPPED" sessions from the different worker
Here's example for docker-compose https://github.com/devlikeapro/waha/blob/core/docker-compose/docker-compose.workers.yaml
After setting the ID, multiple NOWEBs can use the same MongoDB, right?
Yes and make sure to set
WHATSAPP_RESTART_ALL_SESSIONS=False
as well. Do not run the same session on two workers, no protection for it right now. On two NOWEB workers you'll see "STOPPED" sessions from the different workerHere's example for docker-compose https://github.com/devlikeapro/waha/blob/core/docker-compose/docker-compose.workers.yaml
OK, thank you
NOWEB will remain in the STARTING state after automatic restart. It requires manual ReStart to change to WORKING.