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

psconfig stats pscheduler should print better error message when pscheduler not present #157

Open
szymontrocha opened this issue Jan 20, 2025 · 3 comments · Fixed by #158
Assignees

Comments

@szymontrocha
Copy link

In a central MA host when one issues a psconfig stats pscheduler command it fails with an ugly message:

$ psconfig stats pscheduler
Traceback (most recent call last):
  File "/usr/lib/perfsonar/psconfig/bin/commands/stats", line 50, in <module>
    metrics = calculator.run_metrics()
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/psconfig/utilities/metrics.py", line 121, in run_metrics
    with FileReadBackwards(self.agent_log_file(), encoding="utf-8") as frb:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/file_read_backwards/file_read_backwards.py", line 41, in __init__
    self.iterator = FileReadBackwardsIterator(io.open(self.path, mode="rb"), self.encoding, self.chunk_size)
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/perfsonar/psconfig-pscheduler-agent.log'
$

it would be much better if it fails silently or prints some informative message like "This is an archive host. pscheduler is not present" or anything else then a code error

@github-project-automation github-project-automation bot moved this to Ready in perfSONAR Jan 20, 2025
@valtersg valtersg linked a pull request Feb 15, 2025 that will close this issue
@laeti-tia
Copy link
Member

And I guess in a testpoint-only host, we have the same when issuing a psconfig stats grafana, isn't it?

@valtersg
Copy link

Technically yes.
The stats command doesn't check if an agent is installed.
The 3 possible agents are hardcoded and the stats command just parses the corresponding log file either in /var/log/perfsonar/ or a directory provided by --logdir

@valtersg valtersg moved this from Ready to In Progress in perfSONAR Feb 18, 2025
@valtersg valtersg moved this from In Progress to In Review in perfSONAR Feb 18, 2025
laeti-tia added a commit that referenced this issue Feb 20, 2025
@laeti-tia
Copy link
Member

It should be good, but to be tested once the package lands in the snapshot repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

3 participants