Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

After a fresh install, a cache:clear is required and it's not effective without a wget + sleep before. #35932

Copy link
Copy link
Closed
@Dominic-Mayers

Description

@Dominic-Mayers
Issue body actions

Symfony version(s) affected: 5.0.x

Description

After a fresh install of symfony/skeleton + annotations + a minimal code that do a simple route, a cache:clear is required. Moreover, the cache:clear fails if we don't do a previous wget or the equivalent and then sleep a bit before clearing the cache.

How to reproduce

This occurs on Ubuntu 19.10. I put this code in .../www/bug_app_ressources/src/Controller/TestController.php

<?php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;

class TestController extends AbstractController
{
    /**
     * @Route("/test", name="test")
     */
    public function test()
    {
        return new Response(
            '<html><body>It\'s a test</body></html>'
        ); 
    }
}

and used this script to experiment:

cd /home/working/www
composer create-project symfony/skeleton bug_app
cd bug_app
composer require annotations
symfony server:ca:install
cp -p /home/working/www/bug_app_ressources/src/Controller/TestController.php ./src/Controller/
symfony serve -d 
# Issue: The app does not work unless we do a cache:clear.  
# Moreover, a wget followed by sleep is required for the cache:clear to be 
# effective.  Remove any of the three following commands to see that the 
# app will always fail. Depending on your environment, you might need to 
# increase the sleeping time to make it work.
wget https://localhost:8000/test
sleep .5
bin/console cache:clear -vvv
# After wget + sleep + cache:clear, depending on your environment, the next 
# wget to work might not occur immediately.
wget https://localhost:8000/test
sleep .05
wget https://localhost:8000/test
sleep .05
wget https://localhost:8000/test
sleep .05
wget https://localhost:8000/test
sleep .05
wget https://localhost:8000/test
sleep .05
wget https://localhost:8000/test
sleep .05
wget https://localhost:8000/test
symfony server:stop

Additional context

It's only bugging me when I write a script to install different environments from scratch to experiment with Symfony. The work around is already in the script that is given above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.