auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
231 stars 37 forks source link

job ran but did not complete successfully #49

Closed dm9tr0 closed 1 year ago

dm9tr0 commented 1 year ago

Hi! Could you add some kind of explanation or advice as comment in code or in notification, what user should do after such message? job ran but did not complete successfully It is really unclear now how to fix it:

image

When I executed your script from console I can see:

No sync is in progress.
The 63% of the array is not scrubbed.
No file has a zero sub-second timestamp.
No rehash is in progress or needed.
DANGER! In the array there are 2 errors!

They are from block 15575536 to 15575538, specifically at blocks: 15575536 15575538

To fix them use the command 'snapraid -e fix'.
The errors will disappear from the 'status' at the next 'scrub' command.

I will try to execute snapraid -e fix but would be great to have this in notification.

auanasgheps commented 1 year ago

Hi, if you look at the email or full log, it will tell what didn't work.

It's hard for the script to detect the exact reason of an error within a specific SnapRAID job. What I can easily do, however, is add a message to check your logs to this short message that is sent to Telegram/Discord.

dm9tr0 commented 1 year ago

Yes, I can see here 2 solutions:

  1. Simple one: as you proposed - just add extra line to telegram notification, at least to check full log.
  2. Complex: parse output of the script, if there is 'Danger' text present - get it (by regex) and past to telegram notification. But need time for debug it, I know how it is complicated.

Also, noticed that it is DANGER, not just WARNING as script sends.

auanasgheps commented 1 year ago

It requires regex and we don't know all possible errors. For the time being I will add the easy fix

auanasgheps commented 1 year ago

This is what I added, for both Sync and Scrub.

It ain't much, but it's better than nothing.

image

Now available in the dev branch. Are marked as "Severe Warning", but "Danger" might be better.

auanasgheps commented 1 year ago

Closing since the proposed fix has been implemented (in dev branch for now)