Back

Error Sending Email, Failed to create connection

  • 0
  • Self Hosted
  • Databases
  • Messaging
ZachHandley
12 Apr, 2024, 19:55
TypeScript
[Worker] Worker 0 is ready!
Worker mails  started
[Job] Received Job (66198f51670c90.43559084).
[Job] (66198f51670c90.43559084) failed to run.
[Job] (66198f51670c90.43559084) Error sending mail: SMTP Error: Could not authenticate.
Fatal error: Uncaught Exception: Failed to create connection: SQLSTATE[HY000] [1045] Access denied for user ''@'172.21.0.6' (using password: NO) in /usr/src/code/vendor/utopia-php/pools/src/Pools/Pool.php:193

Stack trace:
#0 /usr/src/code/app/worker.php(48): Utopia\Pools\Pool->pop()
#1 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(99): {closure}(Object(Utopia\Cache\Cache), Object(Utopia\Registry\Registry))
#2 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(119): Utopia\Queue\Server->getResource('dbForConsole')
#3 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(99): Utopia\Queue\Server->getResources(Array)
#4 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(388): Utopia\Queue\Server->getResource('project')
#5 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(295): Utopia\Queue\Server->getArguments(Object(Utopia\Hook))
#6 [internal function]: Utopia\Queue\Server->Utopia\Queue\{closure}('0')
#7 /usr/src/code/vendor/utopia-php/queue/src/Queue/Adapter/Swoole.php(37): call_user_func(Object(Closure), '0')
#8 [internal function]: Utopia\Queue\Adapter\Swoole->Utopia\Queue\Adapter\{closure}(Object(Swoole\Process\Pool), '0')

}
  thrown in /usr/src/code/vendor/utopia-php/pools/src/Pools/Pool.php on line 193

just trying to send an email, 1.5.3

TL;DR
Developers encountering an error while sending emails, speculating on the root cause being related to messaging functionality. Suggests restarting container, checking SQL environment variables, and verifying mail worker container setup. Eventually discovered the issue was with mailgun and a disallowed IP, not related to SQL. Mention of a potential bug in version 1.5.3 regarding missing environment variables. Recommends thoroughly checking all variables as per documentation.
ZachHandley
12 Apr, 2024, 20:26

@VincentGe I need help from you guys here

VincentGe
12 Apr, 2024, 20:30

@Steven Ideas?

ZachHandley
12 Apr, 2024, 20:31

mailgun is not receiving it and I've confirmed ENV vars are fine

Steven
12 Apr, 2024, 20:36

It's gotta be an auth problem. Double triple check all the environment variables mentioned in our docs

ZachHandley
12 Apr, 2024, 20:40

okay apparently it's just mailgun with a disallowed IP, for future reference

ZachHandley
12 Apr, 2024, 20:40

but that error is weird

ZachHandley
12 Apr, 2024, 20:40

why did it say no username is not allowed as an SQL error?

ZachHandley
12 Apr, 2024, 20:40

probably just a bug I presume

ideclon
14 Apr, 2024, 02:22

Isn’t this a known bug in 1.5.3? Missing envvars on some containers?

ZachHandley
14 Apr, 2024, 15:04

No apparently it just was mailgun and a weird error

ZachHandley
14 Apr, 2024, 15:04

Cause the error went away 🤷‍♂️

ideclon
14 Apr, 2024, 15:06

Are you sure it’s actually gone away? The emails may be sending, but that error might still be there? Does the mail worker container actually have the SQL envvars?

ZachHandley
14 Apr, 2024, 15:07

Well if it didn’t it wouldn’t have sent the email regardless of the SQL haha

Steven
14 Apr, 2024, 15:08

Restart the container and you might see the error again 😜

ZachHandley
14 Apr, 2024, 15:09

hahaha I am thinking maybe it has something to do with Messaging functionality but not using it to send a team invite or something

ZachHandley
14 Apr, 2024, 15:09

Dunno

dadopemaker
25 Apr, 2024, 11:01

hello. i got the same issue and i cant figure out what the problem is. can someone help

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more