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

File Picker with SAML user results in "Error: Invalid owner type" with User Migration app #882

Open
LokeYourC3PH opened this issue Sep 8, 2024 · 5 comments

Comments

@LokeYourC3PH
Copy link

LokeYourC3PH commented Sep 8, 2024

Steps to reproduce

  1. Setup SAML with NextCloud (difficult enough as it is)
  2. Install User Migration app, then export a native NextCloud user.
  3. Try to import the exported file via the same app on the SAML user, but fail to see any files (they load forever)

Expected behaviour

Realistically, when I open the file picker on a SAML user account, it should simply load and show all files that are present in the user's folder or folders they user has access to.

Actual behaviour

What happens instead is that, when opening the file picker on a SAML user account, it keeps on loading files indefinitely, with lots of errors being displayed in the Firefox console and also NextCloud logs (when set to Debug). This issue does not occur when using the file picker of a native NextCloud account, only with a SAML account. Refer to images below:

Native NextCloud account:
image

SAML account:
image

Server configuration

Operating system: Ubuntu 22.04 arm64

Web server: Apache2, NGINX as Reverse Proxy, Cloudflare as DNS & Firewall

Database: MySQL

PHP version: PHP 8.1.29 (cli) with FPM enabled

Nextcloud version: Nextcloud Hub 8 - 29.0.6

Where did you install Nextcloud from:
Community Projects - Web Installer

List of activated apps:

Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - announcementcenter: 6.8.1
  - bruteforcesettings: 2.9.0
  - calendar: 4.7.16
  - camerarawpreviews: 0.8.5
  - cfg_share_links: 5.1.2
  - checksum: 1.2.4
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contacts: 6.0.0
  - contactsinteraction: 1.10.0
  - csp_editor: 1.6.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - deck: 1.13.1
  - drop_account: 2.6.0
  - epubviewer: 1.6.3
  - event_update_notification: 2.4.0
  - external: 5.4.0
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.1
  - files_accesscontrol: 1.19.1
  - files_automatedtagging: 1.19.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_snapshots: 1.0.10
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - files_zip: 1.6.0
  - firstrunwizard: 2.18.0
  - flow_notifications: 1.9.0
  - forms: 4.2.4
  - group_default_quota: 0.1.10
  - groupfolders: 17.0.3
  - impersonate: 1.16.0
  - integration_openai: 2.0.3
  - integration_replicate: 3.0.0
  - login_notes: 1.6.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - metadata: 0.20.0
  - music: 2.0.0
  - notes: 4.10.1
  - notifications: 2.17.0
  - oauth2: 1.17.0
  - password_policy: 1.19.0
  - photos: 2.5.0
  - previewgenerator: 5.6.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - quota_warning: 1.20.0
  - recommendations: 2.1.0
  - registration: 2.4.0
  - related_resources: 1.4.0
  - richdocuments: 8.4.6
  - root_cache_cleaner: 0.1.8
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - side_menu: 3.13.1
  - socialsharing_email: 3.1.0
  - suspicious_login: 7.0.0
  - systemtags: 1.19.0
  - terms_of_service: 2.5.0
  - theming: 2.4.0
  - twofactor_admin: 4.5.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_nextcloud_notification: 3.9.0
  - twofactor_totp: 11.0.0-dev
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.19.1
  - user_migration: 6.0.0
  - user_saml: 6.2.0
  - user_status: 1.9.0
  - users_picker: 1.0.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - circles: 29.0.0-dev (installed 24.0.1)
  - encryption: 2.17.0
  - files_archive: 1.2.3 (installed 1.2.3)
  - files_downloadlimit: 2.0.0 (installed 1.1.0)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - nextcloud_announcements: 1.18.0 (installed 1.15.0)
  - support: 1.12.0 (installed 1.8.0)
  - survey_client: 1.17.0 (installed 1.14.0)
  - text: 3.10.1 (installed 3.6.0)
  - user_ldap: 1.20.0

