Can't deploy with render, promethus db lookup fails

オープン
#7,329 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
prometheus, python

調査の方向性

common/core/metrics.py から始め、traceback で advertise() がメトリクス flagsmith_build_info を作成していることを確認し、/tmp/prometheus 周辺の prometheus_client のマルチプロセス初期化を調べます。ワンクリックの Render デプロイメントを再現し、正常に起動すること、または必要な対処手順が文書化されていることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
9.9k
フォーク
658
平均マージ
1日 15時間
マージ済み PR(30日)
171

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Flagsmith/flagsmith のほかの issue

Flagsmith/flagsmith の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。