-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
An unknown error occurred when the SMTP host could not be reached #5195
Comments
When I enable debug mode: Symfony\Component\Mailer\Exception\TransportException PHP Version: 8.3.7 Details
|
There is no queue unless you specifically enable it, which will also require a queue worker as described in our documentation: Otherwise, errors will be thrown as experienced if the system is trying to mail but encounters errors. |
By adding QUEUE_CONNECTION=database to the .env file, the error is resolved. Emails should now be stored in the database if I'm not mistaken. I will look for a method to continuously run the Queue Worker Process in the Docker container once I have a functioning external SMTP server, as opposed to using our internal server. Thanks @ssddanbrown ! |
I just spent about an hour chasing this one down too when trying to add a new user. I had send the invitation checked, and because no smtp server is configured in the docker container its running in, I got unknown error. A better error message would be greatly appreciated because I was looking for errors to do with adding users, not email errors. |
@pnunn Yeah, I agree, this is likely to be the first use of email for many so adding extra specific handling for email errors for better guidance would probably be worthwhile here. |
Added specific handling to show relevant error message when user creation fails due to invite sending errors, while also returning user to the form with previous input. Includes test to cover. For #5195
Specific handling with error display (while returning the user back to the form with previous form input) has now been added via d12e8ec, which will be part of the next feature release. Thanks @mschoon85 and @pnunn for your input. |
Hi @ssddanbrown, I have updated to BookStack v24.10, but I still encounter the error 'An unknown error occurred' whenever QUEUE_CONNECTION=database is not enabled and an invalid or unreachable SMTP server is set in the .env file. Interestingly, not all books seem to be affected. New books and some existing books do not trigger this error. I’m wondering if this issue might be related to the books I follow or have followed in the past. Kind regards, Michel |
Yeah, the update changed nothing in that regard, just added better handling for the user invite flow since that's a common first encounter for email sending.
Generally I'd expect it to be watches from other users, since notifications should not be sent for your own actions, but you can see the content you're watching from your notification preferences area in "My Account", otherwise you could peek into the |
@ssddanbrown, I have cleared all rows from the watches table in the test environment, but I cannot do this in production. The unknown error has now disappeared, confirming that it was caused by watches from other users. However, this still points to a deeper underlying issue: an incorrect SMTP configuration, an SMTP address that does not exist, or one that is unreachable. Would it be reasonable to create a fix to prevent users from receiving the unknown error message? |
Describe the Bug
Hi @ssddanbrown,
I've opted to submit a separate bug report since the same issue has arisen on both our former Bookstack server (Windows) and our current one (Linux). Errors occur when creating new pages in specific books; the pages are created, but the error remains. This issue can be replicated by changing the MAIL_HOST in the .env file to a non-existent address. It's important to note that not all books are affected by this issue. Moreover, I encounter this error even when I'm not subscribed to the book anymore. Whenever I revert the MAIL_HOST to a valid address, the problems disappear. It's probable that the issue would recur if the MAIL_HOST were unreachable at the moment of saving the page.
Please inform me if you require any information from the server logs or similar resources.
Kind regards,
Michel
Steps to Reproduce
Note: The new settings with the non-existent mail host were only applied after executing php artisan config:cache. The reason for this is unclear.
Expected Behaviour
One would expect emails to accumulate in a queue until the mail host becomes available once more.
Screenshots or Additional Context
Browser Details
Edge
Exact BookStack Version
24.05.3
The text was updated successfully, but these errors were encountered: