polr
polr copied to clipboard
Weird 401 error when trying to load dashboard... Sometimes
Sometimes when i try to open my dashboard or settings, it just throws me this error. I have installed polr on another machine before, without any errors. I don't know if I'm just being dumb, or there's some weird bug somewhere.
Expected Behavior
Successfully load the dashboard
Current Behavior
It throws this error: datatables warning: table id=admin_links_table - Ajax error. For more information about this error, please see http://datatables.net/tn/7
Steps to Reproduce (for bugs)
- Install polr
- That's it.
Your Environment
- Version or latest commit hash (
git rev-parse HEAD
): - All browsers - PHP 7.0.22-0ubuntu0.16.04.1 - Apache/2.4.18 - Ubuntu 16.04
Can you turn on debug mode as demonstrated in https://github.com/cydrobolt/polr/issues/239#issuecomment-253101748 and share the full error message?
This actually makes sense, since after it makes the error, it logs me out...
Here's the whole error in text format
HttpException in Application.php line 428:
User must be authenticated.
in Application.php line 428
at Application->abort('401', 'User must be authenticated.', array()) in helpers.php line 20
at abort('401', 'User must be authenticated.') in Controller.php line 48
at Controller::ensureLoggedIn() in AdminPaginationController.php line 155
at AdminPaginationController->paginateUserLinks(object(Request))
at call_user_func_array(array(object(AdminPaginationController), 'paginateUserLinks'), array(object(Request))) in Container.php line 507
at Container->call(array(object(AdminPaginationController), 'paginateUserLinks'), array()) in Application.php line 1399
at Application->callControllerCallable(array(object(AdminPaginationController), 'paginateUserLinks'), array()) in Application.php line 1363
at Application->callLumenController(object(AdminPaginationController), 'paginateUserLinks', array(true, array('as' => 'api_get_user_links', 'uses' => 'App\Http\Controllers\AdminPaginationController@paginateUserLinks'), array())) in Application.php line 1335
at Application->callControllerAction(array(true, array('as' => 'api_get_user_links', 'uses' => 'App\Http\Controllers\AdminPaginationController@paginateUserLinks'), array())) in Application.php line 1303
at Application->callActionOnArrayBasedRoute(array(true, array('as' => 'api_get_user_links', 'uses' => 'App\Http\Controllers\AdminPaginationController@paginateUserLinks'), array())) in Application.php line 1288
at Application->handleFoundRoute(array(true, array('as' => 'api_get_user_links', 'uses' => 'App\Http\Controllers\AdminPaginationController@paginateUserLinks'), array())) in Application.php line 1207
at Application->Laravel\Lumen\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 20
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Application.php line 1439
at Application->sendThroughPipeline(array('Illuminate\Cookie\Middleware\EncryptCookies', 'Illuminate\Session\Middleware\StartSession', 'Illuminate\View\Middleware\ShareErrorsFromSession', 'App\Http\Middleware\VerifyCsrfToken'), object(Closure)) in Application.php line 1213
at Application->dispatch(null) in Application.php line 1153
at Application->run() in index.php line 28
Does this error occur even if you log out, immediately log back in, and try to load the admin panel? What SESSION_DRIVER
value are you using in .env
? If you're using file
, are your permissions for the storage
folder correct?
What cookies are set on your browser for your site when the error occurs? Could you try in a different browser?
Yeah it happens too if i log out and back in again immediately.
I'm using file for the session driver.
The storage folder has it's permissions set to 755, but it seems that some of the sessions have different permissions.
What seems to be the actual issue, is that the panel just logs me out sometimes, when i try to load the admin panel, which is what is causing the error.
I also noticed this error when setting up a new site. Maybe we should show a more useful error, or redirect the user back to the login page?
also facing this issue, my storage permissions are the same
I encountered the same issue and I've found out where the bug is and how to fix it. The default value of "created_at" and "updated_at" fields in "users" table of the database are invaild. Just delete the two fields then re-create them with a vaild default value like "NULL" will fix this issue.
Just delete the two fields then re-create them with a vaild default value like "NULL" will fix this issue.
Hi, I tried to do that but still not working :
I've set max_input_vars = 10000
as the developer proposed some time ago
My nginx is correctly configured :
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
I've forced dbal < 2.10 and PHP < 7.4 to fix the Laravel bugs on setup.