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

measurement-agent is None for EsmondRawRecord under some conditions #958

Closed
tonin opened this issue Jan 24, 2020 · 3 comments
Closed

measurement-agent is None for EsmondRawRecord under some conditions #958

tonin opened this issue Jan 24, 2020 · 3 comments
Assignees

Comments

@tonin
Copy link
Member

@tonin tonin commented Jan 24, 2020

When DNS or HTTP tests are run on a host that only has IPv4 connectivity, it seems the measurement-agent agent field of the metadata posted to Esmond is empty. Here is what a pscheduler debug on archiver reveals:

Jan 24 20:26:48 perfsonar journal: archiver-esmond/archive DEBUG    Posting metadata to http://pmp-central.geant.org/esmond/perfsonar/archive/: {'time-duration': 7.0, u'pscheduler-reference-psconfig-created-by-user-agent': u'psconfig-pscheduler-agent', 'pscheduler-test-type': u'http', 'subject-type': 'network-element', 'measurement-agent': None, 'event-types': [{'event-type': 'pscheduler-raw'}, {'event-type': 'pscheduler-run-href'}], 'source': '::1', u'pscheduler-http-url': u'www.geant.org', 'input-source': u'localhost', u'pscheduler-reference-psconfig-created-by-uuid': u'929C5A5E-33B8-11E9-8031-CDADBFCEB037', 'tool-name': u'pscheduler/psurl', u'pscheduler-http-schema': 1}

This results in Esmond refusing to store the metadata (and subsequently the data) with the following error:

(...)
  File "/usr/lib/esmond/esmond/api/perfsonar/api_v2.py", line 674, in create
    self.get_fields()[subject_model].Meta.model.objects.create(metadata=metadata, **subject)
  File "/usr/lib/esmond/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
(...)
  File "/usr/lib/esmond/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
IntegrityError: null value in column "measurement_agent" violates not-null constraint
DETAIL:  Failing row contains (8, pscheduler/psurl, ::1, null, localhost, 74).
@tonin tonin added this to the sprint-20200203 milestone Jan 24, 2020
@tonin tonin self-assigned this Jan 24, 2020
@tonin

This comment has been minimized.

Copy link
Member Author

@tonin tonin commented Jan 24, 2020

A workaround exists by removing any ::1 localhost entry present in /etc/hosts that forces pscheduler to set the source of the test to 127.0.0.1 instead of ::1. Then pscheduler-archiver correctly sets the measurement-agent to the IPv4 of the host instead of trying to find an IPv6 address that doesn't exist.

@arlake228

This comment has been minimized.

Copy link
Collaborator

@arlake228 arlake228 commented Jan 24, 2020

I can take this one.

@tonin

This comment has been minimized.

Copy link
Member Author

@tonin tonin commented Jan 29, 2020

I can confirm the fix in #960 is solving this issue.

@arlake228 arlake228 closed this Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.