-
-
Notifications
You must be signed in to change notification settings - Fork 268
Show last programs messages in Error function (related to issue1875) #1877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show last programs messages in Error function (related to issue1875) #1877
Conversation
|
As always sleeping over it improved things. With my recent commit Reason: How it looks now on my SLES12 test system when I reproduce it as in # usr/sbin/rear -v mkrescue ... ERROR: Failed to create 'f144' directory under the mounted network filesystem share Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 10:21:53.338473069 Including output/default/200_make_prefix_dir.sh mkdir: cannot create directory '/tmp/rear.Fq7nrzQfe1XCa5k/outputfs/f144': Permission denied Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 15436) and its descendant processes |
|
Things can look bad in debugscripts mode (e.g. |
…or function or Error function with multi line messages (related to issue1875)
|
With my latest commit To simulate BugError I changed in output/default/200_make_prefix_dir.sh Error "Failed to create ... to BugError "Failed to create ... and now things look for me in debugscripts mode # usr/sbin/rear -D mkrescue ... ERROR: ==================== BUG in /root/rear.github.master/usr/share/rear/output/default/200_make_prefix_dir.sh line 21: 'Failed to create 'f144' directory under the mounted network filesystem share' -------------------- Please report this issue at https://github.com/rear/rear/issues and include the relevant parts from /root/rear.github.master/var/log/rear/rear-f144.log preferably with full debug information via 'rear -d -D mkrescue' ==================== Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 11:45:33.831619017 Including output/default/200_make_prefix_dir.sh 2018-07-24 11:45:33.832337303 Entering debugscripts mode via 'set -x'. mkdir: cannot create directory '/tmp/rear.tfltIJJxkoVkovD/outputfs/f144': Permission denied 2018-07-24 11:45:33.842322685 Aborting ReaR with 'BugError' Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 3114) and its descendant processes versus the same but only in verbose mode # usr/sbin/rear -v mkrescue ... ERROR: ==================== BUG in /root/rear.github.master/usr/share/rear/output/default/200_make_prefix_dir.sh line 21: 'Failed to create 'f144' directory under the mounted network filesystem share' -------------------- Please report this issue at https://github.com/rear/rear/issues and include the relevant parts from /root/rear.github.master/var/log/rear/rear-f144.log preferably with full debug information via 'rear -d -D mkrescue' ==================== Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 11:53:30.802518432 Including output/default/200_make_prefix_dir.sh mkdir: cannot create directory '/tmp/rear.RC3tVKoTWEZrYUo/outputfs/f144': Permission denied 2018-07-24 11:53:30.808719247 Aborting ReaR with 'BugError' Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 17520) and its descendant processes For comparison how it looks with the normal Error function # usr/sbin/rear -D mkrescue ERROR: Failed to create 'f144' directory under the mounted network filesystem share Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 11:55:24.880196127 Including output/default/200_make_prefix_dir.sh 2018-07-24 11:55:24.880900120 Entering debugscripts mode via 'set -x'. mkdir: cannot create directory '/tmp/rear.7Y43tAf2vYYRpC5/outputfs/f144': Permission denied 2018-07-24 11:55:24.890792247 Aborting ReaR ... Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 10529) and its descendant processes versus in verbose mode # usr/sbin/rear -v mkrescue ... ERROR: Failed to create 'f144' directory under the mounted network filesystem share Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 11:55:02.128570054 Including output/default/200_make_prefix_dir.sh mkdir: cannot create directory '/tmp/rear.MiPGSPlP7eVdqZG/outputfs/f144': Permission denied 2018-07-24 11:55:02.134746653 Aborting ReaR ... Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 30216) and its descendant processes |
|
@rear/contributors As far as I see there cannot be real regressions because |
|
It still does not work as expected when the Error function Error "Failed to create '$OUTPUT_PREFIX' directory under the mounted network filesystem share" I think I have already a fix which is even simpler than before... |
…e of BugError or Error function with multi line messages (related to issue1875)
|
Now also when the Error function is called with a multi line error message like Error "Failed to create '$OUTPUT_PREFIX' directory under the mounted network filesystem share" things really look o.k. to me (excerpts): # usr/sbin/rear -D mkrescue ... ERROR: Failed to create 'f144' directory under the mounted network filesystem share Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 15:30:51.010132470 Including output/default/200_make_prefix_dir.sh 2018-07-24 15:30:51.010883541 Entering debugscripts mode via 'set -x'. mkdir: cannot create directory '/tmp/rear.S1FLxksxiNyjV17/outputfs/f144': Permission denied Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 12483) and its descendant processes and normally # usr/sbin/rear mkrescue ... ERROR: Failed to create 'f144' directory under the mounted network filesystem share Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 15:31:38.065558308 Including output/default/200_make_prefix_dir.sh mkdir: cannot create directory '/tmp/rear.UagwIJeXk6aRQYa/outputfs/f144': Permission denied Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details and when the BugError function is called with a multi line error message like BugError "Failed to create '$OUTPUT_PREFIX' directory under the mounted network filesystem share" in debugscripts mode # usr/sbin/rear -D mkrescue ... ERROR: ==================== BUG in /root/rear.github.master/usr/share/rear/output/default/200_make_prefix_dir.sh line 24: 'Failed to create 'f144' directory under the mounted network filesystem share' -------------------- Please report this issue at https://github.com/rear/rear/issues and include the relevant parts from /root/rear.github.master/var/log/rear/rear-f144.log preferably with full debug information via 'rear -d -D mkrescue' ==================== Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 15:46:37.805607004 Including output/default/200_make_prefix_dir.sh 2018-07-24 15:46:37.806297048 Entering debugscripts mode via 'set -x'. mkdir: cannot create directory '/tmp/rear.cCGS59mJ19jHjqw/outputfs/f144': Permission denied Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details Exiting rear mkrescue (PID 1670) and its descendant processes and normally # usr/sbin/rear mkrescue ... ERROR: ==================== BUG in /root/rear.github.master/usr/share/rear/output/default/200_make_prefix_dir.sh line 24: 'Failed to create 'f144' directory under the mounted network filesystem share' -------------------- Please report this issue at https://github.com/rear/rear/issues and include the relevant parts from /root/rear.github.master/var/log/rear/rear-f144.log preferably with full debug information via 'rear -d -D mkrescue' ==================== Some latest log messages from the last called script 200_make_prefix_dir.sh: 2018-07-24 15:47:22.591618565 Including output/default/200_make_prefix_dir.sh mkdir: cannot create directory '/tmp/rear.muztRiXoBDhGYUn/outputfs/f144': Permission denied Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details |
|
I will sleep over it and |
|
As always sleeping over it one more time improved things one more time. Still not working as good as I like it because sometimes Error or BugError I think I have already a fix which is not simpler but more straightforward than before... |
… and not only for a whatever-functions.sh (related to issue1875)
|
By the way I also simplified all 'rear -d -D ...' to 'rear -D ...' |
|
How an Error from the mount_url function in lib/global-functions.sh looks now: # usr/sbin/rear -D mkrescue
...
ERROR: Mount command 'mount -v -o nfsvers=3,nolock /dev/disk/by-label/REAR-000 /tmp/rear.GWJdRzPCWRMr5QM/outputfs' failed.
Some latest log messages since the last called script 060_mount_NETFS_path.sh:
mkdir: created directory '/tmp/rear.GWJdRzPCWRMr5QM/outputfs'
2018-07-25 12:53:23.956582779 Added 'rmdir -v /tmp/rear.GWJdRzPCWRMr5QM/outputfs >&2' as an exit task
2018-07-25 12:53:23.959343177 Mounting with 'mount -v -o nfsvers=3,nolock /dev/disk/by-label/REAR-000 /tmp/rear.GWJdRzPCWRMr5QM/outputfs'
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-f144.log for details
FYI: OUTPUT=USB USB_DEVICE=/dev/disk/by-label/REAR-000 BACKUP_URL=usb:///dev/disk/by-label/REAR-000 USB_SUFFIX="mybackups" BACKUP=NETFS BACKUP_OPTIONS="nfsvers=3,nolock" |
|
Sleeping over it the third time did not produce further improvement ideas |
Use Error instead of StopIfError which is problematic for several reasons (see the comments near its definition). Error also shows last error messages from the failed commands. Analogous to changes in PR rear#1877.
Use Error instead of StopIfError which is problematic for several reasons (see the comments near its definition). Error also shows last error messages from the failed commands. Analogous to changes in PR rear#1877.
Use Error instead of StopIfError which is problematic for several reasons (see the comments near its definition). Error also shows last error messages from the failed commands. Analogous to changes in PR rear#1877.
Type: Enhancement
Impact: Low
Reference to related issue (URL):
mkdir: cannot create directory '/tmp/rear.aOAII02mqnI8cRX/outputfs/TestUbuntu': Permission denied #1875 (comment)
and subsequent comment
How was this pull request tested?
By me as in mkdir: cannot create directory '/tmp/rear.aOAII02mqnI8cRX/outputfs/TestUbuntu': Permission denied #1875 (comment)
Brief description of the changes in this pull request:
Now the
Errorfunction shows the last 5 lines of stdout and stderr messagesof the called programs on the user's terminal that should hopefully
make the root cause of an error exit more obvious to the user
without the need to analyze the log file in any case.
Additionally I adapted output/default/200_make_prefix_dir.sh
to provide a better Error function text that now talks about
Failed to create ... directory under the mounted network filesystem share.How it looks on my SLES12 test system when I reproduce it as in
#1875 (comment)