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 …

2 Likes

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?

Nextcloud Server version : 30.0.5
Operating system and version: Debian 12.9 + all system update to 20 jan 25
PHP version: PHP 8.3.16 (built: Jan 19 2025 13:29:20) (NTS)

Good morning, I have the same problem and i hope someone can give me some suggestions or find a bug fixed in a future version. I use ldap for authentication and then users configure the external SMB/CIFS storage by specifying the option "log-in credentials, save in session). I did several tests but i had to restore the VM to a version 30.0.0.14 and PHP 8.3.16 and all system updates to 20-01-2025. As soon as i update nextcloud to a higher version (for example the latest 30.0.5) the mounting functionality for new SMB/CIFS for existing userver or new mount for new users stops to work with the message “action needs authentication failed - wrong password”. All the old ones continue to work without problems.

Same issue here.

  • Nextcloud Hub 9 (30.0.4) with AiO on Ubuntu server
  • LDAP Backend

Existing external storages work fine but I cannot create new ones or add global credentials

cheers
Michael

Hi,
I am trying to use the occ command workaround to create one external share for one user.

I used the “occ files_external:export” to get a working config from user A and now I want to import only one of the shares to user B but the “occ files_external:import” command doesn’t seem to have a “user” parameter?

How can I import a config only for one individual user? :thinking:

cheers
Michael

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.