Missing initial manifest returns into traceback #126

Closed
opened 2021-11-20 13:24:21 +00:00 by ungleich-gitea · 3 comments

Created by: telmich

Clearly, we should only output the error message, not a traceback

`[9:48] manager:~% cdist config -vvbj6 -p6 router1.place6.ungleich.ch router2.place6.ungleich.ch
VERBOSE: cdist: version 4.8.0-18-g44673131
WARNING: [26854]: router2.place6.ungleich.ch: Could not derive host_name for router2.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host
WARNING: [26853]: router1.place6.ungleich.ch: Could not derive host_name for router1.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host
INFO: [26853]: router1.place6.ungleich.ch: Starting configuration run
INFO: [26854]: router2.place6.ungleich.ch: Starting configuration run
VERBOSE: [26854]: router2.place6.ungleich.ch: Running global explorers
VERBOSE: [26853]: router1.place6.ungleich.ch: Running global explorers
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/nico/vcs/cdist/cdist/config.py", line 431, in run
self.manifest.run_initial_manifest(self.local.initial_manifest)
File "/home/nico/vcs/cdist/cdist/core/manifest.py", line 152, in run_initial_manifest
raise NoInitialManifestError(initial_manifest, user_supplied)
cdist.core.manifest.NoInitialManifestError: 'Initial manifest missing: /tmp/tmp00grz_78/f9e7b5d8cf331963f92e3dc240158fb4/data/conf/manifest/init'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/nico/vcs/cdist/cdist/config.py", line 391, in onehost
c.run()
File "/home/nico/vcs/cdist/cdist/config.py", line 436, in run
stderr_path, e)
cdist.InitialManifestError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/home/nico/vcs/cdist/cdist/config.py", line 395, in onehost
log.error(e)
File "/usr/lib/python3.6/logging/init.py", line 1335, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/lib/python3.6/logging/init.py", line 1442, in _log
self.handle(record)
File "/usr/lib/python3.6/logging/init.py", line 1451, in handle
if (not self.disabled) and self.filter(record):
File "/home/nico/vcs/cdist/cdist/log.py", line 87, in filter
record.msg = self.name + ": " + str(record.msg)
File "/home/nico/vcs/cdist/cdist/init.py", line 118, in str
output.append(self.stderr + '\n')
File "/home/nico/vcs/cdist/cdist/init.py", line 100, in stderr
if os.path.getsize(stderr_path) > 0:
File "/usr/lib/python3.6/genericpath.py", line 50, in getsize
return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp00grz_78/f9e7b5d8cf331963f92e3dc240158fb4/data/stderr/init'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 79, in
commandline()
File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 56, in commandline
args.func(args)
File "/home/nico/vcs/cdist/cdist/config.py", line 273, in commandline
jobs=args.parallel)
File "/home/nico/vcs/cdist/cdist/mputil.py", line 61, in mp_pool_run
retval.append(f.result())
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp00grz_78/f9e7b5d8cf331963f92e3dc240158fb4/data/stderr/init'
`

*Created by: telmich* Clearly, we should only output the error message, not a traceback `[9:48] manager:~% cdist config -vvbj6 -p6 router1.place6.ungleich.ch router2.place6.ungleich.ch VERBOSE: cdist: version 4.8.0-18-g44673131 WARNING: [26854]: router2.place6.ungleich.ch: Could not derive host_name for router2.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host WARNING: [26853]: router1.place6.ungleich.ch: Could not derive host_name for router1.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host INFO: [26853]: router1.place6.ungleich.ch: Starting configuration run INFO: [26854]: router2.place6.ungleich.ch: Starting configuration run VERBOSE: [26854]: router2.place6.ungleich.ch: Running global explorers VERBOSE: [26853]: router1.place6.ungleich.ch: Running global explorers concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/home/nico/vcs/cdist/cdist/config.py", line 431, in run self.manifest.run_initial_manifest(self.local.initial_manifest) File "/home/nico/vcs/cdist/cdist/core/manifest.py", line 152, in run_initial_manifest raise NoInitialManifestError(initial_manifest, user_supplied) cdist.core.manifest.NoInitialManifestError: 'Initial manifest missing: /tmp/tmp00grz_78/f9e7b5d8cf331963f92e3dc240158fb4/data/conf/manifest/init' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/nico/vcs/cdist/cdist/config.py", line 391, in onehost c.run() File "/home/nico/vcs/cdist/cdist/config.py", line 436, in run stderr_path, e) cdist.InitialManifestError: <unprintable InitialManifestError object> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/home/nico/vcs/cdist/cdist/config.py", line 395, in onehost log.error(e) File "/usr/lib/python3.6/logging/__init__.py", line 1335, in error self._log(ERROR, msg, args, **kwargs) File "/usr/lib/python3.6/logging/__init__.py", line 1442, in _log self.handle(record) File "/usr/lib/python3.6/logging/__init__.py", line 1451, in handle if (not self.disabled) and self.filter(record): File "/home/nico/vcs/cdist/cdist/log.py", line 87, in filter record.msg = self.name + ": " + str(record.msg) File "/home/nico/vcs/cdist/cdist/__init__.py", line 118, in __str__ output.append(self.stderr + '\n') File "/home/nico/vcs/cdist/cdist/__init__.py", line 100, in stderr if os.path.getsize(stderr_path) > 0: File "/usr/lib/python3.6/genericpath.py", line 50, in getsize return os.stat(filename).st_size FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp00grz_78/f9e7b5d8cf331963f92e3dc240158fb4/data/stderr/init' """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 79, in <module> commandline() File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 56, in commandline args.func(args) File "/home/nico/vcs/cdist/cdist/config.py", line 273, in commandline jobs=args.parallel) File "/home/nico/vcs/cdist/cdist/mputil.py", line 61, in mp_pool_run retval.append(f.result()) File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result return self.__get_result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp00grz_78/f9e7b5d8cf331963f92e3dc240158fb4/data/stderr/init' `
Author
Owner

