Skip to content

Homarr fails when using main.py setup script #72

@brnl

Description

@brnl

Describe the bug
Homarr fails to start. It returns 'Server 500' in the web browser and the logs get flooded with:

homarr | message: 'SECRET_ENCRYPTION_KEY must only contain hex characters, please generate a 64 character secret in hex format or use the following: "41966b49750ba284cbdaf003a3aa23b606db4c343c5ca6006b44a27d0dfa90d3"',

This is due to the automatic key generation in the Python script:

key = os.urandom(124).hex()

To Reproduce
Steps to reproduce the behavior:

  1. Use python3 main.py to setup
  2. Answer yes to configure Homarr
  3. Start docker compose
  4. Watch the logs of the homarr container
  5. Try to open the web interface

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Image

System (please complete the following information):

  • OS: Ubuntu 24.04
  • Browser: Firefox
  • Deployed both with Podman and Docker

Easy fix
Set key generation to 32*, instead of 128.
(*Because os.urandom(32) generates 32 random bytes, and .hex() converts each byte into two hexadecimal characters.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions