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

Error when mail is sent to reset password #2549

Closed
ti1000 opened this issue Sep 2, 2016 · 5 comments
Closed

Error when mail is sent to reset password #2549

ti1000 opened this issue Sep 2, 2016 · 5 comments
Labels
🚫 not a bug This issue is not a bug

Comments

@ti1000
Copy link

ti1000 commented Sep 2, 2016

Expected Behavior (or desired behavior if a feature request)

Click on 'email password reset' and a email will be sent to the requester.

Actual Behavior

When 'smtp' is used as the mail driver, I'm getting the message that something went wrong.
When I put it 'mail' as the mail driver, I don't get the error message anymore but there is no mail being sent.

Please confirm you have done the following before posting your bug report:
Please provide answers to these questions before posting your bug report:

Snipe-IT version: v3.3.0-3-g7ef4f23
PHP Version: 5.6.25
Laravel Version: 5.2.43

MAIL_DRIVER=smtp
MAIL_HOST=localhost.localdomain.com
MAIL_PORT=25
MAIL_USERNAME=username@localdomain.com
MAIL_PASSWORD=*****
MAIL_ENCRYPTION=null
MAIL_FROM_ADDR=username@localdomain.com
MAIL_FROM_NAME=user

I have not edited anything in the database as well.

Error from browser:

Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host UCS-TME.localdomain.com [Connection timed out #110]

    in StreamBuffer.php line 269
    at Swift_Transport_StreamBuffer->_establishSocketConnection() in StreamBuffer.php line 62
    at Swift_Transport_StreamBuffer->initialize(array('protocol' => '', 'host' => 'UCS-TME.localdomain.com', 'port' => '25', 'timeout' => '30', 'blocking' => '1', 'tls' => false, 'type' => '1', 'stream_context_options' => array())) in AbstractSmtpTransport.php line 113
    at Swift_Transport_AbstractSmtpTransport->start() in Mailer.php line 79
    at Swift_Mailer->send(object(Swift_Message), array()) in Mailer.php line 385
    at Mailer->sendSwiftMessage(object(Swift_Message)) in Mailer.php line 171
    at Mailer->send('auth.emails.password', array('token' => 'efb6b30c34eab5ca9b50d49f5443bcb42b93359ee5449e3b0066fe732674c7ed', 'user' => object(User)), object(Closure)) in PasswordBroker.php line 119
    at PasswordBroker->emailResetLink(object(User), 'efb6b30c34eab5ca9b50d49f5443bcb42b93359ee5449e3b0066fe732674c7ed', object(Closure)) in PasswordBroker.php line 93
    at PasswordBroker->sendResetLink(array('email' => 'anthvu@cisco.com'), object(Closure)) in compiled.php line 2626
    at PasswordController->sendResetLinkEmail(object(Request))
    at call_user_func_array(array(object(PasswordController), 'sendResetLinkEmail'), array(object(Request))) in compiled.php line 9424
    at Controller->callAction('sendResetLinkEmail', array(object(Request))) in compiled.php line 9486
    at ControllerDispatcher->call(object(PasswordController), object(Route), 'sendResetLinkEmail') in compiled.php line 9466
    at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfAuthenticated.php line 24
    at RedirectIfAuthenticated->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(RedirectIfAuthenticated), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9948
    at Pipeline->then(object(Closure)) in compiled.php line 9467
    at ControllerDispatcher->callWithinStack(object(PasswordController), object(Route), object(Request), 'sendResetLinkEmail') in compiled.php line 9454
    at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Auth\PasswordController', 'sendResetLinkEmail') in compiled.php line 8524
    at Route->runController(object(Request)) in compiled.php line 8511
    at Route->run(object(Request)) in compiled.php line 8225
    at Router->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckLocale.php line 40
    at CheckLocale->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckLocale), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3225
    at VerifyCsrfToken->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13212
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13149
    at EncryptCookies->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9948
    at Pipeline->then(object(Closure)) in compiled.php line 8226
    at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 8217
    at Router->dispatchToRoute(object(Request)) in compiled.php line 8207
    at Router->dispatch(object(Request)) in compiled.php line 2419
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 49
    at Debugbar->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(Debugbar), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TrustProxies.php line 46
    at TrustProxies->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(TrustProxies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForSetup.php line 22
    at CheckForSetup->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForSetup), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in NosniffGuard.php line 17
    at NosniffGuard->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(NosniffGuard), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in XssProtectHeader.php line 17
    at XssProtectHeader->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(XssProtectHeader), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in FrameGuard.php line 17
    at FrameGuard->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(FrameGuard), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13473
    at ShareErrorsFromSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 11963
    at StartSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 145
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9948
    at Pipeline->then(object(Closure)) in compiled.php line 2366
    at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2350
    at Kernel->handle(object(Request)) in index.php line 55


