farshid abdi
farshid abdi

Reputation: 1

laravel 8 get error 503 without exception message

My project worked properly while today get 503 without exception message. This fix after run php artisan cache:clear command for one time but after refresh page then get 503 again.

I tried these: cleared bootstrap/cache files delete vendor and composer update --no-script and some solutions but not solve my problem

php artisan cache:clear
php artisan config:clear
php artisan view:clear

enter image description here

Upvotes: 0

Views: 2094

Answers (3)

Adam Woodhead
Adam Woodhead

Reputation: 1

The default response from Laravel whilst in it's maintenance mode is 503 - Service Unavailable. I've just had this happen, and running the command to end maintenance mode solved my problem.

php artisan up

(maintenance mode was enabled in my last development session, I had forgotten to disable it again)

Upvotes: 0

farshid abdi
farshid abdi

Reputation: 1

finally i found the problem and solve it. the problem was with the maintenance middleware

    public function handle($request, Closure $next)
{

    if(Cache::has("setting")){
        $setting = Cache::get("setting");
        if($setting->updating_site == 1){
            if(Auth::check() == false){
                abort(503);
            }
            if(Auth::check() && Auth::user()->role != "admin") {
                abort(503);
            }
        }
    }

    return $next($request);

}

in the middleware check value from setting for maintenance mode and if is true return 503

Upvotes: 0

Rachna Gajjar
Rachna Gajjar

Reputation: 108

php artisan up please try this command

I researched a little and solved the problem. The problem is not in laravel installation. The problem is on the server. Restart all services from the WHM interface. The error is resolved.

Upvotes: -1

Related Questions