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

Multi site database model #9078

Closed
sattyframework opened this issue Nov 28, 2023 · 15 comments
Closed

Multi site database model #9078

sattyframework opened this issue Nov 28, 2023 · 15 comments

Comments

@sattyframework
Copy link

Bug description

Hey there,
I have a project with multi-site and am using a database model. I am getting the following error when I try to access the frontend / collections or the cache utility.

[2023-11-28 11:17:02] local.ERROR: Undefined array key 1 {"userId":"8921fb36-91d7-46b4-bf16-09ecee996dd8","exception":"[object] (ErrorException(code: 0): Undefined array key 1 at /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/CollectionEntriesStore.php:38) 
  
 37    if (Site::hasMultiple()) {
 38            [$site, $relative] = explode('/', $relative, 2);
 39           if (! $this->collection()->sites()->contains($site)) {
 40               return false;
 41           }
 42       }

I believe it is because I am using a database model and it is trying to find the site folder which doesn't exist. But I could be wrong. I am unsure how to fix this, any help would be appreciated.

How to reproduce

Move statamic site to database model
create multi site and set the config

Logs

[2023-11-28 11:17:02] local.ERROR: Undefined array key 1 {"userId":"8921fb36-91d7-46b4-bf16-09ecee996dd8","exception":"[object] (ErrorException(code: 0): Undefined array key 1 at /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/CollectionEntriesStore.php:38)

Environment

Statamic version: 4.10.2
Laravel Version: 10.21.0
PHP Version: 8.2.7
Composer Version: 2.5.7

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

No response

@ryanmitchell
Copy link
Contributor

When you say you are using a database model, do you mean you're using the eloquent-driver add on? Or your own custom one? If it a custom one you'd need to provide a fuller overview of what you've changed.

@sattyframework
Copy link
Author

Hey, yes sorry for not being clear. Yes I am using the eloquent-driver

@ryanmitchell
Copy link
Contributor

Ok - can you support the full output of php please support:details then, including the eloquent-driver config that is output.

@sattyframework
Copy link
Author

Environment
Application Name: RST Moto
Laravel Version: 10.21.0
PHP Version: 8.2.7
Composer Version: 2.5.7
Environment: local
Debug Mode: ENABLED
URL: rst-moto.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: database
Session: file

Simple Commerce
Currencies: GBP, USD
Gateways: Dummy
Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EloquentCustomerRepository
Repository: Order: DoubleThreeDigital\SimpleCommerce\Orders\EloquentOrderRepository
Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping
Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\Standard\TaxEngine

Statamic
Addons: 14
Antlers: runtime
Stache Watcher: Disabled
Static Caching: Disabled
Version: 4.10.2 PRO

Statamic Addons
doublethreedigital/runway: 5.5.0
doublethreedigital/simple-commerce: 5.1.0
jacksleight/statamic-bard-texstyle: 3.1.1
rias/statamic-data-import: 1.3.0
rias/statamic-link-it: 2.3.0
rias/statamic-redirect: 2.x-dev
spatie/statamic-responsive-images: 4.0.3
statamic/eloquent-driver: 2.5.1
statamic/seo-pro: 5.2.0
weareframework/api-product-importer: dev-feature/database-upgrade
weareframework/clever-search: dev-main
weareframework/fwk-helper-tools: dev-feature/database-upgrade
weareframework/fwk-responsive: dev-feature/database-upgrade
weareframework/product-color-swatches: dev-main

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: eloquent
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent

@ryanmitchell
Copy link
Contributor

Seems odd - not seeing that on my side when I use full eloquent.

did you migrate from file based content? Might you be able to create a sample repository? From the full stack trace is the issue definitely coming from eloquent driver or might it be coming from Runway or one of the other addons?

@sattyframework
Copy link
Author

Yes we moved from file based content, although hadn't used the multi-site feature yet so content was not organised into site folders.
Whilst debugging I can see the it is trying to explode the file path by '/' to get the site name. But since content was never in a site folder I am getting the error. I have looked through the full stack trace and doesn't look like its coming from any of the addons.

@ryanmitchell
Copy link
Contributor

The confusion for me is that the collection store should never be being called, so its odd.
Can you provide the full stack trace?

@sattyframework
Copy link
Author

sattyframework commented Nov 28, 2023

sure thing

[2023-11-28 11:17:02] local.ERROR: Undefined array key 1 {"userId":"8921fb36-91d7-46b4-bf16-09ecee996dd8","exception":"[object] (ErrorException(code: 0): Undefined array key 1 at /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/CollectionEntriesStore.php:38)
[stacktrace]

#0 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(254): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'Undefined array...', '/Users/framewor...', 38)
#1 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/CollectionEntriesStore.php(38): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}(2, 'Undefined array...', '/Users/framewor...', 38)
#2 [internal function]: Statamic\\Stache\\Stores\\CollectionEntriesStore->getItemFilter(Object(Symfony\\Component\\Finder\\SplFileInfo), 0)
#3 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(869): array_filter(Array, Array, 1)
#4 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(387): Illuminate\\Support\\Arr::where(Array, Array)
#5 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Traverser.php(33): Illuminate\\Support\\Collection->filter(Array)
#6 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/Store.php(295): Statamic\\Stache\\Traverser->traverse(Object(Statamic\\Stache\\Stores\\CollectionEntriesStore))
#7 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/AggregateStore.php(81): Statamic\\Stache\\Stores\\Store->paths()
#8 [internal function]: Statamic\\Stache\\Stores\\AggregateStore->Statamic\\Stache\\Stores\\{closure}(Object(Statamic\\Stache\\Stores\\CollectionEntriesStore), 0)
#9 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(558): array_map(Object(Closure), Array, Array)
#10 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#11 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(394): Illuminate\\Support\\Collection->map(Object(Closure))
#12 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stores/AggregateStore.php(80): Illuminate\\Support\\Collection->flatMap(Object(Closure))
#13 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stache.php(124): Statamic\\Stache\\Stores\\AggregateStore->paths()
#14 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(781): Statamic\\Stache\\Stache->Statamic\\Stache\\{closure}(136, Object(Statamic\\Stache\\Stores\\EntriesStore), 'entries')
#15 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Stache/Stache.php(123): Illuminate\\Support\\Collection->reduce(Object(Closure), 0)
#16 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(353): Statamic\\Stache\\Stache->fileCount()
#17 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Controllers/CP/Utilities/CacheController.php(31): Illuminate\\Support\\Facades\\Facade::__callStatic('fileCount', Array)
#18 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Controllers/CP/Utilities/CacheController.php(18): Statamic\\Http\\Controllers\\CP\\Utilities\\CacheController->getStacheStats()
#19 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Statamic\\Http\\Controllers\\CP\\Utilities\\CacheController->index()
#20 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction('index', Array)
#21 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Statamic\\Http\\Controllers\\CP\\Utilities\\CacheController), 'index')
#22 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#23 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Routing\\Route->run()
#24 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#25 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authorize.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'access cache ut...')
#27 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/DeleteTemporaryFileUploads.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\DeleteTemporaryFileUploads->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/CountUsers.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\CountUsers->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/BootUtilities.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\BootUtilities->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/BootPreferences.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\BootPreferences->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#35 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/BootPermissions.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#36 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\BootPermissions->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#37 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/Localize.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#38 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\Localize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/Authorize.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#40 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#41 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/AddToasts.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#42 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\AddToasts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#43 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#44 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\AuthGuard->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CP/ContactOutpost.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CP\\ContactOutpost->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#47 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#55 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#56 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#57 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#58 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#59 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/SwapExceptionHandler.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\SwapExceptionHandler->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#62 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#63 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#64 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Router.php(777): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#65 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Router.php(741): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#66 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Routing/Router.php(730): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#67 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#68 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#69 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(17): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#70 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\DisableFloc->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#71 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#72 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CheckMultisite->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#73 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#74 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#75 /Users/framework/Sites/rst-moto/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#76 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Statamic\\Http\\Middleware\\PoweredByHeader->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#77 /Users/framework/Sites/rst-moto/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#78 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#79 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#80 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#81 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#82 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#83 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#84 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#85 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#86 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#87 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(89): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#88 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#89 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#90 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#91 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#92 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#93 /Users/framework/Sites/rst-moto/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#94 /Users/framework/Sites/rst-moto/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#95 /Users/framework/.composer/vendor/laravel/valet/server.php(110): require('/Users/framewor...')
#96 {main}
"} 

@ryanmitchell
Copy link
Contributor

ryanmitchell commented Nov 28, 2023

Can you put your traces inside backticks next time - otherwise Github tries to link each number to an issue.

I can't really see what the issue is - theres nothing eloquent wise thats going on. The only suggestion I can make is for you to remove the files in your content/* folders and run php artisan cache:clear. Its possible some files in places Statamic isnt expecting are causing the issue.

@sattyframework
Copy link
Author

Oops sorry, have amend my comment.
Okay thanks will try removing content files.

@jasonvarga
Copy link
Member

Does this happen on every page or only when you visit the cache utility in the control panel?

@sattyframework
Copy link
Author

Error was showing when in collections as well as the cache utility. I have removed collection content files and that seemed to fix the issue.
Have made a backup though just in case!

@duncanmcclean
Copy link
Member

Error was showing when in collections as well as the cache utility. I have removed collection content files and that seemed to fix the issue. Have made a backup though just in case!

Out of interest, what does your config/statamic/stache.php config file look like?

@sattyframework
Copy link
Author

Sure, I dont believe anything has been changed from the default.

return [

    /*
    |--------------------------------------------------------------------------
    | File Watcher
    |--------------------------------------------------------------------------
    |
    | File changes will be noticed and data will be updated accordingly.
    | This can be disabled to reduce overhead, but you will need to
    | either update the cache manually or use the Control Panel.
    |
    */

    'watcher' => env('STATAMIC_STACHE_WATCHER', true),

    /*
    |--------------------------------------------------------------------------
    | Stores
    |--------------------------------------------------------------------------
    |
    | Here you may configure the stores that are used inside the Stache.
    |
    | https://statamic.dev/stache#stores
    |
    */

    'stores' => [
        //
    ],

    /*
    |--------------------------------------------------------------------------
    | Indexes
    |--------------------------------------------------------------------------
    |
    | Here you may define any additional indexes that will be inherited
    | by each store in the Stache. You may also define indexes on a
    | per-store level by adding an "indexes" key to its config.
    |
    */

    'indexes' => [
        //
    ],

    /*
    |--------------------------------------------------------------------------
    | Locking
    |--------------------------------------------------------------------------
    |
    | In order to prevent concurrent requests from updating the Stache at
    | the same and wasting resources, it will be "locked" so subsequent
    | requests will have to wait until the first has been completed.
    |
    | https://statamic.dev/stache#locks
    |
    */

    'lock' => [
        'enabled' => true,
        'timeout' => 30,
    ],

];

@duncanmcclean
Copy link
Member

I'm not quite sure what happened here... you seem to have everything configured as expected. Although, glad that deleting the content files seem to have fixed the issue for you.

I'm going to close this issue now - if you're continuing to run into this, comment on this issue and we can re-open. Thanks!

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

No branches or pull requests

4 participants