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

Weird 401 error when trying to load dashboard... Sometimes #408

Open
emoyly opened this issue Jan 29, 2018 · 9 comments
Open

Weird 401 error when trying to load dashboard... Sometimes #408

emoyly opened this issue Jan 29, 2018 · 9 comments
Labels

Comments

@emoyly
Copy link

emoyly commented Jan 29, 2018

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.

Error

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)

  1. Install polr
  2. 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
@cydrobolt
Copy link
Owner

Can you turn on debug mode as demonstrated in #239 (comment) and share the full error message?

@emoyly
Copy link
Author

emoyly commented Jan 29, 2018

chrome_2018-01-29_20-40-08
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

@cydrobolt
Copy link
Owner

cydrobolt commented Jan 29, 2018

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?

@emoyly
Copy link
Author

emoyly commented Jan 29, 2018

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.
filezilla_2018-01-29_21-06-20

@emoyly
Copy link
Author

emoyly commented Feb 3, 2018

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.

@overint
Copy link
Contributor

overint commented Mar 27, 2018

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?

@prysme01
Copy link

also facing this issue, my storage permissions are the same

@yjmp14
Copy link

yjmp14 commented Mar 30, 2020

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.

@Tchekda
Copy link

Tchekda commented Oct 17, 2020

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 :
image

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.

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

No branches or pull requests

6 participants