Can't deploy with render, promethus db lookup fails

Đang mở
#7,329 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
prometheus, python
Lĩnh vực
devops, observability-sre

Hướng nghiên cứu

Bắt đầu với common/core/metrics.py, nơi traceback cho thấy advertise() tạo metric flagsmith_build_info, và kiểm tra quá trình khởi tạo multiprocess của prometheus_client quanh /tmp/prometheus. Tái hiện deployment Render bằng một cú nhấp chuột và xác minh rằng nó khởi động thành công hoặc các hướng dẫn xử lý cần thiết đã được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

How are you running Flagsmith
  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)
Describe the bug

im trying to deploy flagsmith to render and getting this error

?: (axes.W004) You have a deprecated setting AXES_ONLY_USER_FAILURES configured in your project settings
Menu
?: (axes.W006) AXES_LOCKOUT_PARAMETERS does not contain 'ip_address'. This configuration allows attackers to bypass rate limits by rotating User-Agents or Cookies.
	HINT: Add 'ip_address' to AXES_LOCKOUT_PARAMETERS.
Traceback (most recent call last):
  File "/usr/local/bin/flagsmith", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/main.py", line 149, in main
    execute_from_command_line(argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/main.py", line 129, in execute_from_command_line
    django_execute_from_command_line(argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 420, in run_from_argv
    self.execute(*args, **cmd_options)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 464, in execute
    output = self.handle(*args, **options)
  File "/build/.venv/lib/python3.13/site-packages/common/core/management/commands/start.py", line 51, in handle
    self.initialise()
    ~~~~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/management/commands/start.py", line 40, in initialise
    autodiscover_modules(
    ~~~~~~~~~~~~~~~~~~~~^
        "metrics",
        ^^^^^^^^^^
        "tasks",
        ^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/django/utils/module_loading.py", line 58, in autodiscover_modules
    import_module("%s.%s" % (app_config.name, module_to_search))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1023, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/build/.venv/lib/python3.13/site-packages/common/core/metrics.py", line 25, in <module>
    advertise()
    ~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/metrics.py", line 18, in advertise
    flagsmith_build_info.labels(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        ci_commit_sha=version_info["ci_commit_sha"],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        version=version_info.get("package_versions", {}).get(".") or "unknown",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ).set(1)
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 203, in labels
    self._metrics[labelvalues] = self.__class__(
                                 ~~~~~~~~~~~~~~^
        self._name,
        ^^^^^^^^^^^
    ...<4 lines>...
        **self._kwargs
        ^^^^^^^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 399, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        name=name,
        ^^^^^^^^^^
    ...<6 lines>...
        _labelvalues=_labelvalues,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 151, in __init__
    self._metric_init()
    ~~~~~~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 413, in _metric_init
    self._value = values.ValueClass(
                  ~~~~~~~~~~~~~~~~~^
        self._type, self._name, self._name, self._labelnames, self._labelvalues,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._documentation, multiprocess_mode=self._multiprocess_mode
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/values.py", line 68, in __init__
    self.__reset()
    ~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/values.py", line 82, in __reset
    files[file_prefix] = MmapedDict(filename)
                         ~~~~~~~~~~^^^^^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/mmap_dict.py", line 64, in __init__
    self._f = open(filename, 'rb' if read_mode else 'a+b')
              ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/prometheus/gauge_livemax_1.db'
Steps To Reproduce
  1. One-click deploy to render
  2. check the logs
Expected behavior

it boots up or there are instructions for handling this scenario

Screenshots

No response

Ngôn ngữ chính
Python
Star
9.9k
Fork
658
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
171

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Flagsmith/flagsmith

Tất cả issue của Flagsmith/flagsmith

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.