YunoHost-Apps / archivist_ynh

GNU General Public License v3.0
13 stars 4 forks source link

"Not enough free space on…" : add more storage space info #48

Open lapineige opened 1 year ago

lapineige commented 1 year ago

I would like to suggest an improvement to the log message we receive by email.

First of all, error messages such as "Not enough free space on…" could be highlighted (using bold ?) to catch them immediately when reading the email.

Secondly, this "Not enough free space on…" error message could show how big the archive was meant to be, and maybe how much space is available on the targeted storage. That would help us diagnose this lack of space faster (and maybe detect any sudden drastic increase) to work on a workaround.

I guess it could be done by showing 1) Yunohost message about the final size of the backup 2) the result of df /storage/path command. I know how to implement the second improvement, but not the first one : how do you catch that log ?

maniackcrudelis commented 1 year ago

I @lapineige Are you sure you're not mixing a YunoHost backup message with an Archivist one ? I don't think I've ever implemented such a behavior in here.

lapineige commented 1 year ago

That's the result of archivist cron: email subject nice -n10 /opt/yunohost/archivist/archivist.sh | tee -a /var/log/archivist/archivist.log 2>&1

maniackcrudelis commented 1 year ago

Sure, but that log is mainly YunoHost backup output messages.

You're actually looking for the error message raise YunohostValidationError("not_enough_disk_space", path=self.repo), translated as Not enough free space on '{path}' which is part of YunoHost backup process.

lapineige commented 1 year ago

So what's in the email is the result of that command ?

maniackcrudelis commented 1 year ago

Yes, that's it, the email is the log of Archivist itself and all YNH backup command logs.

As far as I do like your suggestion on an improvement of that error message, this is on YunoHost core side. What's strange though is that it seems that it's already logged somewhere, since the line 1735 does says Not enough space at %s (free: %s / needed: %d). I've never had that error message myself, I couldn't say, but maybe in the debug log ?

Anyway, if not, it surely should be made more visible for the final user.

lapineige commented 1 year ago

As far as I do like your suggestion on an improvement of that error message, this is on YunoHost core side.

Yes. May I keep this open until I reach out to Yunohost core repository to discuss such a feature ?

maniackcrudelis commented 1 year ago

Yes. May I keep this open until I reach out to Yunohost core repository to discuss such a feature ?

Feel free :)