New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Call to a member function getUniqueId() on a non-object' when running two console commands at once #10028
Comments
Weird. |
Yeah. :) Can you reproduce? |
No. |
I'm having exactly the same issue, but with web Controller and in 100% of cases. My situation is a bit more complicated - I have app on Yii1 and I'm trying to add Yii2 as hybrid. Yii1 controllers works fine, but single Yii2 controller fails with the same error in the same line. I have only Yii2 controller, no models or views and it looks super simple: use yii\web\Controller;
class InvoiceController extends Controller
{
public function actionIndex()
{
print 123;
\Yii::$app->end();
return $this->render('index');
}
} Do I have any options? |
@EvgeniySpinovSell what is the output of |
@cebe |
that is weird, how did you create the controller? |
I've created the folder "controllers", created file mentioned above. Added route to an controllerMap in the config of yii1, so the request would be routed to a proper controller, like this:
and rule to url manager so it won't do default processing for this module, instead, just proceed with Then I call in browser: |
And just to clarify the thing: I've added var_dump() which I've attached to a yii2\web\Controller class itself ( i.e. modified framework controller to get a dump ), cause adding the function to my controller won't make it working, cause it won't reach it. Proof:
|
seems like you want to use a yii2 controller in the yii1 routing process. This does not work because controllers in yii2 are created differently from yii1. |
This is exactly my impression, but how would I add Yii2 code to a Yii1 project? According to migration guide published on Yii2 site, which I've followed, it should be possible by modifying entry point and configs. |
you can not mix yii1 and yii2 controllers in one app. If you run the Yii2 application, you need to use yii2 controllers, if you run the Yii1 application, you need to use yii1 controllers. |
This is actually a very valuable feedback cause it's not mentioned anywhere. Probably you should state this in the guide. Thank you for your help, won't offtopic here anymore, cause my issue have a different root as figured. |
Hi!
I get this error when trying to run two console jobs at once:
The line that fails is this:
So obviously there is no module in my application. Bug or configuration error?
The console command runs fine when only running one at a time. But I need to make sure there won't be any race conditions.
Grateful for any help.
The text was updated successfully, but these errors were encountered: