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

AttributeError: 'list' object has no attribute 'lower' #127

Open
erazemk opened this issue Aug 11, 2021 · 1 comment
Open

AttributeError: 'list' object has no attribute 'lower' #127

erazemk opened this issue Aug 11, 2021 · 1 comment

Comments

@erazemk
Copy link

erazemk commented Aug 11, 2021

I tried running the dockerized version of cachet-url-monitor, but I get the following error when running from master:

monitor_1  | Traceback (most recent call last):
monitor_1  |   File "./cachet_url_monitor/scheduler.py", line 158, in <module>
monitor_1  |     client: CachetClient = CachetClient(api_url, token)
monitor_1  |   File "/usr/local/lib/python3.7/site-packages/cachet_url_monitor-0.6.11-py3.7.egg/cachet_url_monitor/client.py", line 31, in __init__
monitor_1  |     self.url = normalize_url(url)
monitor_1  |   File "/usr/local/lib/python3.7/site-packages/cachet_url_monitor-0.6.11-py3.7.egg/cachet_url_monitor/client.py", line 13, in normalize_url
monitor_1  |     if not url.lower().startswith("http"):
monitor_1  | AttributeError: 'list' object has no attribute 'lower'

I'm not very familiar with Python, so I don't know how to fix it myself, but it seems the problem is that url in client.py:l13 is treated as a list instead of a string.

@RashKash103
Copy link

@erazemk I was seeing this error as well and after doing a little bit of debugging, I found out what was causing it.

Basically, the api_url does not support the ENVIRONMENT VARIABLE method for retrieval as the token does. So it did not work when my configuration was as follows:

...
cachet:
  api_url:
    - type: ENVIRONMENT_VARIABLE
      value: CACHET_URL
  token:
    - type: TOKEN
      value: my_token
...

I had to instead hard-code the URL into the config.yml like this:

...
cachet:
  api_url: http://status.cachethq.io/api/v1
  token:
    - type: TOKEN
      value: my_token
...

I know that the the Docker version does say to do it like the former but perhaps that changed in some version of cachet-url-monitor.

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