Pulses to Gmail

Hi

I’m trying to configure pulses to be sent to my work email address which is based on Gmail services.
I followed the instructions and read advices and discussion of similar issues and yet the process fails.

My configuration details:

SMTP host: smtp.gmail.com
SMTP port: 465
SMTP security: ssl
SMTP USERNAME: my work email
SMTP PASSWORD: used Google app password
FROM ADDRESS: my work email

Receiving the following error msg:

No matching clause: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials a12sm138305eje.70 - gsmtp

Thanks

1 Like

Hi @Michael1
Which version of Metabase? Please post “Diagnostic Info” from Admin > Troubleshooting.
I would recommend using TLS instead of SSL, and change port to 587.
Did you follow the troubleshooting steps in https://support.google.com/mail/?p=BadCredentials ?
Can you use the same credentials with another mail client?

Hi @flamber
thanks for your replay
I’ve read and tried to do what appears on the troubleshooting but it didn’t help.
I’m using metabase v0.34.2.
Tried all other option for port and TLS/SSL - non of them worked.
Diagnostic info:

{
“browser-info”: {
“language”: “en-US”,
“platform”: “MacIntel”,
“userAgent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.5+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.5”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.5+10”,
“os.name”: “Linux”,
“os.version”: “4.14.158-101.185.amzn1.x86_64”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“googleanalytics”,
“mysql”,
“h2”
],
“hosting-env”: “elastic-beanstalk”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “9.6.11”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-02-04”,
“tag”: “v0.34.2”,
“branch”: “release-0.34.x”,
“hash”: “dab738c”
},
“settings”: {
“report-timezone”: “Asia/Jerusalem”
}
}
}

@Michael1
Can you use the same credentials with another mail client?
Have you enabled 2FA on your Google work account, since you say you’re using App Password?

@flamber

I’ve enabled 2FA on my Google account.
I didn’t understand what did you mean by: “use the same credentials with another mail client” ?

@Michael1 Simply try to use the exact same configurations in another email client (Outlook, Thunderbird, Mail.app, etc). I’ve just tried to setup a Gmail account with 2FA on Metabase and it works.

Though I noticed that the password displayed on App Password is split into segments and when you copy it, it might have spaces before/after too, so make sure that the password does not have any spaces anywhere, when inputting it into Metabase.

@flamber

Hi again ,

tried what you’ve suggested (checked that the password was copied correctly, configured gmail on another app), but it didn’t work on metabase

@Michael1
Do you see any other errors/warning at the same time in the log? Admin > Troubleshooting > Logs
Remember that you need to configure SMTP on the other mail client, since many clients are now smart, so they’ll do a lot of magic for you, when setting up a Gmail account.

@flamber

No, no other errors / warnings, and I prefer working with the Gmail client and not the other email clients. I configured one just to check the App password.
As I wrote i followed the instruction and read few posts related and yet can’t configure metabase to send pulses to Gmail

@Michael1 Okay, I’m not sure why it isn’t working for you.

I just setup a new system and did the full configuration.

  1. Metabase > Admin > Settings > Email
    • SMTP Host: smtp.gmail.com
    • SMTP Port: 587 (input the numbers)
    • SMTP Security: TLS
    • SMTP Username: your email address - example@gmail.com or you@example.com if it is a G-Suite account
    • SMTP Password: 16-character App Password, without any spaces before/between/after, generated via https://myaccount.google.com/apppasswords (select Other/custom and call it “Metabase”), and make sure you’re setting it up for the correct account if you’re using multiple Google accounts.
    • From Address: same as “SMTP Username”
  2. Save changes, and click “Send test mail”

Two things that mess up the process:

  • Too clever password managers in the browser that replaces the App Password with something else, when you’re inputting the other information.
  • Firewall/antivirus that is too aggressive, so they’re blocking or intercepting the connection. See this topic for more about that: Using regular gmail as email sender

@flamber

These are exactly the steps I did.
I even copied the 16-char password to another place, removed the spaces and then paste it into the relevant field.
I’ve read the topic you mentioned in your answer before I posted here.
I really appreciate all those advices, but I’m just repeating the same things that others already tried and failed.
Do you know if someone from metabase also present on the discussion page? Maybe they can offer an explanation?

Thanks

@Michael1 I am from Metabase :wink:
If Metabase didn’t work with Gmail SMTP, then there would have been a lot of reports.
Please go to Admin > Settings > Email > click Clear button in the bottom to remove the configuration and start over. Also remove the App Password and generate a new one.
And then check the log for any warnings/errors. Admin > Troubleshooting > Logs

@flamber
My apologies
It seems at first as if this an “experts forum” or “community forum”, I didn’t realize you are from metabase.
I did as you suggested and tried to set the all process from the beginning and unfortunately got the same result.

@Michael1
No worries. It is a community forum, but it’s also a good place for troubleshooting.
Can you do everything again, and post the entire log from Metabase startup until “Send test mail” generates the error?

@flamber

Added the log below.
I didn’t tested the “sent email” because the configuration itself failed.

