Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailer - endpoint invocation stays blocked when having mailer misconfigured #27919

Closed
rsvoboda opened this issue Sep 14, 2022 · 8 comments
Closed
Labels
area/mailer kind/bug Something isn't working
Milestone

Comments

@rsvoboda
Copy link
Member

Describe the bug

mailer - endpoint invocation stays blocked when having mailer misconfigured

when I used config based on https://quarkus.io/guides/mailer#configuring-the-mailer and invoked curl localhost:8080/mail/ I got warning and error in log

2022-09-14 09:54:06,624 WARN [io.ver.ext.mai.imp.SMTPAuthentication] (vert.x-eventloop-thread-0) io.vertx.ext.mail.SMTPException: AUTH LOGIN failed: 535 Authentication failed: Bad username / password
2022-09-14 09:54:06,634 ERROR [io.ver.ext.mai.imp.SMTPConnection] (vert.x-eventloop-thread-0) SSLEngine closed already

But curl command didn't finish, still waiting for response.
And I had to interrupt it using Ctrl+C

Endpoint invocation shouldn't be blocked, looks like Quarkus or vertx-mail-client issue.

https://quarkus.io/guides/mailer#configuring-the-mailer based config

quarkus.mailer.mock=false
quarkus.mailer.from[email protected]
quarkus.mailer.host=smtp.sendgrid.net
quarkus.mailer.port=465
quarkus.mailer.ssl=true
quarkus.mailer.username=foo
quarkus.mailer.password=bar

When using miss-configured gmail setting I received {"details":"Error id ea7bfd08-69cf-4772-9b3b-f640a2de938f-1, java.util.concurrent.CompletionException: io.vertx.ext.mail.SMTPException: AUTH PLAIN failed: 535-5.7.8 Username and Password not accepted. Learn more at","stack":"java.util.concurrent.CompletionException: io.vertx.ext.mail.SMTPException: AUTH PLAIN failed: 535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8 https://support.google.com/mail/?p=BadCredentials h20-200 ....

So maybe sendgrid doesn't provide any text response like gmail and thus quarkus app still keeps the connection open / curl command doesn't finish. but logs are indicating that authentication wasn't successful and thus the connection for curl should be closed with appropriate response code / response text.

Expected behavior

endpoint invocation doesn't stay blocked

Actual behavior

endpoint invocation stays blocked

How to Reproduce?

  • use mailer-quickstart
  • adjust application.properties
    • config described above
  • run the app - e.g. mvn clean quarkus:dev
  • run curl localhost:8080/mail

Output of uname -a or ver

macOS Monterey

Output of java -version

Java 17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Quarkus main

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@rsvoboda rsvoboda added the kind/bug Something isn't working label Sep 14, 2022
@rsvoboda
Copy link
Member Author

/cc @cescoffier

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 14, 2022

/cc @cescoffier

@gsmet
Copy link
Member

gsmet commented Sep 14, 2022

Probably a good idea to get a stacktrace of the stuck thread.

@rsvoboda
Copy link
Member Author

Full thread dump by jstack command - jstack.txt

@cescoffier
Copy link
Member

So... there is a bug and a workaround.
The is a bug in the Vert.x Mailer which emits auth command asynchronously when there is a chain, but seems to forget to report in some cases. I will open an issue on the Vert.x mailer (@vietj for your info).

The workaround consists of not using auth chain, and just adding:

quarkus.mailer.auth-methods=LOGIN

@cescoffier
Copy link
Member

Issue opened: vert-x3/vertx-mail-client#186

@cescoffier
Copy link
Member

Fixed proposed: vert-x3/vertx-mail-client#187.

@cescoffier
Copy link
Member

Closed by #28323

@rsvoboda rsvoboda added this to the 2.13.1.Final milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mailer kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants