Repository navigation
Description
Steps to reproduce
- Log in, in SSH.
- Go to Nextcloud folder
- Try to scan files for one user
Expected behaviour
Tell us what should happen
occ should scan files for selected user.
Actual behaviour
Tell us what happens instead
an error is triggered :
sudo -u www-data php occ files:scan 'c9cfd3d4-74aa-1035-91e9-8108b7ac8bcb'
Starting scan for user 1 out of 1 (c9cfd3d4-74aa-1035-91e9-8108b7ac8bcb)
An unhandled exception has been thrown:
TypeError: Argument 1 passed to Icewind\SMB\BasicAuth::__construct() must be of the type string, null given, called in /var/www/html/nextcloud/apps/files_external/lib/Lib/Backend/SMB.php on line 82 and defined in /var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/BasicAuth.php:32
Stack trace:
#0 /var/www/html/nextcloud/apps/files_external/lib/Lib/Backend/SMB.php(82): Icewind\SMB\BasicAuth->__construct(NULL, 'ETUD', NULL)
#1 /var/www/html/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php(95): OCA\Files_External\Lib\Backend\SMB->manipulateStorageConfig(Object(OCA\Files_External\Lib\StorageConfig), Object(OC\User\User))
#2 /var/www/html/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php(132): OCA\Files_External\Config\ConfigAdapter->prepareStorageConfig(Object(OCA\Files_External\Lib\StorageConfig), Object(OC\User\User))
#3 [internal function]: OCA\Files_External\Config\ConfigAdapter->OCA\Files_External\Config\{closure}(Object(OCA\Files_External\Lib\StorageConfig))
#4 /var/www/html/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php(130): array_map(Object(Closure), Array)
#5 /var/www/html/nextcloud/lib/private/Files/Config/MountProviderCollection.php(109): OCA\Files_External\Config\ConfigAdapter->getMountsForUser(Object(OC\User\User), Object(OC\Files\Storage\StorageFactory))
#6 /var/www/html/nextcloud/lib/private/Files/Filesystem.php(452): OC\Files\Config\MountProviderCollection->addMountForUser(Object(OC\User\User), Object(OC\Files\Mount\Manager))
#7 /var/www/html/nextcloud/lib/private/Files/Filesystem.php(377): OC\Files\Filesystem::initMountPoints('c9cfd3d4-74aa-1...')
#8 /var/www/html/nextcloud/lib/private/legacy/OC_Util.php(324): OC\Files\Filesystem::init('c9cfd3d4-74aa-1...', '/c9cfd3d4-74aa-...')
#9 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(116): OC_Util::setupFS('c9cfd3d4-74aa-1...')
#10 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(202): OC\Files\Utils\Scanner->getMounts('/c9cfd3d4-74aa-...')
#11 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan('/c9cfd3d4-74aa-...', true, NULL)
#12 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(214): OCA\Files\Command\Scan->scanFiles('c9cfd3d4-74aa-1...', '/c9cfd3d4-74aa-...', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#13 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/nextcloud/console.php(100): OC\Console\Application->run()
#20 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#21 {main}
Server configuration
Operating system:
Debian 10.9
Web server:
Server version: Apache/2.4.38 (Debian)
Server built: 2020-08-25T20:08:29
Database:
Server version: 10.3.27-MariaDB-0+deb10u1 Debian 10
PHP version:
PHP 7.3.27-1deb10u1 (fpm-fcgi) (built: Feb 13 2021 16:31:40)deb10u1, Copyright (c) 1999-2018, by Zend Technologies
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.27, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.27-1
Nextcloud version: (see Nextcloud admin page)
21.0.1
Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 21.0.0
Where did you install Nextcloud from:
Install / update from auto-updater.
Try reinstalling from tar.bz2 from official website.
Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
No errors have been found.
List of activated apps:
Enabled:
- accessibility: 1.7.0
- activity: 2.14.3
- admin_audit: 1.11.0
- cloud_federation_api: 1.4.0
- comments: 1.11.0
- contactsinteraction: 1.2.0
- dashboard: 7.1.0
- dav: 1.17.1
- federatedfilesharing: 1.11.0
- federation: 1.11.0
- files: 1.16.0
- files_external: 1.12.0
- files_pdfviewer: 2.1.0
- files_rightclick: 1.0.0
- files_sharing: 1.13.1
- files_trashbin: 1.11.0
- files_versions: 1.14.0
- files_videoplayer: 1.10.0
- firstrunwizard: 2.10.0
- logreader: 2.6.0
- lookup_server_connector: 1.9.0
- nextcloud_announcements: 1.10.0
- notifications: 2.9.0
- oauth2: 1.9.0
- onlyoffice: 6.3.0
- password_policy: 1.11.0
- photos: 1.3.0
- privacy: 1.5.0
- provisioning_api: 1.11.0
- recommendations: 1.0.0
- serverinfo: 1.11.0
- settings: 1.3.0
- sharebymail: 1.11.0
- support: 1.4.0
- survey_client: 1.9.0
- systemtags: 1.11.0
- text: 3.2.0
- theming: 1.12.0
- twofactor_backupcodes: 1.10.0
- updatenotification: 1.11.0
- user_ldap: 1.11.0
- user_status: 1.1.1
- viewer: 1.5.0
- weather_status: 1.1.0
- workflowengine: 2.3.0
Disabled: - encryption
Nextcloud configuration:
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "21.0.1.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"ldapIgnoreNamingRules": false,
"maxZipInputSize": 1073741824,
"allowZipDownload": true,
"theme": "",
"overwrite.cli.url": "https:\/\/cloud.iut-orsay.fr",
"htaccess.RewriteBase": "\/",
"maintenance": false,
"default_language": "fr",
"default_phone_region": "FR",
"defaultapp": "files,dashboard",
"auto_logout": true,
"log_type": "owncloud",
"logfile": "\/var\/log\/nextcloud\/nextcloud.log",
"loglevel": 0,
"trusted_domains": [
"cloud.iut-orsay.fr"
],
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "PLAIN",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"secret": "***REMOVED SENSITIVE VALUE***",
"trashbin_retention_obligation": "15, auto",
"memcache.local": "\\OC\\Memcache\\Redis",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"dbindex": 0,
"timeout": 0
},
"onlyoffice": {
"jwt_secret": "REMOVED SENSITIVE VALUE",
"jwt_header": "REMOVED SENSITIVE VALUEt"
},
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
"ldapUserCleanupInterval": "60",
"updater.release.channel": "stable",
"mysql.utf8mb4": true,
"mail_sendmailmode": "smtp"
}
}
Are you using external storage, if yes which one: local/smb/sftp/...
smb
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
LDAP
LDAP configuration (delete this part if not used)
+-------------------------------+-------------------------------------------------------------------+
| Configuration | s01 |
+-------------------------------+-------------------------------------------------------------------+
| hasMemberOfFilterSupport | 0 |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | cn=nextcloud,ou=security,dc=iut-orsay,dc=fr |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | dc=iut-orsay,dc=fr |
| ldapBaseGroups | ou=groups,dc=iut-orsay,dc=fr |
| ldapBaseUsers | ou=people,dc=iut-orsay,dc=fr |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 1 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | |
| ldapExtStorageHomeAttribute | supannAliasLogin |
| ldapGidNumber | gidNumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | objectClass=posixGroup |
| ldapGroupFilterGroups | |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | |
| ldapGroupMemberAssocAttr | memberUid |
| ldapHost | ldaps://ldaps.iut-orsay.fr |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(objectclass=*)(|(uid=%uid)(mail=%uid)(supannAliasLogin=%uid))) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapMatchingRuleInChainState | unknown |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 636 |
| ldapQuotaAttribute | NextcloudQuota |
| ldapQuotaDefault | 10 GB |
| ldapTLS | 0 |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (objectclass=*) |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+-------------------------------------------------------------------+
Client configuration
Browser:
Mozilla Firefox ESR 78.9.0esr (64 bits)
Operating system:
Debian 11
Activity
[-]occ files:scan : An unhandled exception has been thrown[/-][+]`occ files:scan` : Argument 1 passed to `Icewind\SMB\BasicAuth::__construct()` must be of the type `string`, `null` given[/+]icewind1991 commentedon Apr 23, 2021
please provide the output of
occ files_external:listBevito commentedon Apr 23, 2021
Here is the result of
occ files_external:list:The strange thing, is that, for some users, there is no problem (for exemple, my own account), and for others users, they have a message "This folder is unavailable, check the logs or contact your admin".
I'm pretty sure they have not modified their config.
Bevito commentedon Apr 26, 2021
Hi,
I read #26457 and I applied the proposed fix : i.e. downloaded Nextcloud 21.0.0, replaced "icewind" folder.
The problem is solved with this temporary "workaround".
I hoped It can help solving this issue.
Bevito commentedon May 20, 2021
The issue is still present after updating to 21.0.2.
I still need to apply the "workaround" form #26457
szaimen commentedon Jul 6, 2021
Is this Issue still valid in NC21.0.3? If not, please close this issue. Thanks! :)
Bevito commentedon Jul 6, 2021
Hi,
Unfortunately, the issue is still present.
Each time I update Nextcloud, I have to apply the proposed fix from #26457 (i.e. downgrade Icewind with version shipped with Nextcloud 20.0.0)
If I don't do this :
If I can test something, don't hesitate to tell me.
Many thanks.
szaimen commentedon Jul 14, 2021
It should actually be fixed with #26627, no?
Bevito commentedon Jul 14, 2021
Hi,
Unfortunately, since updating to Nextcloud 21.0.1 / 21.0.2 / 21.0.3 doesn't fix the issue, I think updating to icewind/smb to 3.4.1 doesn't fix this issue.
My Nextcloud instance is on 21.0.3 with icewind/smb version shiped with nextcloud 20.0.0.
remyd1 commentedon Aug 5, 2021
Hi,
Same issue here.
Nextcloud 21.0.3, debian Buster, apache2 (2.4.38), php7.4, php-fpm, redis, postgresql 11.
My list of activated apps:
Bevito commentedon Aug 5, 2021
Hi,
I have updated my Nextcloud instance with 22.0.0 and this issue is still present.
For the time being, I have downgraded Icewind with version shipped with Nextcloud 20.0.0.
If I can test something, don't hesitate to tell me.
Many thanks.
remyd1 commentedon Aug 9, 2021
I have no more that issue. It was due (IMHO) to multiple LDAP tenants/auth to access the same CIFS shared folder (with the same options as @Bevito). Changing to a single LDAP base removed that issue.
blizzz commentedon Aug 25, 2021
@icewind1991 in some cases a username is not set and thus null is passed in
SMB::manipulateStorageConfig()when instantiatingBasicAuth.Example config:
I suppose following should "fix" it (didn't test), but I am not sure it is just hiding symptoms.
Bevito commentedon Aug 25, 2021
Hi,
I just tested the fix proposed by @blizzz, and unfortunatly, it doesn't change the situation.
If I use 'icewind' shipped with Nextcloud 21.0.0, I have no problem.
If I try 'icewind' shipped with Nextcloud > 21.0.0, I have that error.
My Nextcloud instance is authenticated againt an OpenLDAP Database, but the SMB mounts are done against two samba4 domain.
The logins and passwords are the same on OpenLDAP and samba4 AD databases.
NiTRoeSE commentedon Oct 28, 2021
I can confirm that 20.0.13, 21.05 & 22.0.2 also have this issue.
See here: #28229