I have a similar problem of https://www.drupal.org/project/filecache/issues/3045245
Tested also the patch but it doesn't solve the issue

The difference is that compared to the above issue which happens by activating syslog, in my case it also occurs with the module not installed.

My error message:
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "cache.backend.file_system", path: "http_kernel -> http_middleware.negotiation -> http_middleware.reverse_proxy -> http_middleware.page_cache -> cache.page -> cache.backend.file_system -> file_system -> logger.channel.file -> logger.factory -> logger.syslog -> config.factory -> config.storage -> cache.config". in Drupal\Component\DependencyInjection\Container->get() (line 143 of /Users/Advscraper/Sites/devdesktop/drupal-8.8.5/core/lib/Drupal/Component/DependencyInjection/Container.php)

I must specify two things:
- Test setting for the filecache directory seems to work since it creates files in the correct directory
$settings['filecache']['directory']['default'] = '/users/advscraper/sites/devdesktop/filecache';
I report here the content of one of the two files under the 'filecache/config' subfolder since it contains reference to syslog (I'm not an expert, so I don't know if it's important):
O:8:"stdClass":6:{s:3:"cid";s:15:"syslog.settings";s:4:"data";a:4:{s:8:"identity";s:6:"drupal";s:8:"facility";i:128;s:6:"format";s:72:"!base_url|!timestamp|!type|!ip|!request_uri|!referer|!uid|!link|!message";s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"vdXLRPZRg35PBykBRRXr6RTql5EJR_fUi2kxyZ8c5m0";}}s:6:"expire";i:-1;s:4:"tags";a:0:{}s:7:"created";d:1587368519.674;s:8:"checksum";i:0;}

- Test override to specific cache bins also work without errors:
$settings['cache']['bins']['entity'] = 'cache.backend.file_system';
$settings['cache']['bins']['page'] = 'cache.backend.file_system';

It remain the problem of '$settings['cache']['default'] = 'cache.backend.file_system'; which I hope it can be solved.

I hope that what I've reported can help and thanks to those who can help me

Comments

senzaesclusiva created an issue. See original summary.

idflorin’s picture

Same error:

#1 /www/wwwroot/spare-wheel.com/core/lib/Drupal/Core/Cache/CacheFactory.php(83): Drupal\Core\Cache\ChainedFastBackendFactory->get()
#2 [internal function]: Drupal\Core\Cache\CacheFactory->get()
#3 /www/wwwroot/spare-wheel.com/core/lib/Drupal/Component...PHP message: Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "cache.backend.file_system", path: "http_kernel -> http_middleware.negotiation -> http_middleware.reverse_proxy -> http_middleware.page_cache -> cache.page -> cache.backend.file_system -> file_system -> logger.channel.file -> logger.factory -> config.factory -> config.storage -> cache.config". in /www/wwwroot/spare-wheel.com/core/lib/Drupal/Component/DependencyInjection/Container.php on line 143 #0 /www/wwwroot/spare-wheel.com/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php(89): Drupal\Component\DependencyInjection\Container->get()
#1 /www/wwwroot/spare-wheel.com/core/lib/Drupal/Core/Cache/CacheFactory.php(83): Drupal\Core\Cache\ChainedFastBackendFactory->get()
#2 [internal function]: Drupal\Core\Cache\CacheFactory->get()
#3 /www/wwwroot/spare-wheel.com/core/lib/Drupal/Component/DependencyInjection/Container.p

Drupal 8.8.5/PHP 7.4

senzaesclusiva’s picture

[SOLVED] I solved this way:

After seeing that

$settings['cache']['bins']['page'] = 'cache.backend.file_system';
$settings['cache']['default'] = 'cache.backend.file_system';

did not give errors and the above cache files was created, I made sure that the main filecache folder directory, located (in my case) in the root of the 'devdesktop' application, was set to chmod 700

After this I have inserted as first instance the directory of filecache folder
$settings['filecache']['directory']['default'] = '/Users/Advscraper/Sites/devdesktop/filecache';
Still no error.
Therefore i set
$settings['cache']['bins']['entity'] = 'cache.backend.file_system';
No logs and system error now!
and magically my 'filecache' folder has been properly populated with cache directories !!

So, the final result in settings.php file is

$settings['filecache']['directory']['default'] = '/Users/Advscraper/Sites/devdesktop/filecache';
$settings['cache']['bins']['entity'] = 'cache.backend.file_system';
$settings['cache']['bins']['page'] = 'cache.backend.file_system';
$settings['cache']['default'] = 'cache.backend.file_system';

and here you can see the image of the filecache folders structure
https://res.cloudinary.com/acid57ads/image/upload/v1589277516/filecache_...

Drupal 8.8.5 Php 7.2.18
Maybe flush/clear cache and server restart could help in some cases

idflorin’s picture

#3 works if I change this

$settings['cache']['default'] = 'cache.backend.file_system';
to
$settings['cache']['bins']['default'] = 'cache.backend.file_system';

socialnicheguru’s picture

I do want to note that this is correct to set the default filecache bin:

$settings['cache']['default'] = 'cache.backend.file_system';

However the workaround above did not work for me in php8.1 Drupal9.5.8.

I had to add this patch to my composer.json file:
"for filecache and syslog to work - Dependency on config storage causes circular reference in service container":"https://www.drupal.org/files/issues/2023-02-22/3103620-34.patch",

without it I get the following:
The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "cache.backend.file_system", path: "http_kernel -> http_middleware.negotiation -> http_middleware.reverse_proxy -> http_middleware.redirect_after_webform_submit -> http_middleware.page_cache -> cache.page -> cache.backend.file_system -> file_system -> logger.channel.file -> logger.factory -> logger.syslog -> config.factory -> config.storage -> cache.config". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).

I do have webform enabled. I did not try it without webform enabled.

socialnicheguru’s picture

Title: Another (different) circular reference detected between filecache and syslog » [WORKAROUND] Another (different) circular reference detected between filecache and syslog
kensae’s picture

This configuration works for me:

$settings['cache']['default'] = 'cache.backend.file_system';
$settings['cache']['bins']['config'] = 'cache.backend.database';
$settings['cache']['bins']['discovery'] = 'cache.backend.database';
$settings['cache']['bins']['bootstrap'] = 'cache.backend.database';
$settings['cache']['bins']['data'] = 'cache.backend.database';
$settings['filecache']['directory']['default'] = '/app/private/filecache';
senzaesclusiva’s picture

Sorry @Kensae
given the time elapsed, on which Drupal version did you set up this configuration?

kensae’s picture

I'm using Drupal 10.1.4

senzaesclusiva’s picture

Many thanks

geek-merlin’s picture

Title: [WORKAROUND] Another (different) circular reference detected between filecache and syslog » Circular reference between filecache and syslog
Category: Support request » Bug report
Status: Active » Postponed
Related issues: +#3103620: Dependency on config storage causes circular reference in service container

It is that core issue, postponing on it.

mfb’s picture

Status: Postponed » Postponed (maintainer needs more info)

I read thru this issue but I don't understand it. A circular reference re: syslog module when syslog module is not installed? Can someone provide steps to reproduce?