waha icon indicating copy to clipboard operation
waha copied to clipboard

[BUG][WEBJS] - WEBJS will appear in a state of suspended animation

Open HuangDaHui opened this issue 1 year ago • 12 comments

image In the WORKING state, the session cannot display the WhatsApp name and cannot send and receive messages normally. It needs to be stopped and started to return to normal. It seems to only appear in some sessions with a lot of dialogue. I haven’t gotten the relevant logs yet, so I’ll add them after they appear next time.

HuangDaHui avatar Sep 02 '24 06:09 HuangDaHui

Hi! Yes, it happens time to time, we're checking a way to see how to add some "health check" to restart a session automatically.. Yes, logs would help here a lot :pray:

What about screenshot btw, what does it show in this state?

patron:PRO

devlikepro avatar Sep 03 '24 06:09 devlikepro

Hi! Yes, it happens time to time, we're checking a way to see how to add some "health check" to restart a session automatically.. Yes, logs would help here a lot 🙏

What about screenshot btw, what does it show in this state?

patron:PRO

The frequency of occurrence is about once a day In this state, the screenshot is usually blank. I think if I can check whether it is normal through this interface, this problem can be solved. /api/sessions/{session}/me I'm thinking about how to implement automatic restart through existing interfaces

HuangDaHui avatar Sep 03 '24 06:09 HuangDaHui

is about once a day

Do you restart the container like every day at midnight? May be it'll help to solve all issues. Chrome + puppeter is pretty hard to maintain in long run thing... You can automate it by calling https://waha.devlike.pro/docs/how-to/observability/#restart-stop-server

POST /api/server/stop

the docker will restart it automaticly (if you provide --restart=always flag in docker run)

patron:PRO

devlikepro avatar Sep 03 '24 06:09 devlikepro

is about once a day

Do you restart the container like every day at midnight? May be it'll help to solve all issues. Chrome + puppeter is pretty hard to maintain in long run thing... You can automate it by calling https://waha.devlike.pro/docs/how-to/observability/#restart-stop-server

POST /api/server/stop

the docker will restart it automaticly (if you provide --restart=always flag in docker run)

patron:PRO

There is currently no restart every day. I will use this interface to try restarting every day to see if it can solve the problem.

HuangDaHui avatar Sep 03 '24 06:09 HuangDaHui

is about once a day

Do you restart the container like every day at midnight? May be it'll help to solve all issues. Chrome + puppeter is pretty hard to maintain in long run thing... You can automate it by calling https://waha.devlike.pro/docs/how-to/observability/#restart-stop-server

POST /api/server/stop

the docker will restart it automaticly (if you provide --restart=always flag in docker run)

patron:PRO

I understand that the server restarts every morning, but the problem still cannot be solved. I will open the stop and start functions to customers and let them operate on their own to solve the problem.

HuangDaHui avatar Sep 04 '24 09:09 HuangDaHui

is about once a day

Do you restart the container like every day at midnight? May be it'll help to solve all issues. Chrome + puppeter is pretty hard to maintain in long run thing... You can automate it by calling https://waha.devlike.pro/docs/how-to/observability/#restart-stop-server

POST /api/server/stop

the docker will restart it automaticly (if you provide --restart=always flag in docker run) patron:PRO

I understand that the server restarts every morning, but the problem still cannot be solved. I will open the stop and start functions to customers and let them operate on their own to solve the problem.

But it is still easy for the status to change to STARTING/FAILED after restarting, so I can only solve it by deleting and re-creating it. This should also be a problem

HuangDaHui avatar Sep 04 '24 09:09 HuangDaHui

I see, that's problem. Do you have any logs in the container after you started it and see FAILED sessions? That would help! Could you also tell a bit more about your setup - do you use file storage or mongodb one, do you use chrome or regular docker image? Where do you run WAHA (vps or your server) and how do you run the docker container?

I can only solve it by deleting and re-creating it.

In 2024.9 we've added the way to logout from the session, so you can logout without removing it (you'll need to rescan QR code tho, yes)

patron:PRO

devlikepro avatar Sep 05 '24 06:09 devlikepro

I see, that's problem. Do you have any logs in the container after you started it and see FAILED sessions? That would help! Could you also tell a bit more about your setup - do you use file storage or mongodb one, do you use chrome or regular docker image? Where do you run WAHA (vps or your server) and how do you run the docker container?

I can only solve it by deleting and re-creating it.

In 2024.9 we've added the way to logout from the session, so you can logout without removing it (you'll need to rescan QR code tho, yes)

patron:PRO

I always forget to collect logs I use mongodb storage I don't quite understand. Does chrome need to install another docker image? I'm running WAHA on my own liunx server docker run -it -p 3000: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 Would providing these be helpful?

HuangDaHui avatar Sep 05 '24 06:09 HuangDaHui

Does chrome need to install another docker image?

Yes, https://waha.devlike.pro/docs/how-to/engines/#docker-images

devlikeapro/waha-plus:chrome	

I use mongodb storage

Could it be because of the fact you're using more then one worker? https://github.com/devlikeapro/waha/issues/525 Or in this case mongodb is used for a single worker?

patron:PRO

devlikepro avatar Sep 05 '24 06:09 devlikepro

Does chrome need to install another docker image?

Yes, https://waha.devlike.pro/docs/how-to/engines/#docker-images

devlikeapro/waha-plus:chrome	

I use mongodb storage

Could it be because of the fact you're using more then one worker? #525 Or in this case mongodb is used for a single worker?

patron:PRO devlikeapro/waha-plus:chrome I'll try this image Currently, a MongoDB corresponds to a WEBJS docker container and a NOWEB docker container. The sessions in them are different. I wonder if this will affect it?

HuangDaHui avatar Sep 05 '24 06:09 HuangDaHui

Currently, a MongoDB corresponds to a WEBJS docker container and a NOWEB docker container. The sessions in them are different. I wonder if this will affect it?

In this setup that's fine :thinking: It could affect if you'd use 2 WEBJS with the same mongodb

patron:PRO

devlikepro avatar Sep 06 '24 06:09 devlikepro

Currently, a MongoDB corresponds to a WEBJS docker container and a NOWEB docker container. The sessions in them are different. I wonder if this will affect it?

In this setup that's fine 🤔 It could affect if you'd use 2 WEBJS with the same mongodb

patron:PRO

Yes, I tried it, the webhook will push repeatedly

HuangDaHui avatar Sep 06 '24 06:09 HuangDaHui