hanko icon indicating copy to clipboard operation
hanko copied to clipboard

failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty

Open fatsolow88 opened this issue 1 year ago • 3 comments

Checklist

  • [X] I could not find a solution in the existing issues or docs.
  • [X] I agree to follow this project's Code of Conduct.

Describe the bug

https://github.com/teamhanko/hanko/blob/main/backend/README.md I was following this tutorial.

When I try to call the following command docker run --mount type=bind,source=<PATH-TO-CONFIG-FILE>,target=/config/config.yaml -p 8000:8000 -it ghcr.io/teamhanko/hanko:main migrate up

I got this error "failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty"

I have changed the PATH-TO-CONFIG-FILE to my actual config.yaml path.

Reproducing the bug

  1. Install docker
  2. run docker pull mysql
  3. Setup the config.yaml
  4. run docker run --mount type=bind,source=<PATH-TO-CONFIG-FILE>,target=/config/config.yaml -p 8000:8000 -it ghcr.io/teamhanko/hanko:main migrate up

Logs

2023/06/15 11:02:36 Using config file: ./config/config.yaml
2023/06/15 11:02:36 failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty

Configuration

No response

Hanko Version

N/A

OS Hanko Backend

macOS

OS Version Hanko Backend

No response

OS

None

OS Version

Ventura 13.2

Browser Version

No response

Environment

Docker

Additional Context

No response

fatsolow88 avatar Jun 15 '23 11:06 fatsolow88

Looks like we always validate the complete config, although we only need to validate the database part of the config for the migrate command. So we should only validate the parts of the config file that we need for each command.

As a workaround you can add all required fields to the config e.g:

database:
  user: hanko
  password: hanko
  host: localhost
  port: 3306
  dialect: mysql
  database: hanko
passcode:
  smtp:
    host: example.com
secrets:
  keys:
    - <CHANGE-ME>
service:
  name: Hanko-Test

Also i see, that the readme refers to an outdated docker image, it should be ghcr.io/teamhanko/hanko:latest instead of main.

FreddyDevelop avatar Jun 16 '23 07:06 FreddyDevelop

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jul 27 '23 02:07 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 10 '23 02:08 github-actions[bot]