Add external storage failed at "action needs authentication failed - wrong password"

The Basics

  • Nextcloud Server version :
    30.0.4
  • Operating system and version
    Ubuntu 24.04:
  • PHP version (e.g, 8.2):
  • Is this the first time you’ve seen this error? (Yes / No):
    Yes
  • When did this problem seem to first start?
    after update from 30.0.2 to 30.0.4
    existing external storage entries are still working

Summary of the issue you are facing:

try to add external storage, which has to be confirmed
This action needs authentication failed - wrong password

Steps to replicate it (hint: details matter!):

password works , when I logout and login
neither local nor smb entries can be added due to confirmation password error

Log entries

[PHP] Error: Undefined array key 1 at /var/www/nextcloud/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php#82
        POST /index.php/apps/files_external/globalstorages
1 Like

Same problem
Fresh install

Xarbot

1 Like

Same problem. Hub 30.0.4 (upgraded via Nextcloud AIO v10.0.2).

BTW, I am using OpenLDAP and TOTP. However, logging out and in works. Updating apps (which requires extra authentication) also works.

See [Bug]: Can't save global credentials in external storage · Issue #49829 · nextcloud/server · GitHub

Just to be clear. My understanding would be that this is a confirmed bug that may be fixed at some point and a possible workaround would be to reinstall ? Which is not really an attractive option as the installation is only a few days old. But well …

1 Like

Keep in mind most things can be done from the command line. Look up occ files_external in the Admin Manual:

https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html#files-external-label

1 Like

Hello :slight_smile: I Could solve my Issue using this solution (Thanks to jtr) :

Connect to your VM (Shell Linux) hosting your NextCloud. Use SU.
Go to the Folder hosting NextCloud with the occ file. (This step should look evidence for everyone , but I am Noob hahaha, I give advices for Noob :stuck_out_tongue: )

And write this :

Here , you can do this :
sudo -u www-data php occ files_external:list

You can see the bad External Drives and delete it with :
sudo -u www-data php occ files_external:delete X

Then , you can re-create good ones by using this command :
sudo -u www-data php occ files_external:create Blabla ‘smb’ password::password -c host=X.X.X.X -c share=/X/ -c root=/X/ -c domain=workgroup -c user=X -c password=X

Replace : X with Yours :wink:

Have a nice day :slight_smile:

2 Likes

Hello , perfect - that’s how it works for me too. I had to start a few attempts with the syntax - but then the external storages can be created, deleted etc
Thanks again for the support and the good advice

1 Like

Hi, I tried your solution but it didn’t work for me.
I used these 2 command lines:

sudo -u http-web php occ files_external:create “Music” local /Multimedia3Tb -c authentication_backend=null::null

sudo -u http-web php occ files_external:create “Music” local /Multimedia3Tb -c authentication_backend=local

but in both cases I get the following error:

Authentication backend with identifier “/Multimedia3Tb” not found (see occ files_external:backends for possible values)

checking the command that gives me that error gives me the following (I clarify that more configurations appear but I summarize it to what refers to local storage):

  • storage:
  • local:
  • name: Local
  • identifier: local
  • configuration:
  • datadir: text
  • storage_class: \OC\Files\Storage\Local
  • supported_authentication_backends:
  • null::null
  • authentication_configuration:
  • null::null:

Does anyone have any idea, or would it be better to reinstall nextcloud from scratch? The strangest thing is that I just installed it from scratch, I appreciate any help to add my external drives.

Hi Norman

the syntax which works on my system is a little bit different - could you please try

sudo -u www-data php /PATH_TO_OCC//occ files_external:create Music ‘local’ null::null -c datadir=“/FULL_PATH_TO/Multimedia3Tb”

2 Likes

Thank you very much, I work perfectly

I guess it’s the same for me. Same version. Also using OpenLDAP as provider and log in works fine.

Weird bug.

1 Like

Same issues, any actions with external storage via WebGUI with prompt for password does not work (“wrong password”) for admin and for users.

sudo -u www-data php8.3 occ files_external:create MyFiles 'local' null::null -c datadir="/nextcloud_external_disk/myfiles_to_mount_dir"

does work but:

  • local external storage appear in administration settings section as active for all users
  • is show as active with sudo -u www-data php8.3 occ files_external:list for all users and shareable
  • Does not appear in file view nor in external storage in user space ssection (admin or any other users) - worked with forced users: sudo -u www-data php8.3 occ files_external:config <mount_id> users user1,user2

So this is a confirmed bug? I’ve had nextcloud installed here since v12, I’m not about to reinstall everything

sudo -u www-data php occ files_external:create Photos local null::null -c datadir= --user=
Storage created with id 5

I get a success and an ID, but nothing shows in UI or files_external:list, any ideas?

maybe datadir path was wrong?