Stack trace:
#0 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(55): PDO->__construct('mysql:host=loca...', 'snipeit', 'nbv_12345', Array)
#1 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#2 /var/www/html/snipeit/bootstrap/cache/compiled.php(11844): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#4 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(924): call_user_func(Object(Closure))
#5 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(792): Illuminate\Database\Connection->getPdo()
#6 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(677): Illuminate\Database\Connection->reconnectIfMissingConnection()
#7 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(349): Illuminate\Database\Connection->run('select * from i...', Array, Object(Closure))
#8 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(21): Illuminate\Database\Connection->select('select * from i...', Array)
#9 /var/www/html/snipeit/bootstrap/cache/compiled.php(6325): Illuminate\Database\Schema\MySqlBuilder->hasTable('users')
#10 /var/www/html/snipeit/app/Models/Setting.php(61): Illuminate\Support\Facades\Facade::__callStatic('hasTable', Array)
#11 /var/www/html/snipeit/app/Models/Setting.php(61): Illuminate\Support\Facades\Schema::hasTable('users')
#12 /var/www/html/snipeit/app/Http/Middleware/CheckForSetup.php(17): App\Models\Setting::setupCompleted()
#13 [internal function]: App\Http\Middleware\CheckForSetup->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#15 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#16 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#17 /var/www/html/snipeit/app/Http/Middleware/NosniffGuard.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#18 [internal function]: App\Http\Middleware\NosniffGuard->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#20 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#22 /var/www/html/snipeit/app/Http/Middleware/XssProtectHeader.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#23 [internal function]: App\Http\Middleware\XssProtectHeader->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#25 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#27 /var/www/html/snipeit/app/Http/Middleware/FrameGuard.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#28 [internal function]: App\Http\Middleware\FrameGuard->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#30 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#31 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#32 /var/www/html/snipeit/bootstrap/cache/compiled.php(13473): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#33 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#34 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#35 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#37 /var/www/html/snipeit/bootstrap/cache/compiled.php(11963): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#38 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#40 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#42 /var/www/html/snipeit/vendor/misterphilip/maintenance-mode/src/MisterPhilip/MaintenanceMode/Http/Middleware/CheckForMaintenanceMode.php(145): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#43 [internal function]: MisterPhilip\MaintenanceMode\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /var/www/html/snipeit/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#45 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#46 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#47 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#48 /var/www/html/snipeit/bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#49 /var/www/html/snipeit/bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#50 /var/www/html/snipeit/bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#51 /var/www/html/snipeit/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#52 {main}  
[2016-08-31 15:26:40] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'snipeit'@'localhost' (using password: YES)' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:55
@uberbrady
Copy link
Collaborator

Can you try changing your MAIL_HOST to just "localhost" (if that's actually your Mail Host)

@snipe
Copy link
Owner

snipe commented Sep 5, 2016

Does UCS-TME.localdomain.com actually resolve to anything?

@snipe snipe added the 🚫 not a bug This issue is not a bug label Sep 5, 2016
@ti1000
Copy link
Author

ti1000 commented Sep 6, 2016

I changed the mail host to localhost and it's not showing any errors, but it's also not sending any mail still.

@uberbrady
Copy link
Collaborator

In order to send mail, you need a functioning mail server. You can then point your .env settings to that mail server. In some cases, people install and configure mail server software on the same machine that is running Snipe-IT. That's when you'd use 'localhost'. In other situations, they already have a mail server somewhere else, so then you would just point your .env settings at that other server.

In either case, this is an issue with your mail server and configuration around that mail server, and not an issue with Snipe-IT.

@ti1000
Copy link
Author

ti1000 commented Sep 6, 2016

Thanks for the quick responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚫 not a bug This issue is not a bug
Projects
None yet
Development

No branches or pull requests

3 participants