Running a console command produces an error mentioning sessions. How do I resolve? None of the craft core console commands to work.
For example: ./yiic querygen all My_MyRecord produces an error which includes mention of session?

How do I get craft console commands working again?
You probably have a plugin which is listening to the userSession.onLogin event and trying to access the current user from the session.

The solution is for the plugin developer to wrap the event listener to ignore console sessions like this:

    if(!craft()-&gt;isConsole())
    {
        craft()-&gt;on('userSession.onLogin',
            [
                craft()-&gt;market_customer,
                'loginHandler'
            ]
        );
    }