You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI version v1.223.10 breaking change causes deployment GitHub action to fail because of missing smtp setting in config file #2899
Describe the bug
A clear and concise description of what the bug is.
Using a GitHub action to push migrations to the hosted instance fails with the current CLI, because it is now fatal to not have an smtp host defined. The local CLI development defaults to in bucket, so this is not set in my config file.
pulls the latest version of the cli, which is v1.223.10 currently. My project locally is still using CLI v1.219.2 where everything works. When running the link command, it fails with this error:
Missing required field in config: auth.email.smtp.host
Try rerunning the command with --debug to troubleshoot the error.
Then it exits.
There's no reason to have the local CLI development configuration set this variable, as it uses inbucket.
Expected behavior
A clear and concise description of what you expected to happen.
The deploy should succeed like it always has with my config file, or the version should be bumped for the breaking change.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Rerun the failing command with --create-ticket flag.
Now it is demanding I set all the other fields, but there's no guidance as to what those should be to work with inbucket in the sample config.toml in a new project. I set the following, but the auth service cannot still send any email, it returns 500 error status.
It would be helpful to add those notes in the config.toml in a new project, and to have a "migrate" function of the CLI to bring my config file up to current, keeping existing settings I changed.
Thanks for reporting this issue. I wasn't expecting users to configure inbucket [auth.email.smtp] because the original comment was to configure a production ready custom smtp server. However, we also didn't perform any validations previously so this unintentionally became a breaking change.
Going forward, I wouldn't recommend updating smtp to inbucket host and port because those values won't make sense for branching use cases. We are also planning to switch to mailpit for better UI.
But if this is necessary to unblock, you can use the following settings for the time being.
Thanks for the info. I set up the config as you show above, keeping my admin_email and sender_name, (and restarted local dev) but I continue to get the error sending the recovery mail, Error sending recovery email
I think there's a circular issue between gotrue and inbucket. If you provide a non-empty username/password, it expects encryption to be enabled, which fails with inbucket. The way I got inbucket and SMTP working together was by disabling the validation for SMTP user/password in the cli source code. With this configuration, emails are sent properly to inbucket:
# Use a production-ready SMTP server
[auth.email.smtp]
host = "inbucket"port = 2500admin_email = "admin@email.com"sender_name = "Admin Custom"
Otherwise, as long as smtp.user and smtp.pass are set to non-empty values, the auth container throws a 500 error:
The solution I found to retain SMTP validation and allow email/sender customization is to support sender_name and admin_email under the inbucket section of the configuration. This is a draft proposal as it'll still be a breaking change that'll require config update.
@khera you should now be able to use a custom admin_email and sender_name for your inbucket config by removing those values from your smtp config and placing them under your inbucket config instead like so:
[inbucket]
enabled = true# Port to use for the email testing server web interface.port = 54324# Uncomment to expose additional ports for testing user applications that send emails.# smtp_port = 54325# pop3_port = 54326admin_email = "support@mydomain.com"sender_name = "MyProject DEV"
Then you should be able to try it out with the latest cli @beta tag like so: npx supabase@beta start.
Hi there! The fix for this issue is now live in production. If you encounter any further problems, feel free to reopen the issue. Thanks for your patience!
Activity
khera commentedon Nov 19, 2024
Clarification: it seems that if any
auth.email.smtpsettings are made, you now require all (host, port, user, pass) of them to be set.My current configuration is
Now it is demanding I set all the other fields, but there's no guidance as to what those should be to work with inbucket in the sample
config.tomlin a new project. I set the following, but the auth service cannot still send any email, it returns 500 error status.I also tried host = "host.docker.internal"
It would be helpful to add those notes in the config.toml in a new project, and to have a "migrate" function of the CLI to bring my config file up to current, keeping existing settings I changed.
sweatybridge commentedon Nov 20, 2024
Thanks for reporting this issue. I wasn't expecting users to configure inbucket
[auth.email.smtp]because the original comment was to configure a production ready custom smtp server. However, we also didn't perform any validations previously so this unintentionally became a breaking change.Going forward, I wouldn't recommend updating
smtpto inbucket host and port because those values won't make sense for branching use cases. We are also planning to switch to mailpit for better UI.But if this is necessary to unblock, you can use the following settings for the time being.
I will update this thread again after we come to a firm decision internally.
khera commentedon Nov 20, 2024
Thanks for the info. I set up the config as you show above, keeping my admin_email and sender_name, (and restarted local dev) but I continue to get the error sending the recovery mail, Error sending recovery email
on the dashboard it shows this in the auth log:
avallete commentedon Nov 22, 2024
I think there's a circular issue between
gotrueandinbucket. If you provide a non-empty username/password, it expects encryption to be enabled, which fails with inbucket. The way I got inbucket and SMTP working together was by disabling the validation for SMTP user/password in the cli source code. With this configuration, emails are sent properly to inbucket:Otherwise, as long as
smtp.userandsmtp.passare set to non-empty values, the auth container throws a 500 error:The solution I found to retain SMTP validation and allow email/sender customization is to support
sender_nameandadmin_emailunder theinbucketsection of the configuration. This is a draft proposal as it'll still be a breaking change that'll require config update.See: #2908
@khera Currently you won't be able to use both inbucket and
smtpcustom email/sender_name configuration.avallete commentedon Nov 25, 2024
@khera you should now be able to use a custom admin_email and sender_name for your
inbucketconfig by removing those values from yoursmtpconfig and placing them under yourinbucketconfig instead like so:Then you should be able to try it out with the latest cli
@betatag like so:npx supabase@beta start.avallete commentedon Dec 18, 2024
Hi there! The fix for this issue is now live in production. If you encounter any further problems, feel free to reopen the issue. Thanks for your patience!