Skip to content

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

@fatsolow88

Description

@fatsolow88

Checklist

  • I could not find a solution in the existing issues or docs.
    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=,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

Activity

FreddyDevelop

FreddyDevelop commented on Jun 16, 2023

@FreddyDevelop
Contributor

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

github-actions commented on Jul 27, 2023

@github-actions
Contributor

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

github-actions

github-actions commented on Aug 10, 2023

@github-actions
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fatsolow88@FreddyDevelop@lfleischmann

        Issue actions

          failed to validate config: failed to validate passcode settings: failed to validate email settings: from_address must not be empty · Issue #857 · teamhanko/hanko