Skip to content
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

[Bug]: 31rc5 Error when upgrading or when setting user personal details / sanitizePropertyFediverse #50960

Open
5 of 8 tasks
nursoda opened this issue Feb 21, 2025 · 0 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 31-feedback bug

Comments

@nursoda
Copy link

nursoda commented Feb 21, 2025

⚠️ This issue respects the following points: ⚠️

Bug description

I have multiple instances that I migrated from 28→29→30→31.0.0rc4 and not to 31.0.0rc5. Only with rc5 one of them made my update script bail out. On console I saw the string "fediverse" with red background. In the log I see what seems to be a migration error (see below). I could neither modify nor delete the user's phone number using the web interface. The web interface deems an empty value "invalid". So I deleted in directly in the database. After that, upgrade no longer yielded an error and my script no longer bails out.

I then tried to re-enter any phone number (in valid formats) in the user's profile – to no avail. I see a similar behavior in other instances: In some I can, in others I cannot modify, delete or enter a phone number, or other personal details such as website or fediverse/mastodon name.

Steps to reproduce

Difficult, because I was not able to reproduce on all instances, but this should work:

  1. Install NC20, enter personal details such as phone number and mastodon name in /settings/user
  2. Upgrade through all all major versions to NC31rc4 and verify upgrade has exist status 0
  3. Upgrade to NC31rc5 and see error while upgrading, exiting with non-zero status
  4. Try to modify or delete the above personal data

Expected behavior

A user should at least be able to delete any data from his/her user profile, and enter valid data that is to be saved.

upgrade should not fail for data which was entered in and valid for prior NC versions.

Nextcloud Server version

31

Operating system

Other

PHP engine version

PHP 8.4

Web server

Nginx

Database engine version

MariaDB

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

Updated from a MINOR version (ex. 32.0.1 to 32.0.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.DOMAIN.TLD"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.0.16",
        "overwrite.cli.url": "https:\/\/cloud.DOMAIN.TLD",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "skeletondirectory": "\/DATADIR\/_skeleton",
        "simpleSignUpLink.shown": false,
        "profile.enabled": false,
        "account_manager.default_property_scope": {
            "avatar": "v2-local",
            "phone": "v2-local",
            "displayname": "v2-local",
            "email": "v2-local"
        },
        "updater.release.channel": "beta",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin",
            "GROUPNAME"
        ],
        "twofactor_enforced_excluded_groups": [],
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "dbindex": 9,
            "timeout": 1.5,
            "read_timeout": 1.5
        },
        "loglevel": 2,
        "maintenance_window_start": "0",
        "logtimezone": "Europe\/Berlin",
        "trashbin_retention_obligation": "7,30",
        "versions_retention_obligation": "auto,366",
        "default_language": "de",
        "default_locale": "de_DE",
        "default_phone_region": "DE",
        "maintenance": false,
        "theme": "",
        "app_install_overwrite": []
    }
}

List of activated Apps

Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - calendar: 5.1.0
  - cloud_federation_api: 1.14.0
  - contacts: 7.0.0
  - contactsinteraction: 1.12.0
  - csp_editor: 1.7.0
  - dav: 1.33.0
  - deck: 1.15.0-beta.2
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - groupfolders: 19.0.3
  - impersonate: 2.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - notifications: 4.0.0
  - notify_push: 1.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - related_resources: 2.0.0
  - richdocuments: 8.6.0-beta.2
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - twofactor_webauthn: 2.1.0
  - updatenotification: 1.21.0
  - viewer: 4.0.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - circles: 31.0.0-dev.0 (installed 26.0.0)
  - comments: 1.21.0 (installed 1.16.0)
  - dashboard: 7.11.0 (installed 7.6.0)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.16.0)
  - files_external: 1.23.0
  - firstrunwizard: 4.0.0 (installed 2.15.0)
  - nextcloud_announcements: 3.0.0 (installed 1.15.0)
  - photos: 4.0.0-dev.1 (installed 2.2.0)
  - polls: 8.0.0-alpha8 (installed 8.0.0-alpha8)
  - recommendations: 4.0.0 (installed 1.5.0)
  - support: 3.0.0 (installed 1.9.0)
  - survey_client: 3.0.0 (installed 1.14.0)
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1 (installed 1.16.0)
  - unroundedcorners: 1.1.4 (installed 1.1.4)
  - user_ldap: 1.22.0
  - user_status: 1.11.0 (installed 1.6.0)
  - weather_status: 1.11.0 (installed 1.6.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No new entry in nextcloud.log when trying to enter this phone number (which is rejected as invalid although it isn't): +49 176 NNNNNNN (where N are digits).

Since this "Field can not be longer than 65536 characters", I provice today's whole content of data/nextcloud.log via my cloud instance:

https://cloud.seyfarth.de/s/LxXYDt9nkwEomW3/download/update_to_31rc5.log

It shows the attempt to update to rc5 at 08:59, and further preceedings after having modified the database. Here's an excerpt from the the log, the failed upgrade/migration attempt:

{
  "reqId": "LONG_REQUEST_ID",
  "level": 3,
  "time": "2025-02-21T12:12:17+01:00",
  "remoteAddr": "",
  "user": false,
  "app": "no app in context",
  "method": "",
  "url": "--",
  "message": "Exception while executing repair step Validate the phone number and store it in a known format for search",
  "userAgent": "--",
  "version": "31.0.0.16",
  "exception": {
    "Exception": "InvalidArgumentException",
    "Message": "fediverse",
    "Code": 0,
    "Trace": [
      {
        "file": "/CLOUD_BASEDIR/lib/private/Accounts/AccountManager.php",
        "line": 795,
        "function": "sanitizePropertyFediverse",
        "class": "OC\\Accounts\\AccountManager",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/lib/private/Repair/NC21/ValidatePhoneNumber.php",
        "line": 52,
        "function": "updateAccount",
        "class": "OC\\Accounts\\AccountManager",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/CLOUD_BASEDIR/lib/private/User/Manager.php",
        "line": 670,
        "function": "{closure:OC\\Repair\\NC21\\ValidatePhoneNumber::run():47}",
        "class": "OC\\Repair\\NC21\\ValidatePhoneNumber",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/CLOUD_BASEDIR/lib/private/Repair/NC21/ValidatePhoneNumber.php",
        "line": 47,
        "function": "callForSeenUsers",
        "class": "OC\\User\\Manager",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/lib/private/Repair.php",
        "line": 104,
        "function": "run",
        "class": "OC\\Repair\\NC21\\ValidatePhoneNumber",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/core/Command/Maintenance/Repair.php",
        "line": 99,
        "function": "run",
        "class": "OC\\Repair",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/3rdparty/symfony/console/Command/Command.php",
        "line": 326,
        "function": "execute",
        "class": "OC\\Core\\Command\\Maintenance\\Repair",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/3rdparty/symfony/console/Application.php",
        "line": 1078,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Command\\Command",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/3rdparty/symfony/console/Application.php",
        "line": 324,
        "function": "doRunCommand",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/3rdparty/symfony/console/Application.php",
        "line": 175,
        "function": "doRun",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/lib/private/Console/Application.php",
        "line": 187,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/console.php",
        "line": 87,
        "function": "run",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/CLOUD_BASEDIR/occ",
        "line": 11,
        "args": [
          "/CLOUD_BASEDIR/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/CLOUD_BASEDIR/lib/private/Accounts/AccountManager.php",
    "Line": 725,
    "message": "Exception while executing repair step Validate the phone number and store it in a known format for search",
    "exception": {},
    "CustomMessage": "Exception while executing repair step Validate the phone number and store it in a known format for search"
  }
}

Additional info

JS console yielded an error when trying to enter this phone number (which is rejected as invalid although it isn't): +49 176 NNNNNNN (where N are digits).:

[ERROR] settings: telefonnummer konnte nicht aktualisiert werden.
Object { app: "settings", uid: "USERNAME", level: 2, error: {…} }
index.mjs:54:16
log index.mjs:54
error index.mjs:72
et handlers.ts:25
handleResponse AccountPropertySection.vue:184
updateProperty AccountPropertySection.vue:167

@nursoda nursoda added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 31-feedback bug
Projects
None yet
Development

No branches or pull requests

2 participants