Saltstack -> 'Pillar failed to render with the following messages' - salt-stack

On my FreeBSD I have a file packages.sls in the following path /usr/local/etc/salt/states
I'm getting the following error message when i do salt '*' state.apply packages :
freebsd:
Data failed to compile:
----------
Pillar failed to render with the following messages:
----------
Rendering SLS 'config' failed. Please see master log for details.
On the file master log i have the following details:
2022-06-02 10:05:12,222 [salt.roster :104 ][ERROR ][3425] Can't access roster for backend flat: Roster file "/usr/local/etc/salt/roster" not found
2022-06-02 10:05:12,434 [salt.pillar :900 ][CRITICAL][3427] Rendering SLS 'config' failed, render error:
found unexpected end of stream
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/salt/renderers/yaml.py", line 62, in render
data = yamlloader.load(yaml_data, Loader=get_yaml_loader(argline))
File "/usr/local/lib/python3.8/site-packages/salt/utils/yamlloader.py", line 169, in load
return yaml.load(stream, Loader=Loader)
File "/usr/local/lib/python3.8/site-packages/yaml/__init__.py", line 114, in load
return loader.get_single_data()
File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
node = self.get_single_node()
File "yaml/_yaml.pyx", line 707, in yaml._yaml.CParser.get_single_node
File "yaml/_yaml.pyx", line 725, in yaml._yaml.CParser._compose_document
File "yaml/_yaml.pyx", line 776, in yaml._yaml.CParser._compose_node
File "yaml/_yaml.pyx", line 890, in yaml._yaml.CParser._compose_mapping_node
File "yaml/_yaml.pyx", line 776, in yaml._yaml.CParser._compose_node
File "yaml/_yaml.pyx", line 892, in yaml._yaml.CParser._compose_mapping_node
File "yaml/_yaml.pyx", line 905, in yaml._yaml.CParser._parse_next_event
yaml.scanner.ScannerError: while scanning a quoted scalar
in "<unicode string>", line 3, column 27
found unexpected end of stream
in "<unicode string>", line 4, column 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/salt/pillar/__init__.py", line 887, in render_pstate
state = compile_template(
File "/usr/local/lib/python3.8/site-packages/salt/template.py", line 99, in compile_template
ret = render(input_data, saltenv, sls, **render_kwargs)
File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 1201, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 1216, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/salt/renderers/yaml.py", line 66, in render
raise SaltRenderError(err_type, line_num, exc.problem_mark.buffer)
salt.exceptions.SaltRenderError: found unexpected end of stream
2022-06-02 10:05:12,435 [salt.pillar :1224][CRITICAL][3427] Pillar render error: Rendering SLS 'config' failed. Please see master log for details.
My sls file packages.sls
install_bash:
pkg.installed:
- pkgs:
- bash
- vim
- curl
Any idea on how to solve this situation?
Thank you

It was a problem of DNS/Cache. Issue solved after changing the hostname in minion.id ,clear cache, accepted new key and restart.

Related

exception when running pyFlink batch processing with 2 sinks

I got the following flink exception when I run pyflink processing job:
Exception in thread read_grpc_client_inputs:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 937, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 885, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib64/python3.6/site-packages/apache_beam/runners/worker/data_plane.py", line 598, in <lambda>
target=lambda: self._read_inputs(elements_iterator),
File "/usr/local/lib64/python3.6/site-packages/apache_beam/runners/worker/data_plane.py", line 581, in _read_inputs
for elements in elements_iterator:
File "/usr/local/lib64/python3.6/site-packages/grpc/_channel.py", line 426, in __next__
return self._next()
File "/usr/local/lib64/python3.6/site-packages/grpc/_channel.py", line 826, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.CANCELLED
details = "Multiplexer hanging up"
debug_error_string = "{"created":"#1664983018.802636895","description":"Error received from peer ipv4:127.0.0.1:44675","file":"src/core/lib/surface/call.cc","file_line":904,"grpc_message":"Multiplexer hanging up","grpc_status":1}"
>
the sink result is loaded with :
resultB = tableA.flat_map(name).alias('name') \
.select(col('name'))\
.execute_insert('allowed_table').wait()
resultA = tableA.flat_map(name).alias('name') \
.select(col('name'))\
.execute_insert('allowed_table').wait()
I solved this problem by removing .wait()

ngrok account token connection is not working

in terminal:
ngrok config add-authtoken -----personal_TOKEN-----
when ı tryed for this ı'm getting this error
ı downloaded the pyngrok but still ı have this issue.
Thanks for any help !
Traceback (most recent call last):
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/installer.py", line 94, in install_ngrok
download_path = _download_file(url, **kwargs)
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/installer.py", line 257, in _download_file
raise e
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/installer.py", line 235, in _download_file
buffer = response.read(chunk_size)
File "/usr/lib/python3.8/http/client.py", line 459, in read
n = self.readinto(b)
File "/usr/lib/python3.8/http/client.py", line 503, in readinto
n = self.fp.readinto(b)
File "/usr/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/selman/PycharmProjects/tringle-case/venv/bin/ngrok", line 8, in <module>
sys.exit(main())
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/ngrok.py", line 501, in main
run(sys.argv[1:])
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/ngrok.py", line 487, in run
install_ngrok(pyngrok_config)
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/ngrok.py", line 98, in install_ngrok
installer.install_ngrok(pyngrok_config.ngrok_path)
File "/home/selman/PycharmProjects/tringle-case/venv/lib/python3.8/site-packages/pyngrok/installer.py", line 98, in install_ngrok
raise PyngrokNgrokInstallError("An error occurred while downloading ngrok from {}: {}".format(url, e))
pyngrok.exception.PyngrokNgrokInstallError: An error occurred while downloading ngrok from https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip: The read operation timed out
The documentation is faulty. Try this:
ngrok.exe authtoken xxxxxxxxxxxxxxxxxxxxxxxxx
Replace xxxxxxx with your token.

DVC Push KeyError fileSize

I've added a large list of CSV files to my dvc repository but when I try to do DVC push it complains with
ERROR: unexpected error - KeyError('fileSize')
Edit
So searching around it seem that it might help to include the verbose log with regards to the error.
T11:27:08~/documents/*****/data$ dvc push -v
2022-02-01 11:32:13,186 DEBUG: Adding '/home/jhylands/Documents/*****/.dvc/config.local' to gitignore file.
2022-02-01 11:32:13,199 DEBUG: Adding '/home/jhylands/Documents/*****/.dvc/tmp' to gitignore file.
2022-02-01 11:32:13,200 DEBUG: Adding '/home/jhylands/Documents/*****/.dvc/cache' to gitignore file.
2022-02-01 11:32:14,102 DEBUG: Preparing to transfer data from '/home/jhylands/Documents/*****/.dvc/cache' to '*********'
2022-02-01 11:32:14,102 DEBUG: Preparing to collect status from '********'
2022-02-01 11:32:14,103 DEBUG: Collecting status from '*******'
2022-02-01 11:32:14,439 DEBUG: GDrive remote auth with config '{'client_config_backend': 'settings', 'client_config_file': 'client_secrets.json', 'save_credentials': True, 'oauth_scope': ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.appdata'], 'save_credentials_backend': 'file', 'save_credentials_file': '/home/jhylands/Documents/*****/.dvc/tmp/gdrive-user-credentials.json', 'get_refresh_token': True, 'client_config': {'client_id': '*****.apps.googleusercontent.com', 'client_secret': '****************', 'auth_uri': 'https://accounts.google.com/o/oauth2/auth', 'token_uri': 'https://oauth2.googleapis.com/token', 'revoke_uri': 'https://oauth2.googleapis.com/revoke', 'redirect_uri': ''}}'.
2022-02-01 11:32:14,994 DEBUG: Estimated remote size: 256 files
2022-02-01 11:32:14,995 DEBUG: Querying '316' hashes via traverse
2022-02-01 11:32:15,325 ERROR: unexpected error - KeyError('fileSize')
------------------------------------------------------------
Traceback (most recent call last):
File "/home/jhylands/.local/lib/python3.8/site-packages/pydrive2/files.py", line 226, in __getitem__
return dict.__getitem__(self, key)
KeyError: 'fileSize'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/main.py", line 55, in main
ret = cmd.do_run()
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/command/base.py", line 45, in do_run
return self.run()
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/command/data_sync.py", line 57, in run
processed_files_count = self.repo.push(
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/repo/__init__.py", line 49, in wrapper
return f(repo, *args, **kwargs)
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/repo/push.py", line 56, in push
pushed += self.cloud.push(
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/data_cloud.py", line 85, in push
return transfer(
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/transfer.py", line 153, in transfer
status = compare_status(src, dest, obj_ids, check_deleted=False, **kwargs)
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/status.py", line 158, in compare_status
dest_exists, dest_missing = status(
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/status.py", line 131, in status
exists.update(odb.hashes_exist(hashes, name=odb.fs_path, **kwargs))
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/db/base.py", line 499, in hashes_exist
remote_hashes = set(
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/db/base.py", line 334, in _list_hashes_traverse
yield from itertools.chain.from_iterable(in_remote)
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator
yield fs.pop().result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/db/base.py", line 324, in list_with_update
return list(
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/db/base.py", line 215, in _list_hashes
for path in self._list_paths(prefix, progress_callback):
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/objects/db/base.py", line 195, in _list_paths
for file_info in self.fs.find(fs_path, prefix=prefix):
File "/home/jhylands/.local/lib/python3.8/site-packages/dvc/fs/fsspec_wrapper.py", line 107, in find
yield from self.fs.find(path)
File "/home/jhylands/.local/lib/python3.8/site-packages/pydrive2/fs/spec.py", line 323, in find
"size": int(item["fileSize"]),
File "/home/jhylands/.local/lib/python3.8/site-packages/pydrive2/files.py", line 229, in __getitem__
raise KeyError(e)
KeyError: KeyError('fileSize')

Unable to export jupyter notebook to any other format using nbconvert

I am using Python 3.8.5 on Windows 10. I installed Jupyterlab and it works correctly. However nbconvert does not. When I try to export notebook to any format, I get the following error in the terminal:
[W 16:14:06.733 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200928161400 (::1) 8.46ms referer=http://localhost:8889/notebooks/tester1/testing_epr_py.ipynb
[I 16:14:07.066 NotebookApp] Kernel started: 1e1cd4f1-55e7-4583-b343-98ed9670e8f9, name: python3
[E 16:14:10.773 NotebookApp] Uncaught exception GET /nbconvert/html/tester1/testing_epr_py.ipynb?download=true (::1)
HTTPServerRequest(protocol='http', host='localhost:8889', method='GET', uri='/nbconvert/html/tester1/testing_epr_py.ipynb?download=true', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 535, in get
value = obj._trait_values[self.name]
KeyError: 'template_paths'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\tornado\web.py", line 1703, in _execute
result = await result
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\notebook\nbconvert\handlers.py", line 93, in get
exporter = get_exporter(format, config=self.config, log=self.log)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\notebook\nbconvert\handlers.py", line 67, in get_exporter
Exporter = get_exporter(format)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\base.py", line 102, in get_exporter
if getattr(exporter(config=config), 'enabled', True):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 328, in __init__
super().__init__(config=config, **kw)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\exporter.py", line 114, in __init__
self._init_preprocessors()
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 494, in _init_preprocessors
conf = self._get_conf()
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 510, in _get_conf
for path in map(Path, self.template_paths):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 575, in __get__
return self.get(obj, cls)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 538, in get
default = obj.trait_defaults(self.name)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 1577, in trait_defaults
return self._get_trait_default_generator(names[0])(self)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 975, in __call__
return self.func(*args, **kwargs)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 521, in _template_paths
template_names = self.get_template_names()
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 582, in get_template_names
raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'lab' found in the following paths:
C:\Users\draco.malfoy\AppData\Roaming\jupyter
C:\Program Files\Python38\share\jupyter
C:\ProgramData\jupyter
I also tried to use nbconvert through command line but got the same error. nbconvert version is 6.0.6. Any help is greatly appreciated.
Copying files from "C:\Users\{username}\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\share\jupyter"
to "C:\ProgramData\jupyter" helped me solve this issue, kindly note that you will have to install Pandoc and MiKTex on Windows if you want to convert notebooks.

AuthorizationFailed - "The client 'xxx' with object id 'xxx does not have authorization to perform action

I've tried to get Workspace from config which I do have access to, but it fails with the following error:
import azureml.core
print("SDK version:", azureml.core.VERSION)
from azureml.core.workspace import Workspace
ws = Workspace.from_config()
print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\n')
SDK version: 0.1.80 Found the config file in:
C:\Users\gubert\Repos\Gimmonix\HotelMappingAI\aml_config\config.json
get_workspace error using subscription_id=xxxxxxxxxxxxxxxxxxxxxxx,
resource_group_name=xxxxxxxxxxxx, workspace_name=gmx-ml-mapping
Traceback (most recent call last): File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_project_commands.py",
line 320, in get_workspace workspace_name) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_base_sdk_common\workspace\operations\workspaces_operations.py",
line 78, in get raise
models.ErrorResponseWrapperException(self._deserialize, response)
azureml._base_sdk_common.workspace.models.error_response_wrapper.ErrorResponseWrapperException:
Operation returned an invalid status code 'Forbidden'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd_launcher.py",
line 38, in main(sys.argv) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_main_.py",
line 265, in main wait=args.wait) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_main_.py",
line 256, in handle_args run_main(addr, name, kind, *extra, **kwargs)
File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_local.py",
line 52, in run_main runner(addr, name, kind == 'module', *extra,
**kwargs) File "c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd\runner.py",
line 32, in run set_trace=False) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd\pydevd.py",
line 1283, in run return self._exec(is_module, entry_point_fn,
module_name, file, globals, locals) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd\pydevd.py",
line 1290, in _exec pydev_imports.execfile(file, globals, locals) #
execute the script File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd_pydev_imps_pydev_execfile.py",
line 25, in execfile exec(compile(contents+"\n", file, 'exec'), glob,
loc) File "c:\Users\gubert\Repos\Gimmonix\HotelMappingAI\test.py",
line 8, in ws = Workspace.from_config() File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml\core\workspace.py",
line 153, in from_config auth=auth) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml\core\workspace.py",
line 86, in init auto_rest_workspace = _commands.get_workspace(auth,
subscription_id, resource_group, workspace_name) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_project_commands.py",
line 326, in get_workspace resource_error_handling(response_exception,
WORKSPACE) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_base_sdk_common\common.py",
line 270, in resource_error_handling raise
ProjectSystemException(response_message)
azureml.exceptions._azureml_exception.ProjectSystemException: {
"error_details": { "error": { "code": "AuthorizationFailed",
"message": "The client 'xxxxxxxxxx#microsoft.com' with object id
'xxxxxxxxxxxxx' does not have authorization to perform action
'Microsoft.MachineLearningServices/workspaces/read' over scope
'/subscriptions/xxxxxxxxxxxxxx/resourceGroups/CarsolizeCloud - Test
Global/providers/Microsoft.MachineLearningServices/workspaces/gmx-ml-mapping'."
} }, "status_code": 403, "url":
"https://management.azure.com/subscriptions/xxxxxxxxxxxxx/resourceGroups/CarsolizeCloud%20-%20Test%20Global/providers/Microsoft.MachineLearningServices/workspaces/gmx-ml-mapping?api-version=2018-03-01-preview"
}
Try using the newest SDK version 1.0.10, this is a fairly old preview version you're using. If you still have a problem, let me know as I work on this SDK.

Resources