Can't deploy with render, promethus db lookup fails

Aberta
#7,329 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
prometheus, python

Direção de pesquisa

Comece por common/core/metrics.py, onde o traceback mostra que advertise() cria a métrica flagsmith_build_info, e inspecione a inicialização multiprocess de prometheus_client em torno de /tmp/prometheus. Reproduza o deployment do Render com um clique e verifique se ele inicia com sucesso ou se as instruções de tratamento necessárias estão documentadas.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
9.9k
Forks
658
Merge médio
1d 15h
PRs com merge (30d)
171

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Flagsmith/flagsmith

Todas as issues de Flagsmith/flagsmith

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.