Closed marconucara closed 7 years ago
What's your nav
tag in your template look like?
I have more than one: In breadcrumb partial (not included in every pages):
{{ nav:breadcrumbs }}
{{ if is_current }}
<li class="breadcrumb__item breadcrumb__item--is-current">{{ title }}</li>
{{ else }}
<li class="breadcrumb__item"><a class="breadcrumb__link" href="{{ url }}">{{ title }}</a></li>
{{ /if }}
{{ /nav:breadcrumbs }}
In header partial (every pages) - I think it is the guilty in some way:
<ul class="main-header__main-menu-2-panel">
{{ nav from="/pq-frames" }}
<li class="main-header__main-menu-2-item main-header__main-menu-2-item--has-product">
<a class="main-header__main-menu-2-anchor main-header__main-menu-2-anchor--has-product" href="{{ url }}">{{ title }}</a>
{{ if children }}
<ul class="main-header__main-menu-3-panel">
{{ children }}
<li class="main-header__main-menu-3-item">
<a class="main-header__main-menu-3-anchor" href="{{ url }}">{{ title }}</a>
</li>
{{ /children }}
</ul>
{{ /if }}
</li>
{{ /nav }}
In sitemp.xml:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{ nav from="/" include_home="true" max_depth="10" include_entries="true" }}
<url>
<loc>{{ permalink }}</loc>
<lastmod>{{ last_modified format="Y-m-d" }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
{{ if children }}{{ *recursive children* }}{{ /if }}
{{ /nav }}
</urlset>
I repeat that all works now, without changes. But I would like to make sure that does not happen again.
Thank you
I found a fixed a few ways this error can be triggered, and since you no longer have the issue, i'm going to close this.
It happened again:
`[2017-04-28 01:44:34] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function in() on null in /var/www/html/dist/statamic/core/Data/Services/PageStructureService.php:82 Stack trace:
Last changes in production: 14h before the bug, but only js changes! The previous commit was several days ago. Please do something!
PS: I solved manually removing local/storage/framework
folder.
Can you send us a support request at support@statamic.com? We can't provide great support here - we only use it for recreatable bug reports and feature requests.
On Apr 28, 2017, at 3:45 AM, Marco Nucara notifications@github.com wrote:
It happened again:
[2017-04-28 01:44:34] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function in() on null in /var/www/html/dist/statamic/core/Data/Services/PageStructureService.php:82 Stack trace: #0 /var/www/html/dist/statamic/core/API/Content.php(91): Statamic\Data\Services\PageStructureService->tree('/pq-frames', 2, false, false, Array, 'en') #1 /var/www/html/dist/statamic/bundles/Nav/TreeFactory.php(49): Statamic\API\Content::tree('/pq-frames', 2, false, false, NULL, 'en') #2 /var/www/html/dist/statamic/bundles/Nav/NavTags.php(26): Statamic\Addons\Nav\TreeFactory->create() #3 [internal function]: Statamic\Addons\Nav\NavTags->index() #4 /var/www/html/dist/statamic/core/View/Antlers/Engine.php(162): call_user_func(Array) #5 [internal function]: Statamic\View\Antlers\Engine::renderTag('nav', Array, '\n ...', Array) #6 /var/www/html/dist/statamic/core/View/Antlers/Parser.php(512): call_user_func_array(Array, Array) #7 /var/www/html/dist/statamic/core/View/Antlers/Parser.php(112): Statamic\View\Antlers\Parser->parseCallbackTags('<header class="...', Array, Array) #8 /var/www/html/dist/statamic/core/View/Antlers/Template.php(32): Statamic\View\Antlers\Parser->parse('<header class="...', Array, Array, false) #9 /var/www/html/dist/statamic/core/API/Parse.php(22): Statamic\View\Antlers\Template::parse('\n<header class=...', Array, Array) #10 /var/www/html/dist/statamic/bundles/Partial/PartialTags.php(30): Statamic\API\Parse::template('\n<header class=...', Array) #11 [internal function]: Statamic\Addons\Partial\PartialTags->__call('header', Array) #12 /var/www/html/dist/statamic/core/View/Antlers/Engine.php(162): call_user_func(Array) #13 [internal function]: Statamic\View\Antlers\Engine::renderTag('partial', Array, '', Array) #14 /var/www/html/dist/statamic/core/View/Antlers/Parser.php(512): call_user_funcarray(Array, Array) #15 /var/www/html/dist/statamic/core/View/Antlers/Parser.php(112): Statamic\View\Antlers\Parser->parseCallbackTags('<!DOCTYPE html>...', Array, Array) #16 /var/www/html/dist/statamic/core/View/Antlers/Template.php(32): Statamic\View\Antlers\Parser->parse('<!DOCTYPE html>...', Array, Array, false) #17 /var/www/html/dist/statamic/core/API/Parse.php(22): Statamic\View\Antlers\Template::parse('\n{{ if !logged...', Array, Array) #18 /var/www/html/dist/statamic/core/View/Antlers/Engine.php(75): Statamic\API\Parse::template('\n{{ if !logged_...', Array) #19 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/View/View.php(147): Statamic\View\Antlers\Engine->get('/var/www/html/d...', Array) #20 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/View/View.php(118): Illuminate\View\View->getContents() #21 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/View/View.php(83): Illuminate\View\View->renderContents() #22 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Http/Response.php(51): Illuminate\View\View->render() #23 /var/www/html/dist/statamic/vendor/symfony/http-foundation/Response.php(202): Illuminate\Http\Response->setContent(Object(Illuminate\View\View)) #24 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View), 404, Array) #25 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(595): Illuminate\Routing\ResponseFactory->make(Object(Illuminate\View\View), 404, Array) #26 /var/www/html/dist/statamic/core/Http/Controllers/StatamicController.php(461): response(Object(Illuminate\View\View), 404) #27 /var/www/html/dist/statamic/core/Http/Controllers/StatamicController.php(182): Statamic\Http\Controllers\StatamicController->notFoundResponse() #28 [internal function]: Statamic\Http\Controllers\StatamicController->index('news/customized...') #29 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): call_user_func_array(Array, Array) #30 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164): Illuminate\Routing\Controller->callAction('index', Array) #31 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(112): Illuminate\Routing\ControllerDispatcher->call(Object(Statamic\Http\Controllers\StatamicController), Object(Illuminate\Routing\Route), 'index') #32 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #33 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #34 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #35 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #36 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #37 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(67): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(Statamic\Http\Controllers\StatamicController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'index') #38 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'Statamic\Http\C...', 'index') #39 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(134): Illuminate\Routing\Route->runWithCustomDispatcher(Object(Illuminate\Http\Request)) #40 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #41 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #42 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #43 /var/www/html/dist/statamic/core/StaticCaching/Middleware/Cache.php(30): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #44 [internal function]: Statamic\StaticCaching\Middleware\Cache->handle(Object(Illuminate\Http\Request), Object(Closure)) #45 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #46 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #47 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #48 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(710): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #49 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(673): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #50 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #51 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(236): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #52 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) #53 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #54 /var/www/html/dist/statamic/core/Http/Middleware/PersistStache.php(22): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #55 [internal function]: Statamic\Http\Middleware\PersistStache->handle(Object(Illuminate\Http\Request), Object(Closure)) #56 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #57 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #58 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #59 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #60 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #61 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #62 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #63 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #64 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #65 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #66 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #67 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #68 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #69 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #70 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #71 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #72 /var/www/html/dist/statamic/core/Http/Middleware/Glide.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #73 [internal function]: Statamic\Http\Middleware\Glide->handle(Object(Illuminate\Http\Request), Object(Closure)) #74 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #75 /var/www/html/dist/statamic/core/StaticCaching/Middleware/Retrieve.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #76 [internal function]: Statamic\StaticCaching\Middleware\Retrieve->handle(Object(Illuminate\Http\Request), Object(Closure)) #77 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #78 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #79 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #80 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array) #81 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #82 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #83 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #84 /var/www/html/dist/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #85 /var/www/html/dist/index.php(155): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
Last changes in production: 14h before the bug, but only js changes! The previous commit was several days ago. Please do something!
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
The same error happened to me - it goes away after clearing the cache. But it is on a production site, so - bad. Did you find the culprit here?
My problem re-occurs, then sometimes goes away after refreshing the site after a few minutes. Might this be a cache problem? I am on a laravel forge server. Do you want me to open a new issue?
I wrote at support several days ago, I'm still waiting for a response. Meanwhile the problem occurred 2 times again. It's really a big problem, can you at least help me for solve it in some "hard" way?
Can I force statamic to delete local folder every times that an error 500 occurred?
@marconucara I had a similar problem a few days ago. Even though the error does not give a direct hint: I had a look through my files and found a bug in one of my "nav" tags. You should have a close look (or maybe post your code here) at all the places you use the "nav" tags.
After I fixed my error, the site did not crash again. Probably something to do with saving the error response in the cache or something like that...
Hey @marconucara sorry about not responding. Your email slipped through the cracks. If you zip up your site and send it to support@statamic.com I'll take a look at it.
@manogi Your earlier comments - this was fixed when you adjusted your nav tag? Everything is ok now?
Yes - If I remember it correctly it was a {{ /nav }}
at the wrong place (or missing? I think it was the wrong place).
The problem is that this error is not easily to reproduce. Everything seems fine and then at some point all that the website will show is the error. I can only guess that my debugging fixed it, but yes, it never crashed again.
I sent my code at support right now. My use of nav tag are posted before and I can't see any bug, but I may be wrong.
I'm not sure if this was solved or not, but I got this problem on a fresh installation, with the default site. Clearing the cache helped, but I am worried that it will happen again. Could it be related to access rights?
I've just experienced the same issue and what in my case seemed to be the cause was an @import statement in a .css file that was trying to load another .css file that did not exist, resulting in a 404, but attempting to go through the Statamic routing (since nginx could not serve the file from the filesystem). We still got some testing to do to validate that by removing this import it did in fact resolve our issue, but it looks promising for now.
This happened to me when I had some translation content, but no base content.
For instance the following file existed under the DE translations:
app/collections/my-collection/de/foo.md
published: false
id: bffafbfb-ab2c-4470-b9e7-676e16f5f07a
But I was missing the base file (english) under app/collections/my-collection/foo.md
Removing the orphaned translation fixed the issue
@jackmcdade @jasonvarga
Expected behaviour
No crash :\
Actual behaviour
Yesterday (the day before planned go-live...) the site went offline in pre-production environment, for no apparent reason. In pre production we have debug=false so in front end there was only a "Whoops, looks like something went wrong". The cp was online, but any trying to login was aborted with wrong password error.
I logged in with ssh and enabled debug. The error is gone and everything has begun to function properly. I reset debug to false and all works properly again, so probably a cache clean would be enough.
I've git integration with cp so I can tell that nothing strange was done in backend before the crash. Last thing was home page saving with new asset and it was checked and ok in front end.
Steps to reproduce
I would like to know
Server configuration
Operating system: Amazon linux
Web server: Apache 2.4
PHP version: 7.0.14
Statamic version: 2.5.3
Updated from an older Statamic or fresh install: Updated from 2.1
List of installed addons: CacheManager, placid, spock
Logs
This is the first, but every successives page refresh has same log: