No entry or class found for 'MongoProxy.InsertOne'
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with the reported MongoProxy.InsertOne failure and trace the container lookup at vendor/hyperf/di/src/Container.php:79 through SocketIPCReceiver.php lines 130 and 85. Reproduce the error after the application has run for some time, then compare it with the provided insertOne method. Done means the recurring lookup failure is understood and the Mongo insert path no longer produces this exception.
Written by the indexing model from the issue text.
Description
运行一段时间后,报错 ,hyperf 版本是2.2最新版本
log.ERROR: Insert Document hybrid error 'Hyperf\Di\Exception\NotFoundException: No entry or class found for 'MongoProxy.InsertOne'(0) in /app/web/accept/vendor/hyperf/di/src/Container.php:79
Stack trace:
#0 /app/web/accept/vendor/hyperf/di/src/Container.php(127): Hyperf\Di\Container->make()
#1 /app/web/accept/vendor/hyperf/gotask/src/IPC/SocketIPCReceiver.php(130): Hyperf\Di\Container->get()
#2 /app/web/accept/vendor/hyperf/gotask/src/IPC/SocketIPCReceiver.php(85): Hyperf\GoTask\IPC\SocketIPCReceiver->dispatch()
#3 {main}' on 'Hyperf\GoTask\Relay\CoroutineSocketRelay'
public function __construct(ContainerInterface $container,MongoClient $client)
{
$this->container = $container;
$this->logger =$container->get(LoggerFactory::class)->get("log");
$this->database = $client->database('test');
}
public function insertOne(string $collect,array $data)
{
try{
return $this->database->collection($collect)->insertOne($data);
}catch (\Throwable $e){
$this->logger->error("Insert Document {$collect} ".$e->getMessage());
}
return null;
}
- Dominant language
- PHP
- Stars
- 255
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hyperf/gotask
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
这个项目还维护吗Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
gotask是不支持协程风格吗?Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
mailcow/mailcow-dockerized#7652 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
benjaminkott/bootstrap_package#1675 ·