nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.25k stars 4.05k forks source link

[Bug]: TypeError: `OCA\UserStatus\Controller\UserStatusController::__construct()` Argument #3 ($userId) must be of type string, null given #42156

Open AndyXheli opened 10 months ago

AndyXheli commented 10 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Error on NC 28 RC4

TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#52 --

Steps to reproduce

Note Sure

Expected behavior

Not Sure

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

{"reqId":"FmLnDVSDpkhdslGeqk0R","level":3,"time":"2023-12-10T16:01:39-06:00","remoteAddr":"172.58.164.60","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#52","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 17_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E148 Safari/604.1","version":"28.0.0.10","data":{"app":"PHP"},"id":"6577154851e57"}

Additional info

No response

Git-ChrisSc commented 9 months ago

this Problem suddendly occurs in my fresh installation, too. Problem is: I can not access to my Account, even the Calender!

Some interesting things: I was logged into my account and tried to open the Dashboard. A hint Appears. grafik

In Browsers Privatmode i tried to login, but this message appears: grafik

In the Logfiles i have see this Messages: grafik

In this time, the App seems to working, davx also.

The strange Problem ist: This Error Appears after 4 days that this service is working. Sometimes, i can login.. but i have no idea.

Access througe reverseProxy -> nginx with Nextcloud

also in the screenshots, you can see, the following bug: https://github.com/nextcloud/server/issues/42157

Bug description

Error on NC 28 TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument https://github.com/nextcloud/server/pull/3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#52

Steps to reproduce

Note Sure

Expected behavior

Not Sure

Installation method

Community Manual installation with Archive

Nextcloud Server version

28.0.1

Operating system

Ubuntu 23.04 as LXC Container in Proxmox

PHP engine version

PHP 8.1

Web server

nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Bug appears SUDDENTLY after fresh install.

I have to config memcache and redis - but this thing i have not allready done, because i don't know how to do this. Also i have the problem, that SMB is not working. But for this, i will open on other ticket...

My Config file

<?php
$CONFIG = array (
  'instanceid' => 'occ---',
  'passwordsalt' => 'c81f82---',
  'secret' => '5df3917eb8e--->
  'trusted_domains' => 
  array (
    0 => 'nxcloud.---.--',
    1 => '10.0.---',
    2 => 'localhost',
  ),
  'trusted_proxies' => 
  array (
    0 => '10.0.---',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.1.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => '---',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '---',
  'dbpassword' => '---',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'Info',
  'mail_domain' => '---',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '---',
  'mail_smtpname' => '---',
  'mail_smtppassword' => '---',
  'mail_smtpport' => '---',
  'app_install_overwrite' => 
  array (
    0 => 'riotchat',
  ),
);
gjpc commented 9 months ago

A few days earlier I got this Error which may be related, the user name is redacted:

DbalException An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry **'REDACTED'** for key 'user_status_uid_ix' Exception thrown: OC\DB\Exceptions\DbalException

Nextcloud Hub 7 (28.0.1)
PHP Version: 8.2.14
DB: Type: mysql Version: 10.3.38 Operating System: Linux 5.15.0-76-generic x86_64

SenileMonkey commented 9 months ago

Same here. I tried reinstalling nextcloud but the problem persists. Fix?

Installation method

Community Manual installation with Archive

Nextcloud Server version

28.0.1

Operating system

Ubuntu 23.04

PHP engine version

PHP 8.2

Bug description

TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#53

eikaramba commented 9 months ago

I also experience the same Problem.

I have nextcloud installed on a proxmox server via https://tteck.github.io/Proxmox/ script

PHP 8.1.2 Nextcloud 28.0.1

I am trying to access a file via Webdav when the error happens. It happens repeatable. I don't actually think that i changed anything on the server

Git-ChrisSc commented 9 months ago

Okay, some more Checks: IT seems for my, this ist a Problem in combination by using a Reverse Proxy and browsing from local Network.

If i try to Open and Work with the internal IP from nextcloud IT IS working without Problems.

Same, If i am in my company und using IT with Reverse Proxy - No Problems .

My Mobile Phone works at bothtimes.

Strange behavior.

eikaramba commented 9 months ago

i am too using "nginx reverse proxy" in a lxc container to access it from remote.

gjpc commented 9 months ago

Neither the null string error nor the duplicate entry error has reoccurred on my system. I am not using a proxy. I am also using Apache

igebara commented 9 months ago

Same problem after installing 28.00. I have nextcloud via nginx reverse proxy.

Git-ChrisSc commented 8 months ago

hello,

Today I also had this problem on my business laptop. This laptop (from my office) has never had this problem. Interesting thing after i take a look in the log, the log didn't show me anything what i have understand, but here is a picture.

I see: suddently the username was not transmitted, from internal and from external. (Both over NPM) grafik

After a few Minutes later ( I was in a Meeting) both ways were working again!

Maybe a hint: @eikaramba @igebara

can you please check if you have activated? "Cache" and give me a return if yes or not? grafik

Katzenkralle commented 8 months ago

Hello, I do have the same problem using Nginx Proxy manager. I have all three: Cache Assets, Websockets Support and Block Common Exploits enabled. I also set client_body_buffer_size 512k; proxy_read_timeout 86400s; client_max_body_size 0; in the Advanced tab.

eikaramba commented 8 months ago

same here, NRP with cache assets and block common expliots enabled.

Git-ChrisSc commented 8 months ago

Does websocket works? Websocket works Not by me, but this ist Not the Problem in this Moment...

My advanced tab has more entries.


Okay, i have deactivated "cache asset" and "my" Problem disappears instantly!

But in dont know If that ist the solution or IT was a coincidence. My Desktop PC at Home has never worked again since my First Message here, but know, IT IS working.

Maybe someone will Test it, too?

eikaramba commented 8 months ago

unfortunately i am not reliable able to reproduce the issue. it happened when i tried to access a file via webdav. however if i do it again it always works directly without changing anything so i suspect that it might be only happening after some time. will see again in a few days maybe

Git-ChrisSc commented 8 months ago

Problem has not appear anymore since I have deactiviated the Cache.

Katzenkralle commented 8 months ago

Same for me, the problem disapiered.

joshtrichards commented 8 months ago

"Cache Assets" should not be enabled with Nextcloud in NPM.

NPM has a very aggressive cache configuration:

https://github.com/NginxProxyManager/nginx-proxy-manager/blob/209c1b33347d1ea82870e742edf5039cc254d7ba/docker/rootfs/etc/nginx/conf.d/include/assets.conf#L4

It serves no real purpose with Nextcloud. Typically a reverse proxy is colocated alongside Nextcloud Server (i.e. not on the other side of the world from it) and the browser caches the assets anyhow.

Having that option enabled will likely lead to numerous problems with Nextcloud because it ignores managed headers and intentional cache busting.

nicoketzer commented 8 months ago

Hello everyone, I had the same problem as mentioned above.

The tip with the Nginx reverse proxy solved the problem for me.

My behavior was exactly as described in the last messages. I was able to call up the login page and then get to the overview in an "old" session. Afterwards I always got the message "You are not logged in" (as described above). In a private session, the "Unexpected error" always appeared.

After deactivating the caching function of the reverse proxy, the installation is now running again without any problems.

One solution here (I don't think caching in general is wrong for a reduction in server load) would be to add a time stamp to the login requests so that a "new" login URL is generated every single second. This effectively bypasses the caching of the reverse proxy (normal caching would also be bypassed regardless of the caching method)

naelfe commented 7 months ago

I do have the same error message as well: TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /config/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#54

They occurred the last time on 4th, 6th and 10th of March. I am running:

The last error I have in my log is from 11th of march. I did update the container on March 13th and have no problems since. Currently on 28.0.3- but can't say if it is a coincidence or not, because it did not happen every day.

AndyXheli commented 6 months ago

Also an issue on NC 29 RC1

{"reqId":"XKn8WYXOPj8rg07A9d2y","level":3,"time":"2024-04-01T08:06:17-05:00","remoteAddr":"2.2.2.2","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#55","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0","version":"29.0.0.14","data":{"app":"PHP"},"id":"660abd3ee4fce"}
naelfe commented 6 months ago

Got it again on March 27th with NC 28.0.4 {"reqId":"Oywua7SP9h6Bcr7xLn9M","level":3,"time":"2024-03-27T09:33:55+00:00","remoteAddr":"XXX.XXX.XXX.XX","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /config/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#54","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0","version":"28.0.3.2","data":{"app":"PHP"}}

-> unfortunately still present

prismopensource commented 5 months ago

Same problem here with NC 28.0.5 and Apache with PHP 8.2

no-usernames-left commented 5 months ago

This is affecting me as well (28.0.5, manual install in a VM following the published installation instructions, updated from 27):

 TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#54

Is this the same bug as #25071?

Haui1112 commented 4 months ago

Same issue here. Nextcloud docker image and nginx proxy manager. Worked for a year without issue and since the last NC update, first circles broke and killed the whole instance and now that. I dont have block common exploits, cache assets or websockets enabled, I do have custom locations caldav and carddav enabled as well as forcessl, http/2 support and HSTS, no HSTS subdomains.

Configuration here:

# ------------------------------------------------------------
# cloud.hs.***.com
# ------------------------------------------------------------

server {
  set $forward_scheme http;
  set $server         "nextcloud-app-1";
  set $port           80;

  listen 80;
listen [::]:80;

listen 443 ssl http2;
listen [::]:443 ssl http2;

  server_name cloud.hs.***.com;

  # Let's Encrypt SSL
  include conf.d/include/letsencrypt-acme-challenge.conf;
  include conf.d/include/ssl-ciphers.conf;
  ssl_certificate /etc/letsencrypt/live/npm-2/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/npm-2/privkey.pem;

  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
  add_header Strict-Transport-Security "max-age=63072000; preload" always;

    # Force SSL
    include conf.d/include/force-ssl.conf;

  access_log /data/logs/proxy-host-3_access.log proxy;
  error_log /data/logs/proxy-host-3_error.log warn;

  location /.well-known/carddav {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_set_header X-Real-IP      $remote_addr;
    proxy_pass       http://$host:80/remote.php/dav;

    # Force SSL
    include conf.d/include/force-ssl.conf;

  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
  add_header Strict-Transport-Security "max-age=63072000; preload" always;

  }

  location /.well-known/caldav {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_set_header X-Real-IP      $remote_addr;
    proxy_pass       http://$host:80/remote.php/dav;

    # Force SSL
    include conf.d/include/force-ssl.conf;

  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
  add_header Strict-Transport-Security "max-age=63072000; preload" always;

  }

  location / {

  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
  add_header Strict-Transport-Security "max-age=63072000; preload" always;

    # Proxy!
    include conf.d/include/proxy.conf;
  }

  # Custom
  include /data/nginx/custom/server_proxy[.]conf;
}
pktiuk commented 3 months ago

Have the same problem with NC 29.0.3 deployed with nextcloud AIO with Nginx Proxy Manager

It constantly breaks my entire NC instance. I have to restart docker, it fixes the problem for some time.

TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/html/apps/user_status/lib/Controller/UserStatusController.php#55

EDIT Recommendation from @joshtrichards helped

joshtrichards commented 3 months ago

deployed with nextcloud AIO with Nginx Proxy Manager

@pktiuk Can you confirm Cache Assets is off (in NPM)? Some people here are triggering this bug due to that (which is a misconfiguration). Others... not sure.

joshtrichards commented 3 months ago

For those of you seeing these requests come in via your browser - e.g.

:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0","version":"28.0.3.2","data":{"app":"PHP"}}

Can you check your browser inspector and under the Network tab see what Request Headers are being sent during these failing requests? They'll likely be easy to spot under your Network tab since they'll be red due to a 500 error.

Please also check Administration settings->Overview and make sure you're not getting any other errors or warnings.

naelfe commented 3 months ago

For those of you seeing these requests come in via your browser - e.g.

:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0","version":"28.0.3.2","data":{"app":"PHP"}}

Can you check your browser inspector and under the Network tab see what Request Headers are being sent during these failing requests? They'll likely be easy to spot under your Network tab since they'll be red due to a 500 error.

Please also check Administration settings->Overview and make sure you're not getting any other errors or warnings.

first off: Cashe Assets are turned off in nginx reverse proxy

these two errors do happen at almost the same time: A) {"reqId":"EQRhPHDZ5n5tgtc1Q000","level":3,"time":"2024-07-04T07:21:10+00:00","remoteAddr":"192.xxx.xxx.xxx","user":"--","app":"no app in context","method":"GET","url":"/js/core/merged-template-prepend.js?v=1823dd9b-23","message":"Could not decrypt or decode encrypted session data","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/app/www/public/lib/private/Security/Crypto.php","line":119,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/Session/CryptoSessionData.php","line":91,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/Session/CryptoSessionData.php","line":68,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/app/www/public/lib/private/Session/CryptoWrapper.php","line":112,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/app/www/public/lib/base.php","line":455,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/app/www/public/lib/base.php","line":711,"function":"initSession","class":"OC","type":"::"},{"file":"/app/www/public/lib/base.php","line":1181,"function":"init","class":"OC","type":"::"},{"file":"/app/www/public/index.php","line":47,"args":["/app/www/public/lib/base.php"],"function":"require_once"}],"File":"/app/www/public/lib/private/Security/Crypto.php","Line":158,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}} B) {"reqId":"14n0PVpJekNRH7Vf5000","level":3,"time":"2024-07-04T07:21:11+00:00","remoteAddr":"192.xxx.xxx.xxx","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /config/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#55","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","data":{"app":"PHP"}}

This one happens, but does not seem to be timing related: {"reqId":"bSegYDgv3XGT5I54n000","level":2,"time":"2024-07-04T07:25:05+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OC\\FilesMetadata\\Job\\UpdateSingleMetadata (id: 14519, arguments: [\"xyz\",189641]): 51.9 MB (before: 35.5 MB)","userAgent":"--","version":"29.0.3.4","data":{"app":"cron"}}

then these 3 are almost at the same time: A) {"reqId":"LDzHL2T2UZQTx6hBZN000","level":3,"time":"2024-07-05T17:54:29+00:00","remoteAddr":"000.000.000.000","user":"--","app":"no app in context","method":"MKCOL","url":"/remote.php/dav/files/abc/Photos/Camera%20Roll","message":"Could not decrypt or decode encrypted session data","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/5.4.1","version":"29.0.3.4","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/app/www/public/lib/private/Security/Crypto.php","line":119,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/Session/CryptoSessionData.php","line":91,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/Session/CryptoSessionData.php","line":68,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/app/www/public/lib/private/Session/CryptoWrapper.php","line":112,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/app/www/public/lib/base.php","line":455,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/app/www/public/lib/base.php","line":711,"function":"initSession","class":"OC","type":"::"},{"file":"/app/www/public/lib/base.php","line":1181,"function":"init","class":"OC","type":"::"},{"file":"/app/www/public/remote.php","line":119,"args":["/app/www/public/lib/base.php"],"function":"require_once"}],"File":"/app/www/public/lib/private/Security/Crypto.php","Line":158,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}} B) {"reqId":"2xS5rENHqVM9ytpxmG000","level":3,"time":"2024-07-05T17:54:29+00:00","remoteAddr":"000.000.000.000","user":"--","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/dashboard/api/v1/widgets","message":"Could not decrypt or decode encrypted session data","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/5.4.1","version":"29.0.3.4","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/app/www/public/lib/private/Security/Crypto.php","line":119,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/Session/CryptoSessionData.php","line":91,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/Session/CryptoSessionData.php","line":68,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/app/www/public/lib/private/Session/CryptoWrapper.php","line":112,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/app/www/public/lib/base.php","line":455,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/app/www/public/lib/base.php","line":711,"function":"initSession","class":"OC","type":"::"},{"file":"/app/www/public/lib/base.php","line":1181,"function":"init","class":"OC","type":"::"},{"file":"/app/www/public/ocs/v1.php","line":31,"args":["/app/www/public/lib/base.php"],"function":"require_once"},{"file":"/app/www/public/ocs/v2.php","line":23,"args":["/app/www/public/ocs/v1.php"],"function":"require_once"}],"File":"/app/www/public/lib/private/Security/Crypto.php","Line":158,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}} C) {"reqId":"exqWBRjXoQO2xyQHj0000","level":2,"time":"2024-07-05T17:55:04+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OC\\FilesMetadata\\Job\\UpdateSingleMetadata (id: 14648, arguments: [\"abc\",190358]): 51 MB (before: 31.1 MB)","userAgent":"--","version":"29.0.3.4","data":{"app":"cron"}}

I do use NC on 2 seperate PCs view browser (both firefox) and on the iOS app. Prolem is, that I can't reproduce the error. It does work multiple days and I can access everything just by typing in my URL. Some time however (afer days or weeks), it tries to load, gets an error and forces me to log back in again (with 2fa mail). Don't know what triggers it.

because I currently do not have an error, here are the headers I can show you: { "Request Headers (900 B)": { "headers": [ { "name": "Accept", "value": "application/json, text/plain, */*" }, { "name": "Accept-Encoding", "value": "gzip, deflate, br, zstd" }, { "name": "Accept-Language", "value": "en-US,en;q=0.5" }, { "name": "Connection", "value": "keep-alive" }, { "name": "Cookie", "value": "__Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; oc_sessionPassphrase=abc; abc=def; nc_username=abc; nc_token=abc; nc_session_id=abc" }, { "name": "DNT", "value": "1" }, { "name": "Host", "value": "nextcloud.abc.de" }, { "name": "requesttoken", "value": "abc/def/ghi=:jkl/mno" }, { "name": "Sec-Fetch-Dest", "value": "empty" }, { "name": "Sec-Fetch-Mode", "value": "cors" }, { "name": "Sec-Fetch-Site", "value": "same-origin" }, { "name": "TE", "value": "trailers" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0" } ] } }

Btw I do not have to re-login on the iOS app, only in the browser, and only every couple of days / weeks. Did never have the probling with NC27 and before, only since NC28 and NC29 did not fix it :(

joshtrichards commented 3 months ago

Thanks, @naelfe.

This confirms my suspicion (at least in your case).

That first error is closer to the cause than the user status error this issue has been focused on so far. So that is helpful.

The user status TypeError should only occur if the user session is already somehow messed up. Which is what the first error immediately preceding it is indicating.

Now we know to not spend any time looking at the user status code because that's not where the problem is.

Still not sure of the root cause, but it gets us closer to the origin. And it's quite possibly related to a couple other open Issues (or at least the work on them may turn up something useful here).

Of course the ability to reproduce would be ideal, but we work with what we've got sometimes. :-)

prismopensource commented 3 months ago

Could this be related to the user_external app maybe?

naelfe commented 3 months ago

Could this be related to the user_external app maybe?

Unfortunately I do not have it enabled :( image

Since we are already at that topic- apps that I once had installed and are currently disabled: image

The only two non-featured apps I do have active are: https://github.com/nextcloud/quota_warning https://github.com/nursoda/twofactor_email <- this one seems to work fine- but it is officially not compatible as far as I know. Currently forced

also currently using https://github.com/nextcloud/news in alpha

update / edit: but maybe there is a relation to this one https://github.com/nextcloud/server/issues/42157 I do have only one token though for iOS app + contacts / calendar. I did use it also for the notes app, but deleted it a while ago.

AndyXheli commented 3 months ago

Error in NC 20.0.4 RC1

{"reqId":"3RGhrT2kz83e7gP6iobX","level":3,"time":"2024-07-12T23:37:44-05:00","remoteAddr":"10.9.0.4","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#55","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1","version":"29.0.4.0","data":{"app":"PHP"},"id":"6692b0f24b123"}
AndyXheli commented 1 week ago

Nextcloud 30.0.1 RC2

{"reqId":"c4C2hpRQTvCWgOvThK9S","level":3,"time":"2024-10-14T17:24:33-05:00","remoteAddr":"172.59.189.36","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#36","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/130.0.6723.37 Mobile/15E148 Safari/604.1","version":"30.0.1.1","data":{"app":"PHP"},"id":"670e77493faac"}