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

FatalThrowableError in PagesController.php line 33 #1442

Closed
peda opened this Issue Jun 1, 2017 · 19 comments

Comments

Projects
None yet
5 participants
@peda

peda commented Jun 1, 2017

Expected behaviour

When accessing /cp/pages I do get a list of pages

Actual behaviour

Exception when I try to access /cp/pages (the login into the CP and the rest of the CP works fine) - this issue happens randomly after saving a page and can only be resolved by doing a "please clear:stache"

The website itself doesn't work either - it does return a 404 error for all pages

bildschirmfoto von 2017-06-01 21-25-35

Steps to reproduce

Can only be produced randomly

Server Details

Operating System: CentOS release 6.9 (Final)

Web Server: Apache/2.2.15

PHP Version: 7.0.19

Statamic Version: 2.5.10

Updated from an older Statamic or fresh install: updated

List of installed addons:
Cookie Consent
Google
Google Maps
Placid
Recaptcha
Redirect to Child
Robots
Sitemap
HrefLang
MultiLang
Image Route

Logs

No log is created, but that's the complete error stack trace

FatalThrowableError in PagesController.php line 33:
Call to a member function data() on null
in PagesController.php line 33
at PagesController->pages()
at call_user_func_array(array(object(PagesController), 'pages'), array()) in Controller.php line 256
at Controller->callAction('pages', array()) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(PagesController), object(Route), 'pages') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
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 ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(PagesController), object(Route), object(Request), 'pages') in ControllerDispatcher.php line 68
at ControllerDispatcher->dispatch(object(Route), object(Request), 'Statamic\Http\Controllers\PagesController', 'pages') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 708
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Authenticate.php line 62
at Authenticate->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Outpost.php line 51
at Outpost->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Outpost), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in DefaultLocale.php line 28
at DefaultLocale->handle(object(Request), object(Closure))
at call_user_func_array(array(object(DefaultLocale), '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 Router.php line 710
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 674
at Router->dispatchToRoute(object(Request)) in Router.php line 635
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in PersistStache.php line 22
at PersistStache->handle(object(Request), object(Closure))
at call_user_func_array(array(object(PersistStache), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
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 AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), '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)) in Glide.php line 50
at Glide->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Glide), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Retrieve.php line 33
at Retrieve->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Retrieve), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), '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 Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 156
@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jun 16, 2017

This is this site pretty large? Many entries, pages, etc?

Can you also please post your site/settings/caching.yaml ?

@peda

This comment has been minimized.

peda commented Jun 16, 2017

@jasonvarga no the site is not that large - just 14 pages and 5 entries

stache_always_update: true
static_caching_enabled: false
static_caching_type: cache
static_caching_file_path: static
static_caching_ignore_query_strings: true
static_caching_exclude: [ ]
static_caching_invalidation: [ ]
static_caching_lock_hold_length: 0
@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

I have exactly the same issue on version 2.7.2
my cache settings:

stache_always_update: false
static_caching_enabled: false
static_caching_lock_hold_length: 0

It appears only live (Laravel Forge, ningx etc), not locally on Valet...

@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

It's a very small site - just 6 pages. Only one "real" page (as in entry under site/content/pages).
It seems to be a caching issue, but what can I do about it? My client is not happy :-(

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Nov 28, 2017

Can you send a zip of the site to support@statamic.com? I think it's a configuration issue (not caching) and I'll see if i can find it for you.

@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

Yes I can do that, thanks! - I also have it on github as a private repo, would you rather have a look directly as a "collaborator" there?

@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

[edited]

Well here's the zip anyway - I can still give you access to the repo if you want.

@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

Oh - I did change the cache settings a bit by now, as you will see. But I had one "occurence" already again after doing so.

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Nov 28, 2017

I just spent roughly 10 minutes clicking and saving and changing stuff without seeing the issue. :-/ Hmm. Are you deploying with git? If so, is your local folder (and therefore the cache) help in the repo?

@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

I know - that is the problem, I did the same thing when my client said "the website is broken".
Fortunately I did try to go to pages inside the CP first and saw the exact error above. After clearing the cache the error was gone and I can't reproduce it - but then my client writes again and says "IT happened again!". It is frustrating not to be able to pin down what makes this happen...
It also never happens in my local environment, only in production. And when it happened the last push from Github was a long time ago. And my local folder is gitignored and does not get deployed...

I drilled down from the place in PagesController where the method whereUri() is called to the actual place in AbstractService where the method repo() actually calls a 'repo()' method on the stache... that is some crazy stuff by the way, I don't understand half of it ;-)

Well it seems that sometimes the CP and the frontend don't find the Home page, and it somehow maybe is connected to the stache :-(

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Nov 28, 2017

Next time it happens, can you zip up the local folder before you clear the cache, and send it across?

@manogi

This comment has been minimized.

manogi commented Nov 28, 2017

Good idea... I will!

@manogi

This comment has been minimized.

manogi commented Dec 18, 2017

Yippie - the error reoccured, this time on my local machine. I zipped the complete "local" folder right away. The error is the same as above, but for reference I attach it as a txt file. After clearing the cache the error went away (as always).

Maybe an important information: just before the error occurred, I secured my .dev domain with Laravel Valet. Maybe interesting: It had beed quite some time since I last visited the local version of the website at all (at least two weeks...).

Thanks for your help!

local.zip

statamic-error.txt

@manogi

This comment has been minimized.

manogi commented Jan 14, 2018

Hi @jasonvarga,
just checking - have you had a chance to look into my zipped local folder?
Does the new release fix the problem?

Thanks, Sebastian

@sebszocinski

This comment has been minimized.

sebszocinski commented Aug 2, 2018

I'm having the exact same issue here... Client just called saying she broke the website... but mine is on line 35.

image

My client's website is using Locales and she tried to un-publish an entry which caused the above error. Clearing the local folder fixed it and I haven't been able to replicate it since.

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Aug 2, 2018

@sebszocinski what version are you on?

@sebszocinski

This comment has been minimized.

sebszocinski commented Aug 3, 2018

2.9.8

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Aug 3, 2018

Upgrade!

@sebszocinski

This comment has been minimized.

sebszocinski commented Aug 6, 2018

Thanks, upgraded -- will report back if I see it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment