Page MenuHomeVyOS Platform

salt-minion fails to start due to permission error accessing /root/.salt/minion.log
Closed, ResolvedPublicBUG

Description

Am unsure why vyos-1.3-rolling-202012271303 is doing this, but it appears that the salt-minion process is trying to log to /root/.salt/minion.log which it doesn't have permission to do:

Dec 27 20:04:12 gunn salt-minion[28935]: During handling of the above exception, another exception occurred:
Dec 27 20:04:12 gunn salt-minion[28935]: Traceback (most recent call last):
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
Dec 27 20:04:12 gunn salt-minion[28935]:     self.run()
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
Dec 27 20:04:12 gunn salt-minion[28935]:     self._target(*self._args, **self._kwargs)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/scripts.py", line 153, in minion_process
Dec 27 20:04:12 gunn salt-minion[28935]:     minion.start()
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/cli/daemons.py", line 343, in start
Dec 27 20:04:12 gunn salt-minion[28935]:     self._real_start()
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/cli/daemons.py", line 355, in _real_start
Dec 27 20:04:12 gunn salt-minion[28935]:     self.minion.tune_in()
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/minion.py", line 1179, in tune_in
Dec 27 20:04:12 gunn salt-minion[28935]:     self.io_loop.start()
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/ext/tornado/ioloop.py", line 837, in start
Dec 27 20:04:12 gunn salt-minion[28935]:     self._run_callback(timeout.callback)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/ext/tornado/ioloop.py", line 624, in _run_callback
Dec 27 20:04:12 gunn salt-minion[28935]:     self.handle_callback_exception(callback)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/ext/tornado/ioloop.py", line 640, in handle_callback_exception
Dec 27 20:04:12 gunn salt-minion[28935]:     app_log.error("Exception in callback %r", callback, exc_info=True)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/__init__.py", line 1412, in error
Dec 27 20:04:12 gunn salt-minion[28935]:     self._log(ERROR, msg, args, **kwargs)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3/dist-packages/salt/_logging/impl.py", line 310, in _log
Dec 27 20:04:12 gunn salt-minion[28935]:     stack_info=stack_info,
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/__init__.py", line 1519, in _log
Dec 27 20:04:12 gunn salt-minion[28935]:     self.handle(record)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/__init__.py", line 1529, in handle
Dec 27 20:04:12 gunn salt-minion[28935]:     self.callHandlers(record)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/__init__.py", line 1591, in callHandlers
Dec 27 20:04:12 gunn salt-minion[28935]:     hdlr.handle(record)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/__init__.py", line 905, in handle
Dec 27 20:04:12 gunn salt-minion[28935]:     self.emit(record)
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/handlers.py", line 478, in emit
Dec 27 20:04:12 gunn salt-minion[28935]:     self.reopenIfNeeded()
Dec 27 20:04:12 gunn salt-minion[28935]:   File "/usr/lib/python3.7/logging/handlers.py", line 457, in reopenIfNeeded
Dec 27 20:04:12 gunn salt-minion[28935]:     sres = os.stat(self.baseFilename)
Dec 27 20:04:12 gunn salt-minion[28935]: PermissionError: [Errno 13] Permission denied: '/root/.salt/minion.log'

There is already a directory /var/log/salt - I'm guessing a config file hasn't been picked up and it's spamming into /root instead?

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling-202012271303
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Infrastructure issue or change

Event Timeline

PR https://github.com/vyos/vyos-1x/pull/683

Fix location for the minion log file.
It should be in " /var/log/salt/minion"

c-po changed the task status from Open to Needs testing.Jan 15 2021, 4:12 PM
c-po added a subscriber: c-po.

Backported to equuleus branch

Fixed, VyOS 1.3-beta-202101160442
@maznu Can you re-check that all work as expected?

erkin set Issue type to Infrastructure issue or change.Aug 29 2021, 11:51 AM
erkin removed a subscriber: Active contributors.