Telescope infinite loop issue

Ouverte
#10,782 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

  • #11390 par @duncanmcclean — fermée sans fusion

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
laravel, php
Domaine
backend

Piste de recherche

Start with the linked reproduction repository and reproduce the cycle of two entries linking to each other. The stack trace points to Entry.php, AbstractAugmented.php, AugmentedCollection.php, and ArrayableLink.php; trace how link-field augmentation follows the reciprocal entry links. Done means the reproduced case no longer recurses or throws the stack-size error, with a regression test covering the cycle.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

laravel performance
Bug description

It seems that this issue is still happening: https://github.com/statamic/cms/issues/5752

My issue, if you are to create a Link field on Entry A that links to Entry B, then on Entry B make a link to Entry A, you get an exception

error_screen

I have reproduced the issue here: https://github.com/ScottPenhall98/Statamic-core-Recursive-Link-bug

I also notice some big performance issues when using Telescope

How to reproduce

if you are to create a Link field on Entry A that links to Entry B, then on Entry B make a link to Entry A

Logs
going into telescope I can see we get an infinite loop. This keeps on happening over and over, I have truncated the text:

[2024-09-10 04:59:55] local.ERROR: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? {"userId":1,"exception":"[object] (Error(code: 0): Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? at /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php:20)
[stacktrace]
#0 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(328): Illuminate\\Support\\Arr::accessible(Array)
#1 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(666): Illuminate\\Support\\Arr::get(Array, 0, NULL)
#2 /app/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php(204): Illuminate\\Support\\Arr::pull(Array, 0)
#3 [internal function]: Illuminate\\Routing\\RouteUrlGenerator->Illuminate\\Routing\\{closure}(Array)
#4 /app/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php(198): preg_replace_callback('/\\\\{.*?\\\\}/', Object(Closure), 'cp/collections/...')
#5 /app/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php(85): Illuminate\\Routing\\RouteUrlGenerator->replaceRouteParameters('cp/collections/...', Array)
#6 /app/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php(500): Illuminate\\Routing\\RouteUrlGenerator->to(Object(Illuminate\\Routing\\Route), Array, true)
#7 /app/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php(469): Illuminate\\Routing\\UrlGenerator->toRoute(Object(Illuminate\\Routing\\Route), Array, true)
#8 /app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(811): Illuminate\\Routing\\UrlGenerator->route('statamic.cp.col...', Array, true)
#9 /app/vendor/statamic/cms/src/Statamic.php(196): route('statamic.cp.col...', Array)
#10 /app/vendor/statamic/cms/src/helpers.php(9): Statamic\\Statamic::cpRoute('collections.ent...', Array)
#11 /app/vendor/statamic/cms/src/Entries/Entry.php(333): cp_route('collections.ent...', Array)
#12 /app/vendor/statamic/cms/src/Entries/Entry.php(287): Statamic\\Entries\\Entry->cpUrl('collections.ent...')
#13 /app/vendor/statamic/cms/src/Data/AbstractAugmented.php(141): Statamic\\Entries\\Entry->editUrl()
#14 /app/vendor/statamic/cms/src/Fields/Value.php(56): Statamic\\Data\\AbstractAugmented->Statamic\\Data\\{closure}(Object(Statamic\\Fields\\Value))
#15 /app/vendor/statamic/cms/src/Data/AbstractAugmented.php(78): Statamic\\Fields\\Value->resolve()
#16 /app/vendor/statamic/cms/src/Data/AbstractAugmented.php(52): Statamic\\Data\\AbstractAugmented->get('edit_url')
#17 /app/vendor/statamic/cms/src/Fields/Value.php(56): Statamic\\Data\\AbstractAugmented->Statamic\\Data\\{closure}(Object(Statamic\\Fields\\Value))
#18 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(53): Statamic\\Fields\\Value->resolve()
#19 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Object(Statamic\\Fields\\Value), 'edit_url')
#20 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#21 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#22 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(53): Illuminate\\Support\\Collection->map(Object(Closure))
#23 /app/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(35): Statamic\\Data\\AugmentedCollection->all()
#24 /app/vendor/statamic/cms/src/Fieldtypes/Link/ArrayableLink.php(17): Statamic\\Entries\\Entry->toAugmentedArray()
#25 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(87): Statamic\\Fieldtypes\\Link\\ArrayableLink->toArray()
#26 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Object(Statamic\\Fieldtypes\\Link\\ArrayableLink), 'link_field')
#27 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#28 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#29 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#30 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#31 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')
#32 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#33 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#34 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#35 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#36 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')
#37 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#38 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#39 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#40 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#41 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')
#42 /app/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map(Object(Closure), Array, Array)
#43 /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(777): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#44 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(64): Illuminate\\Support\\Collection->map(Object(Closure))
#45 /app/vendor/statamic/cms/src/Data/AugmentedCollection.php(90): Statamic\\Data\\AugmentedCollection->toArray()
#46 [internal function]: Statamic\\Data\\AugmentedCollection->Statamic\\Data\\{closure}(Array, 'link_field')```
Environment
Application Name: _
Laravel Version: 10.48.9
PHP Version: 8.3.6
Composer Version: 2.2.22
Environment: local
Debug Mode: ENABLED
URL: _
Maintenance Mode: OFF

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

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

Statamic
Addons: 2
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.20.0 Solo

Statamic Addons
jacksleight/statamic-bard-texstyle: 3.2.2
statamic/eloquent-driver: 4.14.1

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

Fresh statamic/statamic site via CLI

Additional details

No response

Langage dominant
PHP
Étoiles
4.9k
Forks
647
Merge moyen
1 j 45 min
PR mergées (30 j)
221

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de statamic/cms

Toutes les issues de statamic/cms

Issues similaires

Plus d'issues PHP

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.