Hi StackOverflow community,
I'm working on a project with Sf2 and CouchDB database. I try to update my Sf2.7 to the last version, but when i update to Sf2.8, I have an error on cache clean / warmup commands.
[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 1 passed to Doctrine\Common\Annotations\AnnotationReader::__construct() must be an instance of Doctrine\Common\Annotations\DocParser, instance of Doctrine\Common\Annotations\CachedReader given, called in /var/www/symfony/app/cache/dev/appDevDebugProjectContainer.php on line 766
I know that CachedReader gonna be deprecated, but I don't know where to search to solve this.
I can't find this kind of issue on GitHub couchdb-odm / odm-bundle repositories ...
Tell me if you want more informations about all versions, and thanks for your help !
Stack trace:
0 /var/www/symfony/app/cache/dev/appDevDebugProjectContainer.php(766): Doctrine\Common\Annotations\AnnotationReader->__construct(Object(Doctrine\Common\Annotations\CachedReader))
1 /var/www/symfony/app/bootstrap.php.cache(2248): appDevDebugProjectContainer->getDoctrineCouchdb_Odm_DefaultDocumentManagerService()
2 /var/www/symfony/vendor/doctrine/couchdb-odm-bundle/Doctrine/Bundle/CouchDBBundle/CacheWarmer/ProxyCacheWarmer.php(35): Symfony\Component\DependencyInjection\Container->get('doctrine_couchd...')
3 /var/www/symfony/vendor/sy in /var/www/symfony/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php on line 176
You could always overwrite the service definition and remove the argument causing the issue
<service id="doctrine_couchdb.odm.metadata.annotation_reader" class="%doctrine_couchdb.odm.metadata.annotation_reader.class%" public="false">
</service>
Related
When deploying lumen application with Codeship I get an error
[ErrorException]
Missing argument 1 for Illuminate\Support\Manager::createDriver(), called i
n /home/rof/src/bitbucket.org/rakkle/rakkleapi/vendor/illuminate/support/Ma
nager.php on line 88 and defined
It comes when the deployment runs the seeder class for the eloquent model associated.
I don't get this error on my local machine. In the bootstrap/app.php I have added
$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');
$app->configure('scout');
$app->register(Laravel\Scout\ScoutServiceProvider::class);
$app->register(ScoutEngines\Elasticsearch\ElasticsearchProvider::class);
Yes I am using a custom scout engine, which works perfect on my machine.
I have come to a point where I know it's laravel/scout package giving the problem because when I remove the Searchable trait from the eloquent class that's giving the problem, the deploy run successfully.
I would like some insight and some direction in solving this issue.
Thanks
I found a solution to this problem.
Here's the full error that I duplicated on my machine
ErrorException: Missing argument 1 for Illuminate\Support\Manager::createDriver(), called in /var/www/vendor/illuminate/support/Manager.php on line 88 and defined
/var/www/vendor/illuminate/support/Manager.php:77
/var/www/vendor/illuminate/support/Manager.php:88
/var/www/vendor/illuminate/support/Manager.php:63
/var/www/vendor/laravel/scout/src/EngineManager.php:21
/var/www/vendor/laravel/scout/src/Searchable.php:203
/var/www/vendor/laravel/scout/src/Searchable.php:56
/var/www/vendor/laravel/scout/src/Searchable.php:35
/var/www/vendor/illuminate/support/Traits/Macroable.php:78
/var/www/vendor/laravel/scout/src/Searchable.php:112
/var/www/vendor/laravel/scout/src/ModelObserver.php:61
/var/www/vendor/illuminate/events/Dispatcher.php:367
/var/www/vendor/illuminate/events/Dispatcher.php:199
/var/www/vendor/illuminate/events/Dispatcher.php:172
/var/www/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php:148
/var/www/vendor/illuminate/database/Eloquent/Model.php:670
/var/www/vendor/illuminate/database/Eloquent/Model.php:518
/var/www/vendor/illuminate/database/Eloquent/Builder.php:734
/var/www/vendor/illuminate/support/helpers.php:936
/var/www/vendor/illuminate/database/Eloquent/Builder.php:735
/var/www/vendor/illuminate/database/Eloquent/Model.php:1357
/var/www/vendor/illuminate/database/Eloquent/Model.php:1369
/var/www/tests/PetListingTest.php:150
/var/www/tests/PetListingTest.php:93
What I had forgot to add was within the environment variables in codeship was the SCOUT_DRIVER that I was using for the search. I had it within the .env file, reason why it wasn't giving me the issue on my machine.
I'm getting the following error on random occasions, working on a Laravel 5.1 project on the latest homestead with PHP7
FatalErrorException in Handler.php line 25:
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of TypeError given, called in /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /home/vagrant/Code/henau/app/Exceptions/Handler.php:25
Stack trace:
#0 /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): App\Exceptions\Handler->report(Object(TypeError))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(TypeError))
#2 {main}
thrown
Even when I undo work that has been causing it, It stays. It's being caused by this block of code in this instance
\Mail::send('emails.registered', $user, function ($m) {
$m->to('miguel#dummyaddress.com')->subject('New Order');
});
It seems to me the error is not directly code-related. I've seen other people encounter it in complete different situations. And i've seen it popup in older threads regarding Homestead and PHP7. There was an askubuntu thread but it's offline, So I hope we can reopen the discussion here.
Solution
This is actually an error that an exception can't be shown. This is caused by using PHP7.x on an older Laravel project that requires PHP5.6.x
My solution was to create a new Homestead specific for this project and install php5.6 on that homestead using an older version of laravel/homestead
I had the same problem when running seeders Notflip . I'm usign Laravel framework 5.0.34. I had this structure:
App/Models/Users/ (My users's Models here)
After moving my users's models to the App directory, my seeder problem was solved.
Check your namespaces and put under consideration your Laravel Framework version before make changes in the framework.
Hope it helps!
This situation occur when laravel project version not compatible or not configured with your local installed version So the laravel not tracking the exact error and instead of showing exact error on line shows that type of errors
i had same problem in laravel 5.1. After reading this issue, i found out i was using laravel v5.1.0 and that seemed wrong so changed 5.1.0 to 5.1.* and ran composer update. this solved the issue for me.
Today I decided to upgrade my app from Laravel 5.0 to 5.1. But while upgrading, I am facing the following issue:
Catchable fatal error: Argument 1 passed to Illuminate\Config\Repository::__construct() must be of the type array, integer given, called in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 32 and defined in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Config/Repository.php on line 23
Please help me. I need to get my app up and running once again. Thank You.
I was facing the same error, and the issue was:
I created manually the files compiled.php, routes.php, config.php, and services.json inside bootstrap/cache folder, but those files do not need to exist, they will be generated by Laravel application.
https://github.com/laravel/laravel/tree/master/bootstrap/cache
del storage/bootstrap/cache/[files], this resovle my problem
I'm running an application stack which uses codeigniter along with doctrine2. I was successfully running the command line tool to generate my models, proxies and db till few days back. Y'day i made some additions to my XML mapping and now if i run
php doctrine-cli.php orm:create
it gives me the following error and exits:
[Doctrine\ORM\ORMException] This behaviour is (currently) not supported by Doctrine 2
How ever, i did
php doctrine-cli.php orm:validate-schema --verbose
Which gave me following message:
[Mapping] OK - The mapping files are correct.
[Doctrine\ORM\ORMException]
This behaviour is (currently) not supported by Doctrine 2
Exception trace:
() at C:\wamp\www\frsale\application\libraries\Doctrine\ORM\ORMException.php:12
8
Doctrine\ORM\ORMException::notSupported() at C:\wamp\www\frsale\application\lib
raries\Doctrine\ORM\Tools\SchemaTool.php:439
Doctrine\ORM\Tools\SchemaTool->_gatherRelationsSql() at C:\wamp\www\frsale\appl
ication\libraries\Doctrine\ORM\Tools\SchemaTool.php:213
Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata() at C:\wamp\www\frsale\ap
plication\libraries\Doctrine\ORM\Tools\SchemaTool.php:711
Doctrine\ORM\Tools\SchemaTool->getUpdateSchemaSql() at C:\wamp\www\frsale\appli
cation\libraries\Doctrine\ORM\Tools\SchemaValidator.php:287
Doctrine\ORM\Tools\SchemaValidator->schemaInSyncWithMetadata() at C:\wamp\www\f
rsale\application\libraries\Doctrine\ORM\Tools\Console\Command\ValidateSchemaCom
mand.php:77
Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand->execute() at C:\wamp\
www\frsale\application\libraries\Doctrine\Symfony\Component\Console\Command\Comm
and.php:239
Symfony\Component\Console\Command\Command->run() at C:\wamp\www\frsale\applicat
ion\libraries\Doctrine\Symfony\Component\Console\Application.php:193
Symfony\Component\Console\Application->doRun() at C:\wamp\www\frsale\applicatio
n\libraries\Doctrine\Symfony\Component\Console\Application.php:106
Symfony\Component\Console\Application->run() at C:\wamp\www\frsale\application\
doctrine-cli.php:42
orm:validate-schema
Can somebody point me what could be the problem here.
NOTE: my entities and proxies are generated without any problem
EDIT: Closing this as i found the issue and it was nothing but the relation defined in mapping which was creating a problem.
This error usually occurs when there is a problem in Entity mappings. For example:
/**
* #OneToMany(targetEntity="Task", mappedBy="")
*/
private $task
Here above mappedBy property is not specified, which results in this error.
I was trying to install MongoDB doctrine bundle as written in here
But when I ran the command
$ php bin/vendors install
It throws up the following error:
Fatal error: Call to undefined method
Doctrine\ODM\MongoDB\Configuration::setLoggerCallable()in
C:\wamp\www\Symfony\app\cache\dev\appDevDebugProjectContainer.php on line 245
I have followed the installation instructions to the word (which has not been much anyways...) and i have also double checked my installation... Is there something I am missing here?
Update : A similar problem is mentioned here, but even after following the answer there, i could not successfully configure DoctrineMongoDBBundle.
The latest changes in the Doctrine MongoDB repo have introduces this problem. To stick to a version before this happened, add this line to deps.lock:
doctrine-mongodb 5ccb18231218ce92c9d72295f69bebfe172ef5fb
Well, finally I managed to solve it by adding this to the deps file:
[DoctrineMongoDBBundle]
git=http://github.com/symfony/DoctrineMongoDBBundle.git
target=/bundles/Symfony/Bundle/DoctrineMongoDBBundle
version=origin/2.0
** note the
version=**origin**/2.0
which is different from the previously suggested simple
version=2.0.0 or something similar...
I have a hunch that this problem occurs only on Windows, I hope someone could kindly confirm this.