AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera
MIT License
1.17k stars 181 forks source link

[BUG] Allsky stopps completely working after creating timelapse #3679

Closed charira83 closed 2 months ago

charira83 commented 3 months ago

Environment

Bug Description

Here is an exmaple of the logfile: At 04:38 it is capturing a daytime image. Next entry is "Timelapse complete" at 08:27. After "INFO: nightday flow Complete..." allsky stopps working, no more log entries At 14:15:20 i restarted allsky manually via webbrowser

Jun 11 04:38:26 allsky-pi allsky[31134]: INFO: ----------------------- Running Module allsky_saveimage.py ----------------------- Jun 11 04:38:26 allsky-pi allsky[31134]: INFO: Attempting to load allsky_saveimage Jun 11 04:38:26 allsky-pi allsky[31134]: INFO: Image /home/harira/allsky/tmp/image-20240611043813.jpg Saved, quality 95 Jun 11 04:38:26 allsky-pi allsky[31134]: INFO: Ignoring watchdog for module saveimage Jun 11 04:38:26 allsky-pi allsky[31134]: INFO: day flow Complete... Jun 11 04:38:28 allsky-pi allsky[20337]: Executing sunwait poll exit angle -6.0000 52N 6.91E > /dev/null Jun 11 04:38:28 allsky-pi allsky[20337]: ----- Jun 11 04:38:28 allsky-pi allsky[20337]: STARTING EXPOSURE at: 2024-06-11 04:38:28 @ 2.8 sec Jun 11 04:38:28 allsky-pi allsky[20337]: > Running: libcamera-still --output '/home/harira/allsky/tmp/image-20240611043828.jpg' --timeout 1 --nopreview --width 4056 --height 3040 --shutter 2828427 --analoggain 1 --quality 100 Jun 11 08:27:51 allsky-pi allsky[29287]: endOfNight.sh: ===== Timelapse complete Jun 11 08:27:52 allsky-pi allsky[3406]: INFO: Loading config /home/harira/allsky/config/settings.json Jun 11 08:27:52 allsky-pi allsky[3406]: INFO: Running nightday flow... Jun 11 08:27:52 allsky-pi allsky[3406]: INFO: nightday flow Complete... Jun 12 14:15:20 allsky-pi allsky[20337]: /home/harira/allsky/bin/capture_RPi: Got SIGTERM to exit. Jun 12 14:15:20 allsky-pi allsky[20337]: Calling system(/home/harira/allsky/scripts/copy_notification_image.sh --expires 2 NotRunning &) Jun 12 14:15:23 allsky-pi allsky[20337]: Stopping AllSky Jun 12 14:15:29 allsky-pi allsky[6016]: Starting AllSky

Allsky.log.txt config.sh.txt

EricClaeys commented 3 months ago

This is the key entry in the log:

Jun 12 14:15:20 allsky-pi allsky[20337]: /home/harira/allsky/bin/capture_RPi: Got SIGTERM to exit.

That means some other program is telling Allsky to terminate. That will happen with sudo systemctl stop allsky but it's unlikely anything is executing that. It's possible Linux is killing Allsky - it will kill programs that are taking "too many" resources (CPU, memory). Next time it happens, try this:

cd /var/log
ls -lt * | head
grep "Got SIGTERM" allsky.log | tail -1

that will list the 10 most recently-changed log files as well as the last "SIGTERM" error from allsky.log. Look at the time of the SIGTERM error, then look in all the other log files that are newer than that time. For example, the error above is from June 12 at 14:15:20, so you'd look in all the other log files whose time is 14:15:20 or newer. One of those log files may have a message about killing Allsky. Sorry I can't tell you which file or what to search for - I can't access my Pi at the moment.

EricClaeys commented 2 months ago

@charira83, any update?

charira83 commented 2 months ago

Actually i'am still struggeling with this issue The entry "Got SIGTERM... " in the allsky log was actually at the time, when i stopped allsky processing via allsky Webserver.

I found out, it has to do with the creation of timelapse Videos. If i turn off timelapse creation, then everything works fine and no crashes at all.

In the /var/log/messages log of the Linux System there are no entrys for allsky at All.

In the Webserver config saving locations of timelapses etc. Is set to "local"

I have no clue, what could cause this Problem.

EricClaeys commented 2 months ago

@charira83, I'm not sure what this means:

In the Webserver config saving locations of timelapses etc. Is set to "local"

Could you please attach a screenshot?

Also, please do the following:

sudo systemctl stop allsky
sudo truncate -s 0 /var/log/allsky.log
# In the WebUI, set the Debug Level to 3

The next time Allsky stops, before restarting it, attach /var/log/allsky.log.

That log file should have what I need to figure out what's going on.

Are the timelapse files being created correctly and can you view them?

charira83 commented 2 months ago

"In the Webserver config saving locations of timelapses etc. Is set to "local" "- > i meant in the ftp-config file the saving locations are All "local" and the files are not saved in any external Servers etc.

I got it working now.

All i did was cropping the images and reducing the size of the timelapses to 1920x1080 Pixel. As i am using the raspberry Pi HQ Cam with 12MP, the timelapses creation perhaps took too much resources or was struggeling with the Video file in full Resolution.

EricClaeys commented 2 months ago

Closing - user resolved Issue.