FosOauthServerBundle Propel BaseClient not found - php

I'm using doctrine orm but somehow I get an error that the propel BaseClient is not found (a class usually autogenerated by propel).
Either it's a bug or I'm doing something wrong?
fos_oauth_server:
db_driver: orm
client_class: Diligentia\OAuthBundle\Entity\Client
access_token_class: Diligentia\OAuthBundle\Entity\AccessToken
refresh_token_class: Diligentia\OAuthBundle\Entity\RefreshToken
auth_code_class: Diligentia\OAuthBundle\Entity\AuthCode
service:
user_provider: fos_user.user_manager
The error:
PHP Fatal error: Class 'FOS\OAuthServerBundle\Propel\om\BaseClient' not found in /var/www/redwood/vendor/friendsofsymfony/oauth-server-bundle/Propel/Client.php on line 19
Fatal error: Class 'FOS\OAuthServerBundle\Propel\om\BaseClient' not found in /var/www/redwood/vendor/friendsofsymfony/oauth-server-bundle/Propel/Client.php on line 19
Segmentation fault
Seems to me it shouldn't even attempt to load it.

predis wasn't installed with composer causing my caching not to work.
Due to that the User Bundle was unable to obtain which db driver I used and putting propel as default causing the unrelated error and my inability to find the issue for a long time.

Related

Downgrading Twig: Uncaught Error: Call to undefined method Twig\Environment

I'm using Symfony 4.4 on a project and I need to use stfalcontinymce. Since I'm on SF4 I need the version 2.4. So I did this:
composer require stfalcon/tinymce-bundle=2.4
But then I get this error:
!! 11:03:44 CRITICAL [php] Uncaught Error: Class 'Twig_Extension' not found ["exception" => Error { …}]
!!
!! In StfalconTinymceExtension.php line 13:
!!
!! Attempted to load class "Twig_Extension" from the global namespace.
!! Did you forget a "use" statement?
Someone told me that it's because this version doesn't get along with Twig 3 so I need to downgrade my Twig version. I then did this to downgrade Twig:
composer require twig/twig=2
But then I get this error:
13:14:07 CRITICAL [php] Uncaught Error: Call to undefined method Twig\Environment::registerUndefinedTokenPa
rserCallback() ["exception" => Error { …}]
!!
!! In srcApp_KernelDevDebugContainer.php line 2040:
!!
!! Attempted to call an undefined method named "registerUndefinedTokenParserCallback" of class "Twig\Environm ent".
!! Did you mean to call e.g. "registerUndefinedFilterCallback" or "registerUndefinedFunctionCallback"?
I tried adding in composer.json
"twig/extensions": "*"
Then composer install, then running the command:
composer require stfalcon/tinymce-bundle=2.4 -W
And I get this error:
!! 13:49:04 CRITICAL [php] Uncaught Error: Call to undefined method
Twig\Environment::registerUndefinedTokenParserCallback() ["exception" => Error { …}]
!!
!! In srcApp_KernelDevDebugContainer.php line 2045:
!!
!! Attempted to call an undefined method named "registerUndefinedTokenParserCallback" of class "Twig\Environment".
!! Did you mean to call e.g. "registerUndefinedFilterCallback" or "registerUndefinedFunctionCallback"?
I'm really lost here. Can someone help? thanks
Your executed commands don't seem to be possible on my system at all since there will be version constraint conflicts.
Instead of restricting to one version for your dependencies, you should use a constraint.
Your require in composer.json may contain something like the following
"twig/twig": "^2",
"stfalcon/tinymce-bundle": "2.4.*",
"twig/extra-bundle": "^2"
The constraints are explained here. But the ^2 basically means >= 2.x.x and < 3.0.0
For the tinymce bundle I used the above because of the this GitHub issue
Furthermore twig/extensions seems to be deprecated, and this GitHub issue mentions twig/extra-bundle which is needed and may be its replacement.

Symfony 3.3 Getting ClassNotFoundException

I have updated my system to from Symfony 3.2.x to Symfony 3.3.x and now I cam getting this error for every bundle in my application:
Attempted to load class "XXXXXXXXPublicBundle" from namespace "XXXXXXXX\PublicBundle".
Did you forget a "use" statement for another namespace?
In my PublicBundle I am using the namespace:
namespace XXXXXXXX\PublicBundle;
When I try and run php composer.phar update I get this error too:
Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "XXXXXXXXPublicBundle" from namespace "XXXXXXXX\PublicBundle".
What is going on - I have no clue what to do. Any assistance?

Symfony 3 Error: session_start(): Failed to initialize storage module: user (path: ) 500 Internal Server Error - FatalErrorException

I'm trying to configure sessions in Symfony 3 (http://symfony.com/doc/current/doctrine/pdo_session_storage.html), and I'm getting this error:
Error: session_start(): Failed to initialize storage module: user (path: )
500 Internal Server Error - FatalErrorException
Stack Trace
in var/cache/dev/classes.php at line 113
110. if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
111. throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
112. }
113. if (!session_start()) {
114. throw new \RuntimeException('Failed to start the session');
115. }
116. $this->loadSession();
Do you have any ideas, why it;s occurring?
I had similar problem recently with symfony running in docker container. The reason in my case was that PdoSessionHandler couldn't connect to the database. In the official tutorial they show an example without host key in DSN which probably works fine for the most installations. In the end my service definitions looks this way:
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
arguments:
- 'mysql:dbname=%database_name%;host=%database_host%'
- { db_username: '%database_user%', db_password: '%database_password%' }
I hope it helps someone!
I found the solution.
In my case in docker configuration for my database server I'm using socket, so I just needed to add it to my config.yml file:
parameters:
database_unix_socket: /.../mysqld.sock
And then use this config in doctrine.dbal.unix_socket:
doctrine:
dbal:
unix_socket: '%database_unix_socket%'
Cheers,
Ivan.

Codeception raise fatal error with Laravel 4 and Guzzle HTTP

I'm using Laravel 4.2.* and Codeception 2.* for the record.
When I try to create an acceptance test with Laravel4 module I use this configuration
## Other code
config:
Laravel4:
# This file is in app/tests/acceptance.suite.yml
start: '/../../bootstrap/start.php'
cleanup: true
## Other code
And it works, I mean I can build it. But when I run codecept run it fails and raise a fatal error.
Fatal error: Cannot redeclare GuzzleHttp\Stream\create() (previously
declared in
phar:///usr/local/Cellar/codeception/2.0.0/libexec/codecept-2.0.0.phar/vendor/guzzlehttp/streams/src/functions.php:14)
in /Users/Ludo237/Sites/l4/vendor/guzzlehttp/streams/src/functions.php
on line 14
The problem seems to be Guzzle. I'm using guzzle on my application but codeception uses it too.
How can I solve this conflict?
For a quick fix just move the global codeception install inside the project and require it trough composer...

Symfony2: Fatal error: Interface 'Knp\Menu\Matcher\Voter\VoterInterface' not found in

I wanted to integrate twitter-bootstrap in my Symfony2 project and trying to make it work, I followed documentation is BootstrapBundle.
After installing all dependencies set in composer.json, i get this error:
Fatal error: Interface 'Knp\Menu\Matcher\Voter\VoterInterface' not found in /var/www/cv- editor/vendor/mopa/bootstrap-sandbox-bundle/Mopa/Bundle/BootstrapSandboxBundle/Navbar/Example/Voter/RequestVoter.php on line 12
Have you any idea ?
After debvugging, i found that there is a problem in dependencies of MopaBootsrapBundle which works with Knp-menu-bundle version 1.2

Categories