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

Graylog looking for hardcoded DLS endpoint #16

Closed
TimGuiteDiamond opened this issue May 22, 2020 · 1 comment · Fixed by #90
Closed

Graylog looking for hardcoded DLS endpoint #16

TimGuiteDiamond opened this issue May 22, 2020 · 1 comment · Fixed by #90

Comments

@TimGuiteDiamond
Copy link

  • Zocalo version: 0.6.3
  • Python version: 3.7.3
  • Operating System:

Description

Describe what you were trying to get done.

Run the python-zocalo-examples

Tell us what happened, what went wrong, and what you expected to happen.

Expected it to work, instead got an error relating to graylog and a Diamond specific variable which has been hardcoded.

What I Did


(.zocalo_test_env) [13:06]classen@als-enable:python-zocalo-examples[1066]$ which python
~/python-zocalo-examples/.zocalo_test_env/bin/python

(.zocalo_test_env) [13:06]classen@als-enable:python-zocalo-examples[1067]$ python -V
Python 3.7.3

(.zocalo_test_env) [13:06]classen@als-enable:python-zocalo-examples[1068]$ pip list
Package         Version Location
--------------- ------- ------------------------------------
docopt          0.6.2
graypy          2.1.0
nested-lookup   0.2.21
pip             20.1.1
setuptools      46.4.0
six             1.14.0
stomp.py        4.1.23
wheel           0.34.2
workflows       1.7.2
zocalo          0.6.3
zocalo-examples 0.0     /home/classen/python-zocalo-examples

(.zocalo_test_env) [13:06]classen@als-enable:python-zocalo-examples[1069]$ zocalo.service --version
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/logging/handlers.py", line 631, in emit
    self.send(s)
  File "/home/classen/python-zocalo-examples/.zocalo_test_env/lib/python3.7/site-packages/graypy/handler.py", line 611, in send
    super(GELFUDPHandler, self).send(s)
  File "/usr/local/lib/python3.7/logging/handlers.py", line 689, in send
    self.sock.sendto(s, self.address)
socket.gaierror: [Errno -2] Name or service not known
Call stack:
  File "/home/classen/python-zocalo-examples/.zocalo_test_env/bin/zocalo.service", line 8, in <module>
    sys.exit(start_service())
  File "/home/classen/python-zocalo-examples/.zocalo_test_env/lib/python3.7/site-packages/zocalo/service/__init__.py", line 23, in start_service
    transport_command channel="command",
  File "/home/classen/python-zocalo-examples/.zocalo_test_env/lib/python3.7/site-packages/workflows/contrib/start_service.py", line 92, in run
    parser = self.on_parser_preparation(parser) or parser
  File "/home/classen/python-zocalo-examples/.zocalo_test_env/lib/python3.7/site-packages/zocalo/service/__init__.py", line 116, in on_parser_preparation
    self.log.debug("Launching " + str(sys.argv))
Message: "Launching ['/home/classen/python-zocalo-examples/.zocalo_test_env/bin/zocalo.service', '--version']"
Arguments: ()
0.6.3

Discussion

This issue was brought to my attention by Scott Classen from ALS who is looking to use Zocalo outside Diamond.

Having discussed with @Anthchirp , it appears that the enable_graylog() function is pointing to a hardcoded DLS variable, which fails when it can't find the endpoint on the network.

This should be moved to a settings file of some sort, allowing the option to customize graylog outside Diamond or to avoid its use altogether.

Possible fix for users

Short-term solution is to either patch out the zocalo/init.py enable_graylog() function or copy zocalo.service to $SITE.service (a new module) and remove the call there.

@dsclassen
Copy link

I have managed to get around this by checking out python-zocalo from GitHub, editing the graylog FQDN to point to our graylog server, and installing into my virtual environment with a pip install -e ../python-zocalo/

I can now start exploring zocalo.service, zocalo.go, etc without the socket.gaierror errors.

However, I am now running into a problem because my ActiveMQ installation is probably not configured correctly (i.e. I don't have a zocdev namespace setup? ). Anyways, I can take these questions over to the python-zocalo-examples project.

@stufisher stufisher linked a pull request Dec 21, 2020 that will close this issue
@Anthchirp Anthchirp linked a pull request May 12, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants