Unable to add Oauth2 client

Nextcloud version (eg, 20.0.5): 25.0.1
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.54
PHP version (eg, 7.4): 8.1.12

The issue you are facing: When I attempt to configure an oauth2 client nothing happens after pressing the add button. I have tried multiple browsers and devices. No error messages are printed in any logs or on screen. Can oauth clients be added via occ commands?

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Go to admin > security
  2. Under OAuth 2.0 clients / add client enter name and IRL then click add

The output of your Nextcloud log in Admin > Logging:

Info	updater	\OC\Updater::resetLogLevel: Reset log level to Warning(2)		2022-11-05T22:00:01+0000
Info	updater	\OC\Updater::maintenanceDisabled: Turned off maintenance mode		2022-11-05T22:00:01+0000
Info	updater	\OC\Updater::updateEnd: Update successful		2022-11-05T22:00:01+0000
Info	updater	\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check		2022-11-05T22:00:01+0000
Info	updater	\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Clean up abandoned apps		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add token cleanup job		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add background job to set the lookup server share state for users		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Repair DAV shares		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Queue a one-time job to check for user uploaded certificates		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add job to cleanup the bruteforce entries		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Remove old dashboard app config data		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Check encryption key format		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Keep legacy encryption enabled		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Reset generated avatar flag		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Clear access cache of projects		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: No need to remove link shares.		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Remove potentially over exposing share links		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add background job to cleanup login flow v2 tokens		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Cleanup invalid photocache files for carddav		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Queue a one-time job to cleanup old backups of the updater		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add preview background cleanup job		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Clear every generated avatar on major updates		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: JS cache cleared		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: Image cache cleared		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Clear frontend caches		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add log rotate job		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Repair language codes		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: No mounts updated		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Fix potential broken mount points		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: Update the oauth2_clients table schema.		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: Update the oauth2_access_tokens table schema.		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Migrate oauth2_clients table to nextcloud schema		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add preview cleanup background jobs		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairInfoEvent: Repair info: Repair step already executed		2022-11-05T21:59:56+0000
Info	updater	OC\Repair\Events\RepairStepEvent: Repair step: Add move avatar background job		2022-11-05T21:59:56+0000

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "25.0.1.1",
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "mail_smtpmode": "smtp",
    "mail_smtpsecure": "tls",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "default_phone_region": "+44",
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "updater.secret": "***REMOVED SENSITIVE VALUE***",
    "updater.release.channel": "beta",
    "app_install_overwrite": [
        "side_menu",
        "apporder",
        "transfer"
    ]
}

The output of your Apache/nginx/system log in /var/log/____:

No errors generated whilst trying to configure oauth client.

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

No errors generated whilst trying to configure oauth client.

Other buttons in my nextcloud installation are not working either. I have enabled developer console in my web browser and this has come up with some errors but I dont know how helpful they might be.

The security page on load only has:

vue.runtime.esm.js:3019 TypeError: Cannot read properties of undefined (reading '0')
    at o.data (Encryption.vue:113:1)
    at o.<anonymous> (vue.runtime.esm.js:4719:29)
    at vue.runtime.esm.js:5419:21
    at vue.runtime.esm.js:5383:42
    at In (vue.runtime.esm.js:5324:9)
    at e._init (vue.runtime.esm.js:5646:9)
    at new o (vue.runtime.esm.js:5781:18)
    at 64305 (main-admin-security.js:51:1)
    at r (bootstrap:19:32)
    at startup:4:88

If I try to add a file or directory using the plus button in the files app I get:

App.svelte:65 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
    at Object.attach (App.svelte:65:8)
    at Object.attach (plugins.js:67:16)
    at a.initialize (newfilemenu.js:59:15)
    at t.View (backbone.js:1310:21)
    at new a (backbone.js:2070:41)
    at FileList._onClickNewButton (filelist.js:3867:25)
    at bt (_executeBound.js:8:65)
    at HTMLAnchorElement.<anonymous> (bind.js:10:12)
    at HTMLAnchorElement.<anonymous> (restArguments.js:16:27)
    at HTMLAnchorElement.dispatch (jquery.js:5430:27)

I seem to be having a similar problem. I created a new installation of 25.0.0 at a new site to specifically test OAuth2 and I wasn’t able to create any. I ended up ditching that installation and installing 24.0.6. Now I upgraded my primary installation to 25.0.1 and the OAuth2 interface in the web admin settings does not seem to be working. I don’t really need it for this installation, but in the past I have been able to create entries there.

I saw someone also complain about the new user button. I noticed the new user button caused a very delayed reaction, but it did eventually allow me to create a new user.

I’m somewhat new to Nextcloud, so hoping these are just growing pains that will be fixed in upcoming refreshes.

Hi,

It appears this is a problem only in 25 major release series. A bug has been opened at [Bug]: can't add oauth2 client · Issue #35045 · nextcloud/server · GitHub

Regards,
Matt.