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

promgen web worker bad request #318

Open
like-inspur opened this issue Mar 11, 2021 · 2 comments
Open

promgen web worker bad request #318

like-inspur opened this issue Mar 11, 2021 · 2 comments

Comments

@like-inspur
Copy link

I run promgen following the docs, bootstrap, migrate, check and createsuperuser all run normally
But after run web server, when I access server , it outputs Bad Request (400)
the logs of promgen don't output error

root@mgt01:~# docker run --rm -p 8001:8000 -v ~/.config/promgen:/etc/promgen/ line/promgen:v0.50
[2021-03-11 08:17:57 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2021-03-11 08:17:57 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2021-03-11 08:17:57 +0000] [1] [INFO] Using worker: sync
[2021-03-11 08:17:57 +0000] [8] [INFO] Booting worker with pid: 8
[2021-03-11 08:17:57 +0000] [9] [INFO] Booting worker with pid: 9
[2021-03-11 08:17:57 +0000] [10] [INFO] Booting worker with pid: 10
[2021-03-11 08:17:57 +0000] [11] [INFO] Booting worker with pid: 11
[2021-03-11 08:18:33 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:8)
[2021-03-11 08:18:33 +0000] [8] [INFO] Worker exiting (pid: 8)
[2021-03-11 08:18:33 +0000] [28] [INFO] Booting worker with pid: 28

the config of promgen is right like below

cat .config/promgen/CELERY_BROKER_URL 
redis://100.105.240.158:6379/0 

cat .config/promgen/DATABASE_URL 
mysql://root:[email protected]/promgen

cat .config/promgen/promgen.yml 
# Prometheus settings
# These are used for Promgen to automatically trigger a reload on target changes
prometheus:
  url: http://100.105.10.77:9090/
  # Path to promtool to verify valid rules file
  promtool: /usr/local/bin/promtool
  # Output rule configuration to this path
  rules: /etc/prometheus/promgen.rule.yml
  # Output blackbox configuration to this path
  blackbox: /etc/prometheus/blackbox.json
  # Output target configuration to this path
  targets: /etc/prometheus/promgen.json

alertmanager:
  url: http://100.105.217.142:9093
  # Blacklist labels we want to filter out and prevent
  # sending alerts on
  blacklist:
    severity: ["debug", "blackhole"]

# Sender Configuration Settings
# These match the module path of the plugin itself
promgen.notification.email:
  sender: [email protected]
promgen.notification.ikasan:
  server: http://ikasan.example
promgen.notification.linenotify:
  server: https://notify.example

cat .config/promgen/SECRET_KEY 
123456a?
@kfdm
Copy link
Collaborator

kfdm commented Mar 11, 2021

Do you have ALLOWED_HOSTS set ?
https://docs.djangoproject.com/en/3.1/ref/settings#allowed-hosts
It's possible I do not have this documented well 🙇

You can set it to * to disable this check

@like-inspur
Copy link
Author

yes, add it on #319

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