Created by: telmich

Solved:

[13:32] manager:cdist% git describe 
4.8.0-35-gbc94c01c
[13:32] manager:cdist% cdist config -bj6 -p4 router1.place6.ungleich.ch router2.place6.ungleich.ch 
WARNING: [30453]: router2.place6.ungleich.ch: Could not derive host_name for router2.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host
WARNING: [30452]: router1.place6.ungleich.ch: Could not derive host_name for router1.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host
ERROR: [30453]: router2.place6.ungleich.ch: 'Initial manifest missing: /tmp/tmpgn_hsx78/f9e7b5d8cf331963f92e3dc240158fb4/data/conf/manifest/init'

Error processing initial manifest
==================================
path: /tmp/tmpgn_hsx78/f9e7b5d8cf331963f92e3dc240158fb4/data/conf/manifest/init


ERROR: [30452]: router1.place6.ungleich.ch: 'Initial manifest missing: /tmp/tmpgn_hsx78/7a37b26cffdd9bed95554f9d390d1149/data/conf/manifest/init'

Error processing initial manifest
==================================
path: /tmp/tmpgn_hsx78/7a37b26cffdd9bed95554f9d390d1149/data/conf/manifest/init


ERROR: cdist: Failed to configure the following hosts: router2.place6.ungleich.ch router1.place6.ungleich.ch
[13:33] manager:cdist% 
*Created by: telmich* Solved: ``` [13:32] manager:cdist% git describe 4.8.0-35-gbc94c01c [13:32] manager:cdist% cdist config -bj6 -p4 router1.place6.ungleich.ch router2.place6.ungleich.ch WARNING: [30453]: router2.place6.ungleich.ch: Could not derive host_name for router2.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host WARNING: [30452]: router1.place6.ungleich.ch: Could not derive host_name for router1.place6.ungleich.ch, $host_name will be empty. Error is: [Errno 1] Unknown host ERROR: [30453]: router2.place6.ungleich.ch: 'Initial manifest missing: /tmp/tmpgn_hsx78/f9e7b5d8cf331963f92e3dc240158fb4/data/conf/manifest/init' Error processing initial manifest ================================== path: /tmp/tmpgn_hsx78/f9e7b5d8cf331963f92e3dc240158fb4/data/conf/manifest/init ERROR: [30452]: router1.place6.ungleich.ch: 'Initial manifest missing: /tmp/tmpgn_hsx78/7a37b26cffdd9bed95554f9d390d1149/data/conf/manifest/init' Error processing initial manifest ================================== path: /tmp/tmpgn_hsx78/7a37b26cffdd9bed95554f9d390d1149/data/conf/manifest/init ERROR: cdist: Failed to configure the following hosts: router2.place6.ungleich.ch router1.place6.ungleich.ch [13:33] manager:cdist% ```
Author
Owner

Created by: darko-poljak

@telmich Can you try with latest master version?
This should have ben fixed in https://github.com/ungleich/cdist/issues/639.
The latest version is cdist 4.8.0-35-gbc94c01c.

*Created by: darko-poljak* @telmich Can you try with latest master version? This should have ben fixed in https://github.com/ungleich/cdist/issues/639. The latest version is cdist 4.8.0-35-gbc94c01c.
Author
Owner

Created by: darko-poljak

And I thought we are ready for new bugfix release.

*Created by: darko-poljak* And I thought we are ready for new bugfix release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#126
No description provided.