A
A
accountnujen2021-12-10 02:54:26
PHP
accountnujen, 2021-12-10 02:54:26

How to find out what caused a php script to loop?

On my server there is a php file, which contains the conditions:
if the webhook is from telegram, then some actions
if the request is from systemd, then other actions the

task of the php file is this: make a request to the ip-camera and find out if there are new videos on the SD card records.
In the case of systemd, it stupidly checks every 10 minutes for 10-minute time slices.
In the case of the webhook, it looks for videos on given dates that I sent to the bot.

16:05 I get a message with a new video that was discovered thanks to systemd
16:07 I send a message to the bot "period 12/09/2021 9:00:00 - 12/09/2021 16:20:00"
16:07 Bot says found 5 videos and house starts...
2 videos are sent,
then the message "Found 5 videos" arrives again
3 more videos are
sent Again the message "Found 5 videos"
And again...

In total I received 37 identical videos. Then just cut down apache. It seems to me that he could do this forever

Logs ...
journalctl --since "2021-12-9 16:00:00"
showed me only systemd execution on schedule

error.txt from apache2
did not show any errors at all for that period of time

access .txt from apache2

91.108.6.143 - - [09/Dec/2021:16:07:14 +0300] "POST /cam/globalcam.php HTTP/1.1" 200 5644
91.108.6.143 - - [09/Dec/2021:16:08:14 +0300] "POST /cam/globalcam.php HTTP/1.1" 200 5644
91.108.6.143 - - [09/Dec/2021:16:10:20 +0300] "POST /cam/globalcam.php HTTP/1.1" 200 5853
91.108.6.143 - - [09/Dec/2021:16:09:16 +0300] "POST /cam/globalcam.php HTTP/1.1" 200 5645
91.108.6.143 - - [09/Dec/2021:16:11:28 +0300] "POST /cam/globalcam.php HTTP/1.1" 200 5972
91.108.6.143 - - [09/Dec/2021:16:13:46 +0300] "-" 408 4492
91.108.6.143 - - [09/Dec/2021:16:15:16 +0300] "-" 408 4492
91.108.6.143 - - [09/Dec/2021:16:13:56 +0300] "POST /cam/globalcam.php HTTP/1.1" 200 5942
91.108.6.143 - - [09/Dec/2021:16:15:36 +0300] "-" 408 4492


Actually, I would like to know: what was it? Why did I get so many identical requests from telegram ip?
Could it be that the request from the cart was only 1, but apache took it differently? Or there can be no errors in the logs and is telegram crazy?
Now I send the bot "period 09.12.2021 09:00:00 - 10.12.2021 16:20:00"
in response, he sends me 12 vidos and that's it. There are no strange cycles. Request from cart 1.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-12-10
@accountnujen

In webhook mode, Telegram repeats the message once a minute until it receives a response with a "200 OK" status.
If your script does not fit in a minute, then messages will come constantly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question