Closed SlyDave closed 3 years ago
Debugbar exception: Trying to get property 'cookies' of non-object
Same Error: Debugbar exception: Trying to get property 'cookies' of non-object
So? Who will can fix that?
+1
+1
+1
+1
+1
+1
Barry? Do you have the time to fix this? It is cluttering the logs ;-)
+1
+1
So on routes without session?
So on routes without session?
Yes
So what is your session driver, cookies
? Any other non-default settings?
In development have it as file
Having same issue. Subscribing....
I have the same too...
+1
Can you share at least some configuration? Devs cannot find when this is happening.
So what is your session driver, cookies? Any other non-default settings?
@barryvdh When I use the cookie
session driver, the error occurs.
SESSION_DRIVER=cookie
When I use the file
session driver, the problem is solved.
SESSION_DRIVER=file
I have encountered the same issue while using Laravel Vapor.
I have set SESSION_DRIVER=redis
in my .env
file. I thought it solved the issue but got another error :
NOTICE: PHP message: [2020-07-14 19:28:07] dev.ERROR: Undefined offset: 0 {"exception":"[object] (ErrorException(code: 0): Undefined offset: 0 at /var/task/vendor/maximebf/debugbar/src/DebugBar/Storage/RedisStorage.php:59)
EDIT :
I suppose SESSION_DRIVER=file
cannot be used with Laravel Vapor.
I also realize this issue may be caused by large cookies and their size limit (in our case).
I am trying to understand why the redis session driver is not working properly on our side.
Same with the laravel/sanctum and SESSION_DRIVER=cookie. It happens on standart laravel login if you check "Remember me" after you already logged with different guard using laravel/sanctum.
+1
+1
I have encountered the same issue while using Laravel Vapor. I have set
SESSION_DRIVER=redis
in my.env
file. I thought it solved the issue but got another error :NOTICE: PHP message: [2020-07-14 19:28:07] dev.ERROR: Undefined offset: 0 {"exception":"[object] (ErrorException(code: 0): Undefined offset: 0 at /var/task/vendor/maximebf/debugbar/src/DebugBar/Storage/RedisStorage.php:59)
EDIT : I suppose
SESSION_DRIVER=file
cannot be used with Laravel Vapor. I also realize this issue may be caused by large cookies and their size limit (in our case).I am trying to understand why the redis session driver is not working properly on our side.
I've same issue.
After research, there is an error in maximebf/php-debugbar
package.
If I edit /vendor/maximebf/debugbar/src/DebugBar/Storage/RedisStorage.php
on line 59:
# list($cursor, $data) = $this->redis->hscan("$this->hash:meta", $cursor);
$data = $this->redis->hscan("$this->hash:meta", $cursor);
It fix the error ;)
Might be that it's not compatible with the latest Redis version. Not really tried using Vapor, as Debugbar is meant as a local debug tool.
I don't use Vapor, I use last 5 version of Redis, actually 5.0.10, and not the 6 release. We use debugbar in local and staging: we can enable debugbar in case of problem with header, that's cool for debugging last minute unexpected bugs... We can't use file storage as we work in Cloud: request can be send to other node that don't have needed files...
PS: I didn't see require version of Redis or Redis driver in composer.json
in maximebf/php-debugbar
or in these package :(
Redis is not required by default.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.
Same here
Still happening. Also when using redis, I get this: Redis ERROR: Undefined offset: 0
Same as @jcolfej
I have encountered the same issue while using Laravel Vapor. I have set
SESSION_DRIVER=redis
in my.env
file. I thought it solved the issue but got another error :NOTICE: PHP message: [2020-07-14 19:28:07] dev.ERROR: Undefined offset: 0 {"exception":"[object] (ErrorException(code: 0): Undefined offset: 0 at /var/task/vendor/maximebf/debugbar/src/DebugBar/Storage/RedisStorage.php:59)
EDIT : I suppose
SESSION_DRIVER=file
cannot be used with Laravel Vapor. I also realize this issue may be caused by large cookies and their size limit (in our case). I am trying to understand why the redis session driver is not working properly on our side.I've same issue.
After research, there is an error in
maximebf/php-debugbar
package. If I edit/vendor/maximebf/debugbar/src/DebugBar/Storage/RedisStorage.php
on line 59:# list($cursor, $data) = $this->redis->hscan("$this->hash:meta", $cursor); $data = $this->redis->hscan("$this->hash:meta", $cursor);
It fix the error ;)
Debugbar: 3.2.8 Laravel: 5.7 and 5.8 and 6
Debugbar is causing cookie/session problems when being injected via InjectDebugbar() on error pages.
ErrorException/public/index.php in ? Notice: Trying to get property 'cookies' of non-object
This occurs whenever a 404 error/page is returned. the 404 page is displayed, the debugbar is missing from it and our error tracking system reports this error.