Giter Club home page Giter Club logo

Comments (6)

davidwdan avatar davidwdan commented on August 29, 2024

@stingus can you provide the code I need to reproduce the error?

from thruwaybundle.

stingus avatar stingus commented on August 29, 2024

Not my actual setup but it reproduces the error:

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Voryx\ThruwayBundle\Annotation\Register;
use Voryx\ThruwayBundle\Annotation\Worker;

/**
 * @Worker("worker", maxProcesses="1")
 */
class Test extends Controller
{
    /**
     * @Register("test")
     */
    public function testAction()
    {
        $this->get('templating')->render('@AppBundle/Mail/body.html.twig');
    }
}

I'm calling the templating service, which loads twig, which loads file_locator service. The last one crashes when it injects the kernel, which is not present in the container.

from thruwaybundle.

jonday-simitive avatar jonday-simitive commented on August 29, 2024

Did anything further happen with this issue, we are experiencing the same issue with Symfony 2.8.13 ...

The first call to $this->get('kernel') from inside the ThruwayBundle seems to result in calling the appDevProjectContainer getKernelService which throws the exception but unsure why this would be

Originally thought this might be an issue with Symfony under certain circumstances (It seems like loading the Bundle into a vanilla Symfony install doesn't have the issue).

from thruwaybundle.

rsouverain avatar rsouverain commented on August 29, 2024

I just had a similar problem

    /**
     * @Register("test")
     */
    public function testAction()
    {
        $firstUser = $this->get('sonata.user.manager.user')->find(1);
        // the process will hang there, not able to do shit
        return ['this is never returned'];
    }

I think this may be related to some errors in yml configs, unrelated with ThruwayBundle, making some services unavailable from a ContainerAwareCommand

from thruwaybundle.

jonday-simitive avatar jonday-simitive commented on August 29, 2024

I can't remember the exact details of this because it was so long ago. I can tell you that the issue we had was because we had dependencies on services that injected @session in one of our registered resources. As I understand it you need to move your auth code into AuthProviderClient and use WAMP auth flow. Still not sure if you can get services that depend on session in the auth provider.

from thruwaybundle.

lethak avatar lethak commented on August 29, 2024

Same here, I tried with symfony 2.8.12 and 2.8.28

        "voryx/thruway": "^0.4.2",
        "voryx/thruway-bundle": "dev-master",

as soon as I do from a worker/RPC:

$this->get('templating')->render('@........html.twig'); // Email template

I get

"You have requested a synthetic service ("kernel")". The DIC does not know how to construct this service.

This is quite frustrating

so far I am unable to find the exact cause, I am digging into

vendor/voryx/thruway-bundle/src/Voryx/ThruwayBundle/DependencyInjection/Compiler/AnnotationConfigurationPass.php:56

    if ($class->implementsInterface('Symfony\Component\DependencyInjection\ContainerAwareInterface')) {
        $container->setDefinition($serviceId, $definition)
            ->addMethodCall('setContainer', [new Reference('thruway_container')]);
    } else {
        $container->setDefinition($serviceId, $definition);
    }

Replacing thruway_container with service_container seems to be working, but not sure what is the pupose of having a custom container in the first place

from thruwaybundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.