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 500 when subscribe an email from control panel and from subscribe button at bottom right #2228

Closed
biovn opened this issue Nov 2, 2016 · 24 comments

Comments

@biovn
Copy link

biovn commented Nov 2, 2016

This is the error detail :
Error 500

Houston, We Have A Problem.
Internal Server Error

What does this mean?

Something went wrong on our servers while we were processing your request. An error has occurred and this resource cannot be displayed. This occurrence has been logged, and a highly trained team of monkeys has been dispatched to deal with your problem. We're really sorry about this, and will work hard to get this resolved as soon as possible.

This error can be identified by 71ba68aa-9743-4023-ad2c-30fcbca97365. You might want to take a note of this code.

SO, MY QUESTION HOW CAN I TRACE THIS DETAIL LOG AND HOW TO FIX

@GrahamCampbell
Copy link
Contributor

Just search for that error code in your log file?

@GrahamCampbell
Copy link
Contributor

and a highly trained team of monkeys has been dispatched to deal with your problem. We're really sorry about this, and will work hard to get this resolved as soon as possible.

NB That message is referring to you from the perspective of your users, not to us.

@jbrooksuk
Copy link
Member

We need to do something different than that error.

@biovn
Copy link
Author

biovn commented Nov 2, 2016

where is the log file?

@biovn
Copy link
Author

biovn commented Nov 2, 2016

FYI, i'm using version 2.3.9 setup from this instruction link https://docs.cachethq.io/docs/installing-cachet

@nixmomo
Copy link

nixmomo commented Nov 2, 2016

Sounds like the same Error that i had but my was after a upgrade from 2.3.9 to 2.4
Don't know if Mails worked in 2.3.9.
#2187
#2183
In #2183 is the fix for my 500 error and in #2187 another error if you use supervisor.

BUT not sure if this is your bug too without any logs

Look into Cachet/storage/logs for the Cachet Logs and in your webservers error Logs.

Regards

@nixmomo
Copy link

nixmomo commented Nov 2, 2016

@biovn

Check out the latest version!
The tags below are examples of what will be shown. You should always run git checkout on the latest tag.

The latest Tag is 2.3.10
https://github.com/CachetHQ/Cachet/releases/tag/v2.3.10
But that wouldn't change anything to this issue

To fix it just change 2 files as you can see here
BeyondeLabs@0f1347b
If you do that correct your Issue is fixed (Testet local on a VM)

@GrahamCampbell @jbrooksuk the Fix from #2186 is here the Solution too. It was merged in 2.4. only.
The Issue exists in the Source from 2.3.9 and 2.3.10 too. I think you have to fix this in the current Tags or create a new Tag with this fix included :-)

Regards

@biovn
Copy link
Author

biovn commented Nov 3, 2016

@nixmomo i switched to 2.4 version which already have the fixed of BeyondeLabs/Cachet@0f1347b but still that error.
here is log i found on laravel log :
#89 /var/www/html/Cachet/bootstrap/cache/compiled.php(9858): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#90 /var/www/html/Cachet/bootstrap/cache/compiled.php(2416): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#91 /var/www/html/Cachet/bootstrap/cache/compiled.php(2400): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#92 /var/www/html/Cachet/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#93 {main} {"identification":{"id":"b027d5f6-1c78-442e-869b-c63dca8a30f2"}}

@biovn
Copy link
Author

biovn commented Nov 3, 2016

here is my mail config from microsoft and gmail ( BOTH FAILED):
MAIL_DRIVER=smtp
MAIL_HOST=outlook.office365.com
MAIL_PORT=587
MAIL_USERNAME=xxx@yyy
MAIL_PASSWORD=xxx
MAIL_ADDRESS=xxx@yyy
MAIL_NAME="My service Limited"
MAIL_ENCRYPTION=tls

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=xxx@gmail.com
MAIL_PASSWORD=yyy
MAIL_ADDRESS=xxx@gmail.com
MAIL_NAME="xxx@gmail.com"
MAIL_ENCRYPTION=tls

@biovn
Copy link
Author

biovn commented Nov 3, 2016

Here is other configurations :

  • Supervisor :
    [program:cachet-queue]
    command=php artisan queue:work --delay=1 --sleep=1 --timeout=1800 --tries=3
    directory=/var/www/html/Cachet/
    redirect_stderr=true
    autostart=true
    autorestart=true
    user=cachet
  • crontab :
    • * * * php /var/www/html/Cachet/artisan schedule:run >> /dev/null 2>&1
  • .env of cache,session and queue :
    CACHE_DRIVER=database
    SESSION_DRIVER=database
    QUEUE_DRIVER=sync

CACHET_BEACON=true
CACHET_EMOJI=false

@nixmomo
Copy link

nixmomo commented Nov 3, 2016

It isn't the Full Log of the Error... it miss something like that

[2016-10-15 03:45:08] production.ERROR: exception 'ErrorMessage [Function] .'

and you should change from
command=php artisan queue:work --delay=1 --sleep=1 --timeout=1800 --tries=3
to
command=php artisan queue:work --delay=2 --sleep=1 --timeout=1800 --tries=3

But that hasn't anything todo with your error. Did you wiped the cache?
If not, delete all in bootstrap/cache/*
And to be sure restart Cachet with php artisan down and php artisan up
After that, go to your log and clean it. (Rename it or someting else to not loosing the old logs, after renaming you have to restart the webserver)
Please go after to your Dashboard and try subscribing again. If the error is still present post the complete Log

Edit: One Question, did you fresh install 2.4. or did you upgraded?
If you upgraded, did you followed this doc?
https://docs.cachethq.io/docs/updating-cachet

@biovn
Copy link
Author

biovn commented Nov 4, 2016

i did not upgrade but delete the old (source and database) and install new one.
here is the error log :
#65 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#66 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))

i did change the Supervisor delay to 2 but still that error

@biovn
Copy link
Author

biovn commented Nov 4, 2016

this is exactly the error i found after clear logs and retry :
ERROR: exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.gmail.com [Permission denied #13]' in /var/www/html/Cachet/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:269
Stack trace:
#0 /var/www/html/Cachet/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(62): Swift_Transport_StreamBuffer->_establishSocketConnection()
#1 /var/www/html/Cachet/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(113): Swift_Transport_StreamBuffer->initialize(Array)
#2 /var/www/html/Cachet/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start()
#3 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(385): Swift_Mailer->send(Object(Swift_Message), Array)
#4 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(171): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#5 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(276): Illuminate\Mail\Mailer->send(Array, Array, Object(Closure))
#6 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(130): Illuminate\Mail\Mailer->handleQueuedMessage(Object(Illuminate\Queue\Jobs\SyncJob), Array)

@biovn
Copy link
Author

biovn commented Nov 4, 2016

if i change MAIL_DRIVER to sendmail from my google from other articles , i got this error :
[2016-11-04 10:33:09] production.ERROR: exception 'Swift_TransportException' with message 'Expected response code 220 but got code "", with message ""' in /var/www/html/Cachet/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383

@jbrooksuk
Copy link
Member

This looks more like you've got an incorrect configuration. Ping @GrahamCampbell?

@nixmomo
Copy link

nixmomo commented Nov 4, 2016

Can you try this out

MAIL_DRIVER=smtp
MAIL_HOST=aspmx.l.google.com
MAIL_PORT=25
MAIL_USERNAME=xxx@yyy
MAIL_PASSWORD=xxx
MAIL_ADDRESS=xxx@yyy
MAIL_NAME="My service Limited"
MAIL_ENCRYPTION=null # (if that work try with tls)

The X and y change with your gmail data :-)
It looks that there is a TLS / SSL Issue and if i remember right its a swiftmail Bug... i had the same issue with redmine... it worked with all my server but not with gmail, Microsoft and yahoo....

And can you check your php config? Is openssl activated?? if not, do it. It should be fix it if you haven't enabled it.

If the first not work and your openssl is activated, are your IP's on a Blacklist? This would end in the same error :-)

Regards

@biovn
Copy link
Author

biovn commented Nov 7, 2016

php open ssl is activated, am testing local on linux virtual machine. i did write my own java test for the account, it worked but not with cachet.
Anyway for me to try send the email direct without using queue and swift. am not familar with .php so quite hard for me to debug the problem.

@nixmomo
Copy link

nixmomo commented Nov 7, 2016

Sounds that you have a dynamic IP!

Did you tried my example ??

Please note! Most block dynamic IP as relayer so google Microsoft and so on do it.
Google allows dynamic IP at this smtp that I posted... try it out with your own Mailserver ...

It isn't a Cachet problem, pretty sure!

What can be better in Cachet is the Errorhabdling to show that the Mailserver didn't accept you as sender I stead a 500 error ...

Von meinem iPhone gesendet

Am 07.11.2016 um 05:23 schrieb biovn notifications@github.com:

php open ssl is activated, am testing local on linux virtual machine. i did write my own java test for the account, it worked but not with cachet.
Anyway for me to try send the email direct without using queue and swift. am not familar with .php so quite hard for me to debug the problem.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@biovn
Copy link
Author

biovn commented Nov 7, 2016

am using static ip. with your example it will error like this :
exception 'Swift_TransportException' with message 'Connection could not be established with host aspmx.l.google.com [Permission denied

@biovn
Copy link
Author

biovn commented Nov 7, 2016

Another the try with mail gun :
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster@sandbox5e1696a933be4d2186ff799e9ef346d8.mailgun.org
MAIL_PASSWORD=key-xxxxxxxx
MAIL_ADDRESS=xxxx@yyyy
MAIL_NAME="My service Limited"
MAIL_ENCRYPTION=tls

And i got this Exception Error :
[2016-11-07 07:14:00] production.ERROR: exception 'InvalidArgumentException' with message 'Route [subscribe.verify] not defined.' in /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:314
Stack trace:
#0 /var/www/html/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(692): Illuminate\Routing\UrlGenerator->route('subscribe.verif...', Array, true)
#1 /var/www/html/Cachet/app/Bus/Handlers/Events/Subscriber/SendSubscriberVerificationEmailHandler.php(51): route('subscribe.verif...', Array)
#2 [internal function]: CachetHQ\Cachet\Bus\Handlers\Events\Subscriber\SendSubscriberVerificationEmailHandler->handle(Object(CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent))

@biovn
Copy link
Author

biovn commented Nov 8, 2016

hi all
i can make the email working now.
with my research from other people having problem with mail subscription, i tried as their success that changing the Queue config and it worked ok now.
the default Queue is : sync, i changed it to database and it worked perfectly.
hope this help someone. i stuck on this for 2 days !!!!

@biovn biovn closed this as completed Nov 8, 2016
@biovn
Copy link
Author

biovn commented Nov 8, 2016

mail driver should be "sendmail" for linux system if we use gmail or microsoft

@InfoSecured
Copy link

Is it just me or is there no v2.4 in the list when running git tag -l?

@jbrooksuk
Copy link
Member

We've not tagged v2.4 yet, it's still a 2.4 branch as it's in development mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants