You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: $this->session->get('user_id') returns null since PR 62241 (in dev environment) #63137
I'm using https://github.com/nextcloud/nextcloud-docker-dev for local development of a Nextcloud app. Using the up to date nextcloud/server master branch within the dev repo, a call to $this->session->get('user_id') returns null. I couldn't find the exact change that causes this but I narrowed it down to the PR #62241. Before that PR was merged into master, $this->session->get('user_id') would return the session's user ID.
changed the title [-][Bug]: `$this->session->get('user_id')` returns `null` since PR 62241 in dev environment[/-][+][Bug]: `$this->session->get('user_id')` returns `null` since PR 62241 (in dev environment)[/+]on Aug 10, 2026
@Sector6759user_id is still set on master. Did you revert the PR changes and see the null go away, or perhaps narrow it down by merge date?
Also worth checking whether a breakpoint behind a logged-in route gives you the same null, since DateTimeZone is constructed on unauthenticated requests too.
@Sector6759user_id is still set on master. Did you revert the PR changes and see the null go away, or perhaps narrow it down by merge date?
What I did to narrow it down to the mentioned PR: inside my locally cloned nextcloud-docker-dev, I navigated to workspace/server, ran git reset --hard HEAD~<number> + git submodule update (+ npm ci) until $this->session->get('user_id') didn't return null anymore. I played around with the number of commits to reset until I discovered that before PR #62241 was merged, the problem didn't exist. Between those tries I obviously ran docker compose down -v + docker compose up nextcloud phpmyadmin to start clean every time. This is what my .env looks like
COMPOSE_PROJECT_NAME=masterPROTOCOL=httpsDOMAIN_SUFFIX=.localREPO_PATH_SERVER="/home/user/Projects/nextcloud-docker-dev/workspace/server"STABLE_ROOT_PATH="/home/user/Projects/nextcloud-docker-dev/workspace"NEXTCLOUD_AUTOINSTALL_APPS=""DOCKER_SUBNET=192.168.21.0/24PORTBASE=821PHP_XDEBUG_MODE=develop# SQL variant to use, possible values: sqlite, mysql, pgsqlSQL=mysqlPRIMARY=local# other values: "database-pgsql"PHP_VERSION=83
Also worth checking whether a breakpoint behind a logged-in route gives you the same null, since DateTimeZone is constructed on unauthenticated requests too.
I never even tested non-logged-in requests. I always made a login using the admin credentials.
If I run git checkout 86b97d53ed9e289cb5f2f367173c5ce0274bc86d + git submodule update (+ npm ci) inside workspace/server, which will revert back to the merge commit of PR #60888, which is the PR immediately before #62241 was merged, $this->session->get('user_id') does return the user's id. But doing the same with commit ID 0bf8efde430dc067e58243a0a9b21762be572e20 (#62241) results in that function returning null.
Activity
[-][Bug]: `$this->session->get('user_id')` returns `null` since PR 62241 in dev environment[/-][+][Bug]: `$this->session->get('user_id')` returns `null` since PR 62241 (in dev environment)[/+]CarlSchwan commentedon Aug 11, 2026
I don't really get how this can happen. the PR is adding quite a bit of stuff but it's not touching at the session management
Sector6759 commentedon Aug 11, 2026
Maybe it's a change in the https://github.com/nextcloud/3rdparty submodule?
pringelmann commentedon Aug 24, 2026
@Sector6759
user_idis still set on master. Did you revert the PR changes and see the null go away, or perhaps narrow it down by merge date?Also worth checking whether a breakpoint behind a logged-in route gives you the same null, since
DateTimeZoneis constructed on unauthenticated requests too.Sector6759 commentedon Aug 24, 2026
What I did to narrow it down to the mentioned PR: inside my locally cloned
nextcloud-docker-dev, I navigated toworkspace/server, rangit reset --hard HEAD~<number>+git submodule update(+npm ci) until$this->session->get('user_id')didn't returnnullanymore. I played around with the number of commits to reset until I discovered that before PR #62241 was merged, the problem didn't exist. Between those tries I obviously randocker compose down -v+docker compose up nextcloud phpmyadminto start clean every time. This is what my.envlooks likeI never even tested non-logged-in requests. I always made a login using the admin credentials.
If I run
git checkout 86b97d53ed9e289cb5f2f367173c5ce0274bc86d+git submodule update(+npm ci) insideworkspace/server, which will revert back to the merge commit of PR #60888, which is the PR immediately before #62241 was merged,$this->session->get('user_id')does return the user's id. But doing the same with commit ID0bf8efde430dc067e58243a0a9b21762be572e20(#62241) results in that function returningnull.