Skip to content
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

[BUG] os.nice requires an argument #66289

Closed
9 tasks
boyadzhievb opened this issue Mar 29, 2024 · 5 comments · Fixed by #66381
Closed
9 tasks

[BUG] os.nice requires an argument #66289

boyadzhievb opened this issue Mar 29, 2024 · 5 comments · Fixed by #66381
Assignees
Labels
Bug broken, incorrect, or confusing behavior

Comments

@boyadzhievb
Copy link

Description
(

log.info(os.nice())
)
os.nice(increment) requires an argument

Setup
set mworker_niceness: 1 in master, you'll see the error in logs :

2024-03-29 09:14:30,842 [salt.utils.process:913 ][ERROR ][28892] An un-handled exception from the multiprocessing process 'MWorker-101' was caught:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/utils/process.py", line 904, in wrapped_run_func
return run_func()
File "/usr/lib/python3.6/site-packages/salt/master.py", line 1195, in run
log.info(os.nice())
TypeError: nice() takes exactly one argument (0 given)

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior
(Include debug logs if possible and relevant)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
PASTE HERE

Additional context
Add any other context about the problem here.

@boyadzhievb boyadzhievb added Bug broken, incorrect, or confusing behavior needs-triage labels Mar 29, 2024
Copy link

welcome bot commented Mar 29, 2024

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@boyadzhievb boyadzhievb changed the title [BUG] os.nice requires an arument [BUG] os.nice requires an argument Mar 29, 2024
@dwoz
Copy link
Contributor

dwoz commented Apr 10, 2024

@boyadzhievb please provide the output of salt --versions-report

@boyadzhievb
Copy link
Author

boyadzhievb commented Apr 10, 2024

[root@saltmaster-bb]$ salt --versions-report
Salt Version:
Salt: 3006.7

Python Version:
Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]

Dependency Versions:
cffi: 1.16.0
cherrypy: unknown
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.3
libgit2: 1.7.2
looseversion: 1.0.2
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 22.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: 1.14.1
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 23.2.0
relenv: 0.15.1
smmap: Not Installed
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4

System Versions:
dist: centos 7.9.2009 Core
locale: utf-8
machine: x86_64
release: 3.10.0-1160.105.1.el7.x86_64
system: Linux
version: CentOS Linux 7.9.2009 Core

@dwoz dwoz removed the needs-triage label Apr 11, 2024
@dwoz dwoz added this to the Sulfur v3006.8 milestone Apr 11, 2024
@whytewolf whytewolf self-assigned this Apr 16, 2024
@dwoz dwoz modified the milestones: Sulfur v3006.8, Sulfur v3006.9 May 1, 2024
@dwoz dwoz assigned dwoz and unassigned whytewolf Jun 18, 2024
@dwoz dwoz closed this as completed Jun 18, 2024
@whytewolf
Copy link
Collaborator

This is a clear example why salt is digging its grave ! You had to add an '0' instead of removing the log line ! :D :D :D log.info(os.nice()) should become log.info(os.nice(0)) that's all

The function sets current nice level + 'argument', so if current nice is 20 with os.nice(0) it will stay 20 but will print it .

:D

it was removed because it was useless information as is even when working. a random number in the middle of the logs does not help anyone. i knew perfectly well adding 0 to the function would output the current niceness level. but that just sticks a random number in the middle of the logs with no context. I could have updated the log to be more informative about what it meant yes. but the line above already covered what is happening.

@boyadzhievb
Copy link
Author

boyadzhievb commented Jun 19, 2024

This is a clear example why salt is digging its grave ! You had to add an '0' instead of removing the log line ! :D :D :D log.info(os.nice()) should become log.info(os.nice(0)) that's all
The function sets current nice level + 'argument', so if current nice is 20 with os.nice(0) it will stay 20 but will print it .
:D

it was removed because it was useless information as is even when working. a random number in the middle of the logs does not help anyone. i knew perfectly well adding 0 to the function would output the current niceness level. but that just sticks a random number in the middle of the logs with no context. I could have updated the log to be more informative about what it meant yes. but the line above already covered what is happening.

Adding the argument is pretty useful, i am talking from experience not from assumption. It is not random message, it is exactly what i expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants