I have a queued job that is supposed to send emails. I keep getting an error:
Swift_TransportException(code: 530): Expected response code 250 but
got code \"530\", with message \"530 5.7.1 Authentication
required\r\n\" at
/my/project/path/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383
I tried using mail, sendmail and smtp drivers. However if I set config values directly via mail.php in config dir it seems to work fine.
Once I get back to .env configuration it's the same problem again.
I tried outputting .env and config values in my templates - they all seem fine.
Any ideas what might be causing this?
The problem was in queue:listener.
Spend a lot of time trying to figure out why my config is being replaced with a wrong one.
Finally killing the php artisan queue:listen process and letting supervisor restart it solved everything.
Still not sure what was causing that. Maybe the .env was cached or something. Restarting the process did the trick.
It occurs just because your changes are not detected by artisan so it requires restarting artisan. There is nothing to do with php artisan queue:listen
Related
This route was working for months but suddenly it went blank and I got no errors and logs for it. I tried cleaning the cache using "php artisan optimize:clear" and cleared all the possible caches, but it doesn't work!
I haven't had any changes related to this route and view. It seems like a bug. My Laravel version is 7.30.4.
And I'm sure it's a route-related issue because changes in view don't affect it.
Yo should put some debug or code on the Handler.php, just to be sure if there's an Exception. Also change your .env enviorment to not production, don't forget to run a "php artisan optimize". Hope this info helps you.
In Laravel 5 I configured two remote servers in config/remote.phpand I used it for more than a year. When I added a third server now it always triggered this error
"laravel Remote connection [servername] not defined."
I answer my own question because I can't find the correct answer anywhere and I spent few hours to fix it. I believe this may help others or help myself in future.
After trying everything, I suspected that the configuration is not served from config/remote.php so i renamed config/remote.php to config/remote.php1 now also both servers added last year worked without issue so i searched my app directory
grep -iRl "myoldservername.com"
it returned with
bootstrap/cache/config.php
config/remote.php1
config/remote.php.save
I confirmed that the remote server configuration has been served from cached config file.
I renamed config/remote.php1 back to config/remote.php again and executed
php artisan cache:clear
php artisan config:clear
Now the new and old servers worked fine.
When my notify code runs when it is supposed to, I am getting the error Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "", with message "" on my Laravel 5.3 production site. When I look at the full stack trace, it seems to be caching old-incorrect login credentials. I have checked and double checked the updated 'config/mail.php' file and the .env file. The stack trace is showing "Swift_Transport_Esmtp_Auth_LoginAuthenticator->authenticate(object(Swift_SmtpTransport" with totally outdated credentials that are different from the afore mentioned updated files. I have run "sudo systemctl restart nginx" and "php artisan cache:clear" with no change. Can someone tell me how to address this error message more effectively? Is there a different file I need to update? or setting? Everything works fine on my dev machine using mailtrap.
See Laravel 5.3 > Configuration Caching
You should typically run the php artisan config:cache command as part of your production deployment routine.
Run php artisan config:cache and restart your server. This will scrap loaded/cached configuration files data.
I'm learning how to build a blog using Laravel and following along on these youtube tutorials: https://www.youtube.com/watch?v=R8B4og-BeCk
I made a mistake in tutorial part 13 locally which I didn't know how to fix, but I had the project up on Github so I decided to use an older version which I knew had worked perfectly after finishing tutorial number 12. I then purposely deleted the entire broken project locally, and downloaded the zip from Github and simply copy pasted the entire older Github blog commit into the local folder (as suggested here by Sivan: How to get certain commit from GitHub project)
But when I went to test the site on my browser by running "php artisan serve" in the terminal as normal (I'm using Ubuntu as my os) it came back with the same error as here Laravel 5 Failed opening required bootstrap/../vendor/autoload.php .
I followed the advice of Shubhamoy Chakrabarty and ran "composer update --no-scripts", and it then seemed to be working.
So I ran "php artisan serve" once again in the terminal and the response in the terminal appears positive as it comes back with the usual:
Laravel development server started on http://localhost:8000/
[Sun Jul 10 13:55:19 2016] 127.0.0.1:58276 [200]: /favicon.ico
But when I go to test the site in the browser, it comes back with the error "Whoops, looks like something went wrong." and the error message "Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
And this is the point I'm at now and wondering if you could help me with. Please feel free to tell me if I went about it wrong at any point and what I should do now as I'm still figuring out the best way to go about this.
Thanks very much in advance!
I am glad you are enjoying the Laravel Series.
There are a few things on here that might help you. First of all, make sure you have ran all of the migrations which might be causing problems if your Database is not in sync with the code. You can do this in the terminal by typing php artisan migrate and running the command.
Also it sounds like your project is not running in development mode. In development mode, Laravel will publish more detailed errors about what is happening, instead of simply a 500 error. This will help us debug the problem.
Remember that on GitHub there are always a few files that do not get sent to the repo that you might need. One of these files is the .env file that contains important information about your project to Laravel. In this file it will tell Laravel to run the project in development mode, which in turn will reveal the detailed error messages.
The default .env file should look like this:
APP_ENV=local
APP_DEBUG=true
APP_KEY=11mw9hJML4VDO3PGrtIFnUaE8hCrXads
DB_HOST=127.0.0.1
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=localhost
REDIS_PASSWORD=null
REDIS_PORT=6379
Of course your app key might be different. It is autogenerated when you build a new app or you can generate it yourself. You can use the one above if you don't have one. Also note that the APP_DEBUG is set to true which will give you those better error messages.
Note also the DB settings. Make sure your database settings work. Check the DB_DATABASE to the name of your database, the DB_USERNAME and DB_PASSWORD also should match the settings of your database.
Try this and see if this works. Also once the database settings are in your .env file then you will want to run php artisan migrate as well.
Let me know if that helps.
I create a symfony 2.3 project. some times all the pages shows 500 error. app.php also shows error. i dont know why can any one help
www.dotcue.in/sandp/web/app.php [HTTP/1.0 500 Internal Server Error 353ms]
I'm going to take a wild stab in the dark here and conclude that it is one of the following problems:
The prod cache is out of date, to fix it run: php app/console --env=prod cache:clear
The vendors are missing, to fix it run: php composer.phar install
If it is a problem when code that you have written however, we need to see the errors.
Overly big HTTP headers (e.x. 4 kB) can cause this error depending on the hosting server. ChromePHP sends all of its data in HTTP headers. (you wrote you use ChromePHP)
Try turning it off or lowering the data sent with ChromePHP. Did it help?