plane
plane copied to clipboard
[bug]: Cannot send registration email for new member
Is there an existing issue for this?
- [X] I have searched the existing issues
Current behavior
I'm trying to test this on a public domain, i.e. I need to create a new user so that I can delete the default user (for which I can't change the password as it seems) - but that mail never gets sent.
Steps to reproduce
I'm setting
EMAIL_HOST="server:port" EMAIL_HOST_USER="user" EMAIL_HOST_PASSWORD="password"
source the .env and restart the stack, then add a new member in the UI.
I do get a green toast message, but no mail is being sent and there is also no error or anything in the docker logs of planerqworker so I wonder if this is even implemented yet?
Browser
Mozilla Firefox
Version
Self-hosted
Hello @arminus, looks like the error is in your EMAIL_HOST
variable can you please provide EMAIL_PORT
as separate variable, you can add the EMAIL_PORT
as a separate variable in the environment file.
Same issue here. I do get a green toast message, but no mail is being sent and there is also no error or anything in the docker logs of planerqworker or planebackend
planebackendlog - "GET /api/workspaces/workspace/invitations/ HTTP/1.1" 200
Using Amazon SES SMTP credentials. Is there any way we can debug the issue.
Hi @techguruagi, it would be awesome if you could send logs of the bgworker container.
@pablohashescobar
[2023-06-04 21:51:56,802: INFO/MainProcess] Task plane.bgtasks.issue_activites_task.issue_activity[207d76bb-91b2-4c08-9d9e-4fb202579189] received [2023-06-04 21:51:56,854: INFO/ForkPoolWorker-8] Task plane.bgtasks.issue_activites_task.issue_activity[207d76bb-91b2-4c08-9d9e-4fb202579189] succeeded in 0.04990960500435904s: None [2023-06-04 21:52:21,815: INFO/MainProcess] Task plane.bgtasks.issue_activites_task.issue_activity[6a7232bb-9a91-428d-81b5-be3200654910] received [2023-06-04 21:52:21,872: INFO/ForkPoolWorker-8] Task plane.bgtasks.issue_activites_task.issue_activity[6a7232bb-9a91-428d-81b5-be3200654910] succeeded in 0.054240596015006304s: None [2023-06-05 13:09:47,501: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[cfdb5bef-f6fc-40c2-b719-92cdb403eaeb] received [2023-06-05 13:09:47,593: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[cfdb5bef-f6fc-40c2-b719-92cdb403eaeb] succeeded in 0.0891377029765863s: None [2023-06-05 13:20:07,303: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[ef115901-b976-4100-b926-ef6fbd3cdbc6] received [2023-06-05 13:20:07,370: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[ef115901-b976-4100-b926-ef6fbd3cdbc6] succeeded in 0.06337625999003649s: None [2023-06-05 14:16:23,964: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[01b75160-5923-4507-82cd-a90b6b60f50e] received [2023-06-05 14:16:24,042: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[01b75160-5923-4507-82cd-a90b6b60f50e] succeeded in 0.07480859800125472s: None [2023-06-05 14:22:57,779: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[89e4ab2f-cc89-461d-acf6-a2a0867c65f4] received [2023-06-05 14:22:57,823: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[89e4ab2f-cc89-461d-acf6-a2a0867c65f4] succeeded in 0.04185305698774755s: None
Having the same problem. Could someone give some more information on what to put in the email host. Is it the SMTP server?
Hi, could you please verify if TLS is currently enabled? As per the settings, it is enabled for all instances. Additionally, I have created a pull request (#1206) to ensure that this setting is properly passed through the environment.
Is the EMAIL_FROM
field filled in?
Otherwise you’ll be sending from the default sender, which most smtp servers won’t allow.
Also, try make sure you have the last version of the docker-compose.yml file!
@pablohashescobar
Pulled the latest code and added TLS =1 in the env. Still the issue exists.
Is the
EMAIL_FROM
field filled in?Otherwise you’ll be sending from the default sender, which most smtp servers won’t allow.
Also, try make sure you have the last version of the docker-compose.yml file!
Yes, Have EMAIL_FROM value properly set
Hey
I encountered the same issue here, with the EMAIL_HOST
EMAIL_PORT
EMAIL_USERNAME
EMAIL_PASSWORD
set in the worker docker compose..
If you need more logs than what it was provided, feel free to ask
Hello! we have made updates to the Docker setup. We would greatly appreciate it if you could take some time to test the new setup and check if this issue was fixed as our team could not replicate this issue.
@pablohashescobar
The issue still exists. Emails are not delivered and infact there are no errors as well.
Hi @techguruagi, we are unable to reproduce this at our end there is an additional setting EMAIL_USE_SSL
that is false by default we will update the setup to use this value as well from environment.
@pablohashescobar
That is possible. Just tried setting up the email setup for another tool using the same credentials and faced "SSL routines:ssl3_get_record:wrong version number" error, when the USE_SSL is true. Email worked when i set it to false.
However you are saying in the Plane, EMAIL_USE_SSL is by default false. Anyway let me wait for the changes to use this value from the env to test and confirm
@pablohashescobar
Pls share if there is any update on this.
Hi @techguruagi, I'm unable to replicate the issue at the moment. However, it appears that there might be an SSL problem. To address this, we're planning to introduce an additional environment variable that can control the SSL settings for the backend container. Our team is actively working on implementing this solution, and we'll share the development build shortly. Thank you for your patience.
Same issue here
Hello, I appreciate for the great work you have done on this project.
I am currently using a self-hosting setup via Docker, and I am experiencing the same issue. I have conducted some checks to try and identify the problem. If there is any log or data that could assist in identifying the issue, please let me know and I will gladly provide it.
This issue is preventing my team from using the platform, and it would be great to have it resolved as soon as possible.
Upon checking the request flow for registration and forgot email, everything seems to be functioning correctly, as @pablohashescobar has mentioned. I have also checked the docker-compose
log for the plane-worker
and plane-api
services, and there are no errors present.
The default Django email sending process and also the configurations are OK, I tested the flow via the django-shell
.
from django.core.mail import send_mail
send_mail(
"Subject here",
"Here is the message.",
"[email protected]",
["[email protected]"],
fail_silently=False,
)
I have copied the code from the official docs. https://docs.djangoproject.com/en/4.2/topics/email
However, when I tested the default Django email sending process and configurations via the django-shell
, the code worked perfectly. The issue seems to be with the forgot_password
function located in apiserver/plane/bgtasks/forgot_password_task.py
. Here is the code:
https://github.com/makeplane/plane/blob/cf8c902473cf3a5f1fdffd7d0a4a605072186a5d/apiserver/plane/bgtasks/forgot_password_task.py#L15-L41
I have also ensured that no exceptions are raised during the email sending process.
Thank you for your attention to this matter, and I hope we can work together to find a solution to this issue.
Dear team, I believe I've spotted the problem. There is no bug in the system!
After thorough investigation, I have realized that there is no actual bug in the system. However, I did identify a problem with the broad exception handler on line 39 of the forgot_password_task.py
file.
https://github.com/makeplane/plane/blob/cf8c902473cf3a5f1fdffd7d0a4a605072186a5d/apiserver/plane/bgtasks/forgot_password_task.py#L35-L41
Upon further inspection, I discovered that the issue was caused by an incorrect FROM_ADDRESS
in my .env
file, which was not registered on the SMTP server. Unfortunately, there were no logs available to indicate this error, and it appears that the assumption was made that all users would rely on Sentry to view errors.
I believe it would be beneficial to refactor the code to include logging messages for exceptions, allowing users to debug their configurations without relying on Sentry.
This would be especially useful for cases like mine where Sentry is not present in the stack.
I hope @arminus's issue be fixed by reviewing the .env
variables too. :v:
Thank you for your attention to this matter.
Hi @Farhaduneci, thank you for the update and thanks for the suggestion we will work on enabling logging for the background workers.
Hi, there is an additional env which can be used for configuring the SSL EMAIL_USE_SSL
which can be used to enable/disable the SSL setting. We have also enabled logs for background jobs when the DEBUG
value is set to 1
.
Any update on this one? I tried all possible combinations, including adding FROM_ADDRESS, setting different EMAIL_PORT and corresponding EMAIL_USE_TLS and EMAIL_USE_SSL settings, but still no success.
Here are my complete config settings, just to make sure we are talking about the same things.
EMAIL_HOST=mail.server.com
[email protected]
EMAIL_HOST_PASSWORD=password
EMAIL_PORT=587/465
[email protected]
EMAIL_USE_TLS=1/0
EMAIL_USE_SSL=0/1
additionarly i tried adding the following value:
[email protected]
help very much appreciated.
Hi @nolexio, can you check if the email has been verified in the smtp also you can enable logs if you switch to debug mode to print the errors to stdout.
Hi @nolexio, can you check if the email has been verified in the smtp also you can enable logs if you switch to debug mode to print the errors to stdout.
I've set DEBUG=1
.
Worker
Waiting for database...
Database available!
-------------- celery@c9a0450faf15 v5.2.7 (dawn-chorus)
--- ***** -----
-- ******* ---- Linux-6.1.0-9-amd64-x86_64-with 2023-07-04 00:16:37
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: plane:0x7f02f3faf110
- ** ---------- .> transport: redis://plane-redis:6379//
- ** ---------- .> results: redis://plane-redis:6379/
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
[tasks]
. plane.bgtasks.analytic_plot_export.analytic_export_task
. plane.bgtasks.email_verification_task.email_verification
. plane.bgtasks.forgot_password_task.forgot_password
. plane.bgtasks.importer_task.service_importer
. plane.bgtasks.issue_activites_task.issue_activity
. plane.bgtasks.magic_link_code_task.magic_link
. plane.bgtasks.project_invitation_task.project_invitation
. plane.bgtasks.user_welcome_task.send_welcome_slack
. plane.bgtasks.workspace_invitation_task.workspace_invitation
[2023-07-04 00:16:37,250: INFO/MainProcess] Connected to redis://plane-redis:6379//
[2023-07-04 00:16:37,253: INFO/MainProcess] mingle: searching for neighbors
[2023-07-04 00:16:38,262: INFO/MainProcess] mingle: all alone
[2023-07-04 00:16:38,269: WARNING/MainProcess] /usr/local/lib/python3.11/site-packages/celery/fixups/django.py:203: UserWarning: Using settings.DEBUG leads to a memory
leak, never use this setting in production environments!
warnings.warn('''Using settings.DEBUG leads to a memory
[2023-07-04 00:16:38,269: INFO/MainProcess] celery@c9a0450faf15 ready.
[2023-07-04 00:18:31,019: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[6f4693f6-0153-4d4c-a122-411e8d23d796] received
[2023-07-04 00:20:41,834: WARNING/ForkPoolWorker-4] [Errno 110] Operation timed out
[2023-07-04 00:20:41,837: INFO/ForkPoolWorker-4] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[6f4693f6-0153-4d4c-a122-411e8d23d796] succeeded in 130.81653589299822s: None
API
[2023-07-04 00:16:38 +0530] [14] [INFO] Application startup complete.
[2023-07-04 00:16:38 +0530] [13] [INFO] Started server process [13]
[2023-07-04 00:16:38 +0530] [13] [INFO] Waiting for application startup.
[2023-07-04 00:16:38 +0530] [13] [INFO] ASGI 'lifespan' protocol appears unsupported.
[2023-07-04 00:16:38 +0530] [13] [INFO] Application startup complete.
[2023-07-04 00:16:38 +0530] [17] [INFO] Started server process [17]
[2023-07-04 00:16:38 +0530] [17] [INFO] Waiting for application startup.
[2023-07-04 00:16:38 +0530] [17] [INFO] ASGI 'lifespan' protocol appears unsupported.
[2023-07-04 00:16:38 +0530] [17] [INFO] Application startup complete.
GET - /api/users/me/ of Queries: 7
10.30.3.2:33372 - "GET /api/users/me/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 7
10.30.3.2:33372 - "GET /api/users/me/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 7
10.30.3.2:33388 - "GET /api/users/me/ HTTP/1.1" 200
GET - /api/users/me/workspaces/ of Queries: 2
10.30.3.2:33382 - "GET /api/users/me/workspaces/ HTTP/1.1" 200
GET - /api/users/me/invitations/workspaces/ of Queries: 2
10.30.3.2:33382 - "GET /api/users/me/invitations/workspaces/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 7
GET - /api/users/me/ of Queries: 7
10.30.3.2:51518 - "GET /api/users/me/ HTTP/1.1" 200
GET - /api/users/me/workspaces/ of Queries: 2
10.30.3.2:51518 - "GET /api/users/me/workspaces/ HTTP/1.1" 200
GET - /api/users/me/invitations/workspaces/ of Queries: 2
10.30.3.2:51518 - "GET /api/users/me/invitations/workspaces/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 0
Unauthorized: /api/users/me/
Unauthorized: /api/users/me/
10.30.3.2:58676 - "GET /api/users/me/ HTTP/1.1" 401
GET - /api/users/me/ of Queries: 0
Unauthorized: /api/users/me/
Unauthorized: /api/users/me/
10.30.3.2:58678 - "GET /api/users/me/ HTTP/1.1" 401
POST - /api/sign-in/ of Queries: 1
Forbidden: /api/sign-in/
Forbidden: /api/sign-in/
10.30.3.2:44116 - "POST /api/sign-in/ HTTP/1.1" 403
POST - /api/sign-in/ of Queries: 1
Forbidden: /api/sign-in/
Forbidden: /api/sign-in/
10.30.3.2:44116 - "POST /api/sign-in/ HTTP/1.1" 403
POST - /api/sign-in/ of Queries: 1
Forbidden: /api/sign-in/
Forbidden: /api/sign-in/
10.30.3.2:44126 - "POST /api/sign-in/ HTTP/1.1" 403
POST - /api/sign-in/ of Queries: 5
10.30.3.2:59512 - "POST /api/sign-in/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 6
10.30.3.2:59512 - "GET /api/users/me/ HTTP/1.1" 200
GET - /api/users/me/workspaces/ of Queries: 3
10.30.3.2:59512 - "GET /api/users/me/workspaces/ HTTP/1.1" 200
GET - /api/users/me/workspaces/projekte/dashboard/?month=7 of Queries: 5
10.30.3.2:59512 - "GET /api/users/me/workspaces/projekte/dashboard/?month=7 HTTP/1.1" 200
GET - /api/workspaces/projekte/workspace-members/me/ of Queries: 5
10.30.3.2:59520 - "GET /api/workspaces/projekte/workspace-members/me/ HTTP/1.1" 200
GET - /api/users/me/workspaces/projekte/dashboard/?month=7 of Queries: 5
10.30.3.2:59520 - "GET /api/users/me/workspaces/projekte/dashboard/?month=7 HTTP/1.1" 200
GET - /api/users/me/workspaces/ of Queries: 3
10.30.3.2:59528 - "GET /api/users/me/workspaces/ HTTP/1.1" 200
GET - /api/workspaces/projekte/projects/ of Queries: 3
10.30.3.2:59512 - "GET /api/workspaces/projekte/projects/ HTTP/1.1" 200
GET - /api/workspaces/projekte/user-favorite-projects/ of Queries: 2
10.30.3.2:59534 - "GET /api/workspaces/projekte/user-favorite-projects/ HTTP/1.1" 200
GET - /api/workspaces/projekte/ of Queries: 2
10.30.3.2:59546 - "GET /api/workspaces/projekte/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 6
10.30.3.2:59560 - "GET /api/users/me/ HTTP/1.1" 200
GET - /api/users/me/workspaces/ of Queries: 3
10.30.3.2:59574 - "GET /api/users/me/workspaces/ HTTP/1.1" 200
GET - /api/workspaces/projekte/projects/ of Queries: 6
10.30.3.2:59578 - "GET /api/workspaces/projekte/projects/ HTTP/1.1" 200
GET - /api/workspaces/projekte/user-favorite-projects/ of Queries: 2
10.30.3.2:59592 - "GET /api/workspaces/projekte/user-favorite-projects/ HTTP/1.1" 200
GET - /api/workspaces/projekte/workspace-members/me/ of Queries: 5
10.30.3.2:59562 - "GET /api/workspaces/projekte/workspace-members/me/ HTTP/1.1" 200
GET - /api/workspaces/projekte/invitations/ of Queries: 3
10.30.3.2:59608 - "GET /api/workspaces/projekte/invitations/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 6
GET - /api/users/me/workspaces/ of Queries: 3
10.30.3.2:59624 - "GET /api/users/me/ HTTP/1.1" 200
10.30.3.2:59660 - "GET /api/users/me/workspaces/ HTTP/1.1" 200
GET - /api/workspaces/projekte/user-favorite-projects/ of Queries: 2
10.30.3.2:59668 - "GET /api/workspaces/projekte/user-favorite-projects/ HTTP/1.1" 200
GET - /api/workspaces/projekte/workspace-members/me/ of Queries: 5
10.30.3.2:59636 - "GET /api/workspaces/projekte/workspace-members/me/ HTTP/1.1" 200
GET - /api/workspaces/projekte/projects/ of Queries: 8
10.30.3.2:59646 - "GET /api/workspaces/projekte/projects/ HTTP/1.1" 200
GET - /api/workspaces/projekte/ of Queries: 2
GET - /api/workspaces/projekte/members/ of Queries: 3
10.30.3.2:59678 - "GET /api/workspaces/projekte/ HTTP/1.1" 200
10.30.3.2:59604 - "GET /api/workspaces/projekte/members/ HTTP/1.1" 200
DELETE - /api/workspaces/projekte/invitations/c70ea5fd-34f9-4eaf-97d7-bcd27b0d2184/ of Queries: 4
10.30.3.2:48478 - "DELETE /api/workspaces/projekte/invitations/c70ea5fd-34f9-4eaf-97d7-bcd27b0d2184/ HTTP/1.1" 204
POST - /api/workspaces/projekte/invite/ of Queries: 7
10.30.3.2:37860 - "POST /api/workspaces/projekte/invite/ HTTP/1.1" 200
GET - /api/workspaces/projekte/invitations/ of Queries: 3
10.30.3.2:37860 - "GET /api/workspaces/projekte/invitations/ HTTP/1.1" 200
GET - /api/users/me/ of Queries: 7
10.30.3.2:49486 - "GET /api/users/me/ HTTP/1.1" 200
Hi @nolexio, the operations are getting timed out can you check if the smtp server is responding well?
I'm using the exact same settings on a different project, where everything is working just fine.
Got it @nolexio, can you maybe check with another smtp server because looks like the server is not responding which is causing a operation timeout.
@pablohashescobar
[2023-06-04 21:51:56,802: INFO/MainProcess] Task plane.bgtasks.issue_activites_task.issue_activity[207d76bb-91b2-4c08-9d9e-4fb202579189] received [2023-06-04 21:51:56,854: INFO/ForkPoolWorker-8] Task plane.bgtasks.issue_activites_task.issue_activity[207d76bb-91b2-4c08-9d9e-4fb202579189] succeeded in 0.04990960500435904s: None [2023-06-04 21:52:21,815: INFO/MainProcess] Task plane.bgtasks.issue_activites_task.issue_activity[6a7232bb-9a91-428d-81b5-be3200654910] received [2023-06-04 21:52:21,872: INFO/ForkPoolWorker-8] Task plane.bgtasks.issue_activites_task.issue_activity[6a7232bb-9a91-428d-81b5-be3200654910] succeeded in 0.054240596015006304s: None [2023-06-05 13:09:47,501: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[cfdb5bef-f6fc-40c2-b719-92cdb403eaeb] received [2023-06-05 13:09:47,593: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[cfdb5bef-f6fc-40c2-b719-92cdb403eaeb] succeeded in 0.0891377029765863s: None [2023-06-05 13:20:07,303: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[ef115901-b976-4100-b926-ef6fbd3cdbc6] received [2023-06-05 13:20:07,370: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[ef115901-b976-4100-b926-ef6fbd3cdbc6] succeeded in 0.06337625999003649s: None [2023-06-05 14:16:23,964: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[01b75160-5923-4507-82cd-a90b6b60f50e] received [2023-06-05 14:16:24,042: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[01b75160-5923-4507-82cd-a90b6b60f50e] succeeded in 0.07480859800125472s: None [2023-06-05 14:22:57,779: INFO/MainProcess] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[89e4ab2f-cc89-461d-acf6-a2a0867c65f4] received [2023-06-05 14:22:57,823: INFO/ForkPoolWorker-8] Task plane.bgtasks.workspace_invitation_task.workspace_invitation[89e4ab2f-cc89-461d-acf6-a2a0867c65f4] succeeded in 0.04185305698774755s: None
Where are the logs located?
Hi! I'm having the same issue: when I click on "Send reset link" on the "Reset your password" page, a green success message appears, indicating that the email was successfully sent, but I never receive them. I use the exact same SMPT settings in Nextcloud and emails are sent. In case you were wondering, because I use the Gmail SMTP service, the password is a Google app-password. Also, a red error message appears when I try to enter an email that does not belong to a registered user, so that's apparently not a bug while searching for the user account from its email.
.env
# Email Settings
EMAIL_HOST="smtp.gmail.com"
EMAIL_HOST_USER="<myemail>@gmail.com"
EMAIL_HOST_PASSWORD="<mypassword>"
EMAIL_PORT=465
EMAIL_FROM="Plane <<myemail>@gmail.com>>"
EMAIL_USE_TLS="1"
EMAIL_USE_SSL="1"
Logs indicate that the user is found and that the email is sent:
bgworker logs
2023/09/27 13:46:33,stderr,"[2023-09-27 20:46:33,360: INFO/ForkPoolWorker-4] Task plane.bgtasks.forgot_password_task.forgot_password[4bf389f1-beeb-47db-8052-2d17488f284c] succeeded in 0.06332088448107243s: None
"
2023/09/27 13:46:33,stderr,"[2023-09-27 20:46:33,295: INFO/MainProcess] Task plane.bgtasks.forgot_password_task.forgot_password[4bf389f1-beeb-47db-8052-2d17488f284c] received
Any idea of what could cause this?
Same question +1