teamhanko / hanko

Authentication and user management for the passkey era.
https://hanko.io
Other
5.7k stars 796 forks source link

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

Open fatsolow88 opened 1 year ago

fatsolow88 commented 1 year ago

Checklist

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=,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=,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

FreddyDevelop commented 1 year ago

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.

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 1 year ago

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