[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:05:04+02:00 DEBUG metabase.middleware.log GET /api/util/bug_report_details 200 3.5 ms (1 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (82 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:31+02:00 DEBUG metabase.middleware.log GET /api/session/properties 200 2.5 ms (1 DB calls) Jetty threads: 4/50 (3 idle, 0 queued) (84 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:31+02:00 DEBUG metabase.middleware.log GET /api/user/current 200 5.3 ms (3 DB calls) Jetty threads: 4/50 (3 idle, 0 queued) (84 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:31+02:00 DEBUG metabase.middleware.log GET /api/user/current 200 3.6 ms (3 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:31+02:00 DEBUG metabase.middleware.log GET /api/database 200 4.7 ms (3 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:32+02:00 DEBUG metabase.middleware.log GET /api/collection/root/items 200 8.7 ms (7 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:32+02:00 DEBUG metabase.middleware.log GET /api/setting 200 541.6 µs (0 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:32+02:00 DEBUG metabase.middleware.log GET /api/collection/root 200 3.2 ms (2 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:32+02:00 DEBUG metabase.middleware.log GET /api/database 200 4.7 ms (3 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:32+02:00 DEBUG metabase.middleware.log GET /api/automagic-dashboards/database/4/candidates 200 11.5 ms (6 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:37+02:00 DEBUG metabase.middleware.log GET /api/session/properties 200 2.5 ms (1 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:37+02:00 DEBUG metabase.middleware.log GET /api/setup/admin_checklist 200 13.9 ms (11 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:06:37+02:00 DEBUG metabase.middleware.log GET /api/setting 200 456.8 µs (0 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (85 total active threads) Queries in flight: 0
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:08:29+02:00 ERROR metabase.email Error testing SMTP connection
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:08:29+02:00 ERROR metabase.email Error testing SMTP connection
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:08:30+02:00 ERROR metabase.email Error testing SMTP connection
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:08:30+02:00 ERROR metabase.email Error testing SMTP connection
[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:08:31+02:00 WARN metabase.api.email Problem connecting to mail server: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials t1sm6549069wma.43 - gsmtp

[e0126da4-c1b6-4e1d-bb18-b7cbc04e000b] 2020-02-27T09:08:31+02:00 ERROR metabase.middleware.log PUT /api/email 500 2.4 s (0 DB calls)
{:message “No matching clause: 535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8 https://support.google.com/mail/?p=BadCredentials t1sm6549069wma.43 - gsmtp\n”,
:type java.lang.IllegalArgumentException,
:stacktrace
("–> api.email$humanize_error_messages.invokeStatic(email.clj:35)"
“api.email$humanize_error_messages.invoke(email.clj:26)”
“api.email$fn__54122.invokeStatic(email.clj:95)”
“api.email$fn__54122.invoke(email.clj:70)”
“middleware.auth$enforce_authentication$fn__66187.invoke(auth.clj:14)”
“routes$fn__67541$fn__67542.doInvoke(routes.clj:56)”
“middleware.exceptions$catch_uncaught_exceptions$fn__66286.invoke(exceptions.clj:97)”
“middleware.exceptions$catch_api_exceptions$fn__66283.invoke(exceptions.clj:85)”
“middleware.log$log_api_call$fn__67917$fn__67918.invoke(log.clj:178)”
“middleware.log$log_api_call$fn__67917.invoke(log.clj:172)”
“middleware.security$add_security_headers$fn__66249.invoke(security.clj:121)”
“middleware.json$wrap_json_body$fn__67622.invoke(json.clj:64)”
“middleware.json$wrap_streamed_json_response$fn__67640.invoke(json.clj:100)”
“middleware.misc$maybe_set_site_url$fn__67946.invoke(misc.clj:58)”
“middleware.session$bind_current_user$fn__62772$fn__62773.invoke(session.clj:209)”
“middleware.session$do_with_current_user.invokeStatic(session.clj:184)”
“middleware.session$do_with_current_user.invoke(session.clj:177)”
“middleware.session$bind_current_user$fn__62772.invoke(session.clj:208)”
“middleware.session$wrap_current_user_id$fn__62757.invoke(session.clj:161)”
“middleware.session$wrap_session_id$fn__62701.invoke(session.clj:125)”
“middleware.auth$wrap_api_key$fn__66195.invoke(auth.clj:27)”
“middleware.misc$bind_user_locale$fn__67949.invoke(misc.clj:74)”
“middleware.misc$add_content_type$fn__67932.invoke(misc.clj:29)”
“middleware.misc$disable_streaming_buffering$fn__67957.invoke(misc.clj:89)”)}

@Michael1 I don’t know what’s going on. Try setting up an App Password on your private Gmail and try with that.

I am having the same issue. 2FA on and new App Passowrd generated. Same error.

I am using GSuite with my company email

@kilian Can you try from your private Gmail? So far, only two people have reported this, so I think it has something to do with the G-Suite settings. I cannot reproduce on two G-Suite domains and one Gmail.

  • Double check in Gmail that IMAP is enabled

  • Set up AppPasswords

  • Use TLS connection with port 587

  • Open ports on firewall

These should work.

@jins_incent IMAP is not required. Metabase only uses SMTP, it does not read emails. I have IMAP and POP3 disabled.