Skip to content

[Bug]: Issue with External Storage and password saved in database #52509

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

Open
6 of 8 tasks
davide-ruota opened this issue Apr 28, 2025 · 0 comments
Open
6 of 8 tasks

[Bug]: Issue with External Storage and password saved in database #52509

davide-ruota opened this issue Apr 28, 2025 · 0 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 31-feedback bug

Comments

@davide-ruota
Copy link

⚠️ This issue respects the following points: ⚠️

Bug description

Certainly! Here's the translated bug report in English:

Bug Report: Issue with Adding External Storage with Saved Password

Hello,

I am experiencing an issue with the External Storage app in Nextcloud (version 31.0.4). When I try to add a shared storage in the admin settings, selecting the "save in session" option with a password, the following occurs:

The password field appears in the web interface, which was not present before.
The password field becomes mandatory, preventing me from saving the configuration without entering a password.
If I enter my user password, the options are saved, but the mount fails.
The command files_external:verify returns "No login credentials saved," even after entering the password.
System details:

Nextcloud version: 31.0.4
External Storage app version: 1.23.0
Operating system: [please specify if possible]
Configuration: SFTP storage with credentials saved in the database, with the "save in session" option enabled.
Additional information:

When adding the storage, the password field appears as mandatory even if it shouldn't.
Mounting fails even when entering the correct password.
The current configuration shows that credentials are not recognized correctly by files_external:verify

Steps to reproduce

  1. Log in as an administrator in Nextcloud.
  2. Navigate to Settings > External Storage.
  3. Add a new external storage (e.g., SFTP).
  4. Fill in the required fields (host, root, etc.).
  5. Enable the option use saved passord in database.
  6. Save the configuration.
  7. Observe that the password field appears as mandatory.

Expected behavior

When selecting the option to use saved credentials in database, the password field should not be mandatory if credentials are already saved.
The storage should be added successfully without requiring the password.
The storage should mount correctly, and credentials should be verified properly.
No errors or warnings about missing credentials should appear during verification or mounting.

Nextcloud Server version

31

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Nginx

Database engine version

PostgreSQL

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": {                                                                                                                                                                                                     
        "htaccess.RewriteBase": "\/",                                                                                                                                                                               
        "memcache.local": "\\OC\\Memcache\\APCu",                                                                                                                                                                   
        "apps_paths": [                                                                                                                                                                                             
            {                                                                                                                                                                                                       
                "path": "\/var\/www\/html\/apps",                                                                                                                                                                   
                "url": "\/apps",                                                                                                                                                                                    
                "writable": false                                                                                                                                                                                   
            },                                                                                                                                                                                                      
            {                                                                                                                                                                                                       
                "path": "\/var\/www\/html\/custom_apps",                                                                                                                                                            
                "url": "\/custom_apps",                                                                                                                                                                             
                "writable": true                                                                                                        
            }                                                                                                                                                  
        ],                                                          
        "memcache.distributed": "\\OC\\Memcache\\Redis",                                                                                                                                      
        "memcache.locking": "\\OC\\Memcache\\Redis",                
        "redis": {                                                  
            "host": "***REMOVED SENSITIVE VALUE***",                           
            "password": "***REMOVED SENSITIVE VALUE***",                                                                                                       
            "port": 6379                                                                                                                                       
        },                                                                                                                                                     
        "trusted_domains": [                                                   
            "cloud.laruota.info"                                                                                                                               
        ],                                                                                                                                                     
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",                                                                                                                                   
        "overwriteprotocol": "https",                                                          
        "overwrite.cli.url": "https:\/\/cloud.laruota.info\/",                                                                                                                                
        "upgrade.disable-web": true,                                                           
        "instanceid": "***REMOVED SENSITIVE VALUE***",                                                                                                                                        
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",                                                                                                                                      
        "secret": "***REMOVED SENSITIVE VALUE***",                                             
        "datadirectory": "***REMOVED SENSITIVE VALUE***",                                                                                                                                     
        "dbtype": "pgsql",                                                                     
        "version": "31.0.4.1",                                                                 
        "dbname": "***REMOVED SENSITIVE VALUE***",                                             
        "dbhost": "***REMOVED SENSITIVE VALUE***",                                             
        "dbport": "",                                                                          
        "dbtableprefix": "oc_",                                                                
        "dbuser": "***REMOVED SENSITIVE VALUE***",                                             
        "dbpassword": "***REMOVED SENSITIVE VALUE***",                                                                                                                                        
        "installed": true,                                                                     
        "skeletondirectory": "",                                                               
        "maintenance": false,                                                                  
        "maintenance_window_start": 5,                                                         
        "default_phone_region": "IT",                                                          
        "mail_smtpmode": "smtp",                                                               
        "mail_smtpsecure": "ssl",                                                              
        "mail_sendmailmode": "smtp",                                                           
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",                                                                                                                                 
        "mail_domain": "***REMOVED SENSITIVE VALUE***",                                                                                                                                       
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",                                                                                                                                     
        "mail_smtpport": "465",                                                                
        "mail_smtpauth": 1,                                                                    
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",                                                                                                                                     
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",                                                                                                                                 
        "jpeg_quality": "60",                                                                  
        "loglevel": 3,                                                                         
        "forbidden_filename_characters": [                                                     
            "\\",                                                                              
            "\/"                                                                               
        ],                                                                                     
        "forbidden_filename_extensions": [                                                     
            ".filepart",                                                                       
            ".part"                                                                            
        ]                                                                                      
    }                                                                                          
}

List of activated Apps

Enabled:
  - activity: 4.0.0
  - bruteforcesettings: 4.0.0
  - cloud_federation_api: 1.14.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - richdocuments: 8.6.4
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - user_ldap: 1.22.0
  - viewer: 4.0.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - app_api: 5.0.2 (installed 4.0.6)
  - circles: 31.0.0 (installed 30.0.0)
  - comments: 1.21.0 (installed 1.20.1)
  - contactsinteraction: 1.12.0 (installed 1.11.0)
  - dashboard: 7.11.0 (installed 7.10.0)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.20.0)
  - files_downloadlimit: 4.0.0 (installed 3.0.0)
  - files_reminders: 1.4.0 (installed 1.3.0)
  - files_versions: 1.24.0 (installed 1.23.0)
  - files_zip: 2.1.0 (installed 2.1.0)
  - firstrunwizard: 4.0.0 (installed 3.0.0)
  - nextcloud_announcements: 3.0.0 (installed 2.0.0)
  - photos: 4.0.0-dev.1 (installed 3.0.2)
  - privacy: 3.0.0 (installed 2.0.0)
  - recommendations: 4.0.0 (installed 3.0.0)
  - related_resources: 2.0.0 (installed 1.5.0)
  - sharebymail: 1.21.0 (installed 1.20.0)
  - support: 3.0.0 (installed 2.0.0)
  - survey_client: 3.0.0 (installed 2.0.0)
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1 (installed 1.20.0)
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - updatenotification: 1.21.0 (installed 1.20.0)
  - user_status: 1.11.0 (installed 1.10.0)
  - weather_status: 1.11.0 (installed 1.10.0)
  - webhook_listeners: 1.2.0 (installed 1.1.0-dev)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"9JNBI41lPqlW7ksWXqeB","level":0,"time":"2025-04-28T15:39:23+00:00","remoteAddr":"37.119.199.80","user":"davide_9136","app":"user_ldap","method":"PUT","url":"/apps/logreader/api/settings","message":"The loading of lazy AppConfig values have been triggered by app \"user_ldap\"","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36","version":"31.0.4.1","exception":{"Exception":"RuntimeException","Message":"The loading of lazy AppConfig values have been triggered by app \"user_ldap\"","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppConfig.php","line":1193,"function":"loadConfig","class":"OC\\AppConfig","type":"->","args":["user_ldap",null]},{"file":"/var/www/html/lib/private/AppConfig.php","line":106,"function":"loadConfigAll","class":"OC\\AppConfig","type":"->","args":["user_ldap"]},{"file":"/var/www/html/lib/private/AllConfig.php","line":172,"function":"getKeys","class":"OC\\AppConfig","type":"->","args":["user_ldap"]},{"file":"/var/www/html/apps/user_ldap/lib/Helper.php","line":109,"function":"getAppKeys","class":"OC\\AllConfig","type":"->","args":["user_ldap"]},{"file":"/var/www/html/apps/user_ldap/lib/Helper.php","line":50,"function":"getServersConfig","class":"OCA\\User_LDAP\\Helper","type":"->","args":["ldap_configuration_active"]},{"file":"/var/www/html/apps/user_ldap/lib/AppInfo/Application.php","line":113,"function":"getServerConfigurationPrefixes","class":"OCA\\User_LDAP\\Helper","type":"->","args":[true]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":28,"function":"OCA\\User_LDAP\\AppInfo\\{closure}","class":"OCA\\User_LDAP\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/BootContext.php","line":32,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/html/apps/user_ldap/lib/AppInfo/Application.php","line":104,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":157,"function":"boot","class":"OCA\\User_LDAP\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\Bootstrap\\BootContext"}]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":479,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["user_ldap"]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":248,"function":"loadApp","class":"OC\\App\\AppManager","type":"->","args":["user_ldap"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":82,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["authentication"]]},{"file":"/var/www/html/lib/base.php","line":997,"function":"loadApps","class":"OC_App","type":"::","args":[["authentication"]]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppConfig.php","Line":1208,"message":"The loading of lazy AppConfig values have been triggered by app \"user_ldap\"","exception":{},"CustomMessage":"The loading of lazy AppConfig values have been triggered by app \"user_ldap\""}}
{"reqId":"9JNBI41lPqlW7ksWXqeB","level":0,"time":"2025-04-28T15:39:23+00:00","remoteAddr":"37.119.199.80","user":"davide_9136","app":"user_ldap","method":"PUT","url":"/apps/logreader/api/settings","message":"Calling LDAP function ldap_explode_dn with parameters [\"davide_9136\",0]","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36","version":"31.0.4.1","data":{"app":"user_ldap"}}
{"reqId":"9JNBI41lPqlW7ksWXqeB","level":0,"time":"2025-04-28T15:39:23+00:00","remoteAddr":"37.119.199.80","user":"davide_9136","app":"logreader","method":"PUT","url":"/apps/logreader/api/settings","message":"Updating AppConfig: logLevel => 1","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36","version":"31.0.4.1","data":{"app":"logreader"}}

Additional info

No response

@davide-ruota davide-ruota added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 28, 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