Nextcloud configuration:

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "2": "cloud.REDACTED.xxx"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "\/home\/sysadmin\/web\/cloud.REDACTED.xxx\/public_html\/data\/autocopy",
        "dbtype": "mysql",
        "version": "29.0.6.1",
        "default_phone_region": "KR",
        "overwrite.cli.url": "https:\/\/cloud.REDACTED.xxx\/",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "htaccess.RewriteBase": "\/",
        "theme": "",
        "loglevel": 2,
        "app_install_overwrite": [
            "extract",
            "impersonate",
            "csp_editor",
            "files_archive",
            "files_rightclick"
        ],
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [
            "2FA-EXCLUDE"
        ],
        "maintenance_window_start": 12
    }
}

Client configuration

Browser: Firefox 130.0

Operating system: Windows 11 Pro

Logs

Nextcloud log (data/owncloud.log)

nextcloud.log

Browser log

Error: Invalid owner type
    k index.mjs:558
    S index.mjs:602
    F index.mjs:811
    R index.mjs:887
    l FilePicker-DBGB1Rec.mjs:797
    p FilePicker-DBGB1Rec.mjs:825
[vue.runtime.esm.js:3065:16](webpack:///user_migration/node_modules/vue/dist/vue.runtime.esm.js)
    VueJS 4
        hn
        dn
        un
        cn
Error: Invalid owner type
    k index.mjs:558
    S index.mjs:602
    F index.mjs:811
    R index.mjs:887
    l FilePicker-DBGB1Rec.mjs:797
    p FilePicker-DBGB1Rec.mjs:825
[vue.runtime.esm.js:3065:16](webpack:///user_migration/node_modules/vue/dist/vue.runtime.esm.js)
    VueJS 4
        hn
        dn
        un
        cn
[ERROR] user_migration: Error selecting file to import: FilePicker: No nodes selected 
Object { app: "user_migration", uid: "7", level: 0, error: Error }
[ConsoleLogger.js:74:18](webpack:///user_migration/node_modules/@nextcloud/logger/dist/ConsoleLogger.js)
    value ConsoleLogger.js:74
    value ConsoleLogger.js:100
    pickImportFile ImportSection.vue:208
@LokeYourC3PH
Copy link
Author

LokeYourC3PH commented Sep 8, 2024

For some additional information: If I use the file picker of another app, say "Photos", it works absolutely fine.

However, even when logging in with a SAML account, I get a message from the "Photos" app saying "Could not load photos folder", with a similar error message in the Firefox console:

[FATAL] photos: Unexpected Error "Invalid owner type" 
Object { app: "photos", uid: "7", level: 2, error: Error }
[ConsoleLogger.js:78:18](webpack:///photos/node_modules/@nextcloud/logger/dist/ConsoleLogger.js)
    value ConsoleLogger.js:78
    value ConsoleLogger.js:105
    n userConfig.js:50
Uncaught (in promise) Error: Couldn't fetch photos upload folder
    n userConfig.js:55

So this seems to be related.

@blizzz
Copy link
Member

blizzz commented Sep 11, 2024

not sure whether this should be filed here or with user_migration. @come-nc do you have a rough idea perhaps?

@LokeYourC3PH
Copy link
Author

not sure whether this should be filed here or with user_migration. @come-nc do you have a rough idea perhaps?

I'd say definitely this app since it happens with more apps than just the user_migration app.

@blizzz
Copy link
Member

blizzz commented Sep 11, 2024

not sure whether this should be filed here or with user_migration. @come-nc do you have a rough idea perhaps?

I'd say definitely this app since it happens with more apps than just the user_migration app.

It does not mean this backend is necessarily responsible for whatever user_migration does.

@LokeYourC3PH
Copy link
Author

not sure whether this should be filed here or with user_migration. @come-nc do you have a rough idea perhaps?

I'd say definitely this app since it happens with more apps than just the user_migration app.

It does not mean this backend is necessarily responsible for whatever user_migration does.

No, but like I just said, it happens with more than just that app. It happens with the File Picker / Folder Picker in general for some reason to a few apps, and it does not occur when I use OIDC as a backend instead, only SAML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants