[Bug Report]: User creation done but reported as failed to the user #2581

Closed
opened 2026-02-05 04:33:40 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @bourdaisj on GitHub (Jan 17, 2022).

Describe the Bug

When creating a user and selecting the option to send an invitation by email, I got an error like 'An unknown error occured'.
Checking the logs, I have this :

[2022-01-17 16:54:45] production.ERROR: Expected response code 220 but got an empty response {"userId":5,"exception":"[object] (Swift_TransportException(code: 0): Expected response code 220 but got an empty response at /srv/bookstack.santepros.com/BookStack/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:447)
[stacktrace]
#0 .........

So I think my email configuration is broken right ?
But the problem is that the user was created anyway, without the assigned role/roles and without the 'user_create' log.
Maybe we could wrap this in a transaction, wdyt ?

Steps to Reproduce

  • Break your bookstack email sending config
  • Create a user with email invitation
  • Normally you will get an error but the user is created if you look at the user list

Expected Behaviour

I think the user creation should fail entirely and maybe report a log entry with a high severity like : 'email sending failed' ?

Screenshots or Additional Context

No response

Exact BookStack Version

21.12

PHP Version

7.4

Hosting Environment

Ubuntu 20.04

Originally created by @bourdaisj on GitHub (Jan 17, 2022). ### Describe the Bug When creating a user and selecting the option to send an invitation by email, I got an error like 'An unknown error occured'. Checking the logs, I have this : ``` [2022-01-17 16:54:45] production.ERROR: Expected response code 220 but got an empty response {"userId":5,"exception":"[object] (Swift_TransportException(code: 0): Expected response code 220 but got an empty response at /srv/bookstack.santepros.com/BookStack/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:447) [stacktrace] #0 ......... ``` So I think my email configuration is broken right ? But the problem is that the user was created anyway, without the assigned role/roles and without the 'user_create' log. Maybe we could wrap this in a transaction, wdyt ? ### Steps to Reproduce - Break your bookstack email sending config - Create a user with email invitation - Normally you will get an error but the user is created if you look at the user list ### Expected Behaviour I think the user creation should fail entirely and maybe report a log entry with a high severity like : 'email sending failed' ? ### Screenshots or Additional Context _No response_ ### Exact BookStack Version 21.12 ### PHP Version 7.4 ### Hosting Environment Ubuntu 20.04
OVERLORD added the 🐛 Bug label 2026-02-05 04:33:40 +03:00
Author
Owner

@bourdaisj commented on GitHub (Jan 19, 2022):

@ssddanbrown Idk if you have started working on this, if not I can try and provide a PR. Let me know

@bourdaisj commented on GitHub (Jan 19, 2022): @ssddanbrown Idk if you have started working on this, if not I can try and provide a PR. Let me know
Author
Owner

@ssddanbrown commented on GitHub (Jan 19, 2022):

@Julesdevops I have not started work on this. Feel free to look to address, although I have assigned to the next patch release. If I start to wrap up the next patch release, and there's no PR, I may take this on myself.

@ssddanbrown commented on GitHub (Jan 19, 2022): @Julesdevops I have not started work on this. Feel free to look to address, although I have assigned to the next patch release. If I start to wrap up the next patch release, and there's no PR, I may take this on myself.
Author
Owner

@ssddanbrown commented on GitHub (Jan 24, 2022):

Addressed within #3179, To be part of the next patch release.

@ssddanbrown commented on GitHub (Jan 24, 2022): Addressed within #3179, To be part of the next patch release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2581