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

Errors when initializing #10

Open
cristianmtr opened this issue Jun 15, 2020 · 5 comments
Open

Errors when initializing #10

cristianmtr opened this issue Jun 15, 2020 · 5 comments

Comments

@cristianmtr
Copy link

I am seeing some errors in the console. This happens erratically

Traceback (most recent call last):
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/site-packages/logging_loki/handlers.py", line 81, in emit
    self.emitter(record, self.format(record))
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/site-packages/logging_loki/emitter.py", line 57, in __call__
    raise ValueError("Unexpected Loki API response status code: {0}".format(resp.status_code))
ValueError: Unexpected Loki API response status code: 400
Call stack:
  File "/home/cristian/apps/pycharm-2019.2.2/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 770, in __call__
    ret = self.original_func(*self.args, **self.kwargs)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/logging/handlers.py", line 1479, in _monitor
    self.handle(record)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/logging/handlers.py", line 1462, in handle
    handler.handle(record)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/logging/__init__.py", line 865, in handle
    self.emit(record)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/site-packages/logging_loki/handlers.py", line 83, in emit
    self.handleError(record)
Message: 'No retry needed.'
--- Logging error ---
Traceback (most recent call last):
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/site-packages/logging_loki/handlers.py", line 81, in emit
    self.emitter(record, self.format(record))
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/site-packages/logging_loki/emitter.py", line 57, in __call__
    raise ValueError("Unexpected Loki API response status code: {0}".format(resp.status_code))
ValueError: Unexpected Loki API response status code: 400
Call stack:
  File "/home/cristian/apps/pycharm-2019.2.2/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 770, in __call__
    ret = self.original_func(*self.args, **self.kwargs)
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/logging/handlers.py", line 1479, in _monitor
    self.handle(record)
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/logging/handlers.py", line 1462, in handle
    handler.handle(record)
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/logging/__init__.py", line 865, in handle
    self.emit(record)
  File "/home/cristian/anaconda3/envs/chatbot/lib/python3.6/site-packages/logging_loki/handlers.py", line 83, in emit
    self.handleError(record)
Message: 'Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section'
Arguments: None
@cristianmtr
Copy link
Author

@GreyZmeem

I am also getting this error some times. Not sure if related

--- Logging error ---
Traceback (most recent call last):
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/site-packages/logging_loki/handlers.py", line 81, in emit
    self.emitter(record, self.format(record))
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/site-packages/logging_loki/emitter.py", line 57, in __call__
    raise ValueError("Unexpected Loki API response status code: {0}".format(resp.status_code))
ValueError: Unexpected Loki API response status code: 400
Call stack:
  File "/home/cristian/apps/pycharm-2019.2.2/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 770, in __call__
    ret = self.original_func(*self.args, **self.kwargs)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/logging/handlers.py", line 1479, in _monitor
    self.handle(record)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/logging/handlers.py", line 1462, in handle
    handler.handle(record)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/logging/__init__.py", line 865, in handle
    self.emit(record)
  File "/home/cristian/anaconda3/envs/actionserver/lib/python3.6/site-packages/logging_loki/handlers.py", line 83, in emit
    self.handleError(record)
Message: 'Event request-created.secrets-manager.GetSecretValue: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fb8322d42b0>>'
Arguments: None

@gs202
Copy link

gs202 commented Aug 19, 2020

This might happen when you have double / // at the url

@cristianmtr
Copy link
Author

You mean at the end? I don't have that

Here's my config:

def init_loki_handler():
    loki_user = os.getenv("LOKI_USERNAME")
    loki_password = os.getenv("LOKI_PASSWORD")

    if loki_user and loki_password:
        return logging_loki.LokiHandler(
            url="https://logs-prod-us-central1.grafana.net/loki/api/v1/push",
            tags={"application": "XXXXXXXXXXXXXXX},
            auth=(loki_user, loki_password),
            version="1",
        )
    else:
        logger.warning(
            f"No username and password provided for Loki. Use 'LOKI_USERNAME' and 'LOKI_PASSWORD'"
        )
        return None

@cristianmtr
Copy link
Author

I also tried version="0"

@gs202
Copy link

gs202 commented Aug 19, 2020

@cristianmtr i had the same error when used something like that url="http://my_host//loki/api/v1/push"
But it's not your case as i can see

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

No branches or pull requests

2 participants