NetWorker: dbgcommand fails with "Cannot Open Temporary File '/nsr/tmp/lgdbg.tmp'"
Résumé: The dbgcommand fails with "Cannot open temporary file '/nsr/tmp/lgdbg.tmp'" when not logged in as root. Use su [Substitute User] or sudo [Super User Do] to run the command.
Symptômes
Identified Issue
The dbgcommand fails when not logged in as root.
Cannot open temporary file '/nsr/tmp/lgdbg.tmp'.
Error Message
The error message indicates that the dbgcommand cannot open a temporary file.
[USERNAME@HOSTNAME logs]$ dbgcommand -n nsrsnmd Debug=1 Process ID List : 2454232 Processing PID:2454232 Cannot open temporary file '/nsr/tmp/lgdbg.tmp'.
Cause
Root Cause of the Issue
The root cause of the issue is that the dbgcommand fails when not run as the root user.
This is due to the dbgcommand attempting to access a temporary file '/nsr/tmp/lgdbg.tmp' which it cannot open when run by a non-root username.
Specific Conditions
The issue arises when the dbgcommand is performed from a username without root privileges.
Relevant Error Messages
The error message "Cannot open temporary file '/nsr/tmp/lgdbg.tmp'" is a key indicator of the root cause of the issue.
Also, when the user tries to run the command with sudo, the error message when not on the sudo list
$ sudo dbgcommand -n nsrsnmd Debug=1
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for DELLEMC:
DELLEMC is not in the sudoers file. This incident will be reported.Résolution
To resolve the issue, run the dbgcommand with elevated privileges using the su or sudo command.
$ whoami $ su - Password: # dbgcommand -n nsrsnmd Debug=1
Alternatively, if the user is on the sudo'ers list, the user can use the sudo command to run the dbgcommand.
$ sudo dbgcommand -n nsrsnmd Debug=1
Verifying the Resolution
After running the dbgcommand with elevated privileges, verify that the issue has been resolved by checking the output of the command. Also by reviewing the daemon log with nsr_render_log for the message "nsrsnmd SYSTEM notice Changing Debug level from 0 to 1"