Skip to content
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

Folder download (.zip) from SMB/CIFS storage not possible #24497

Closed
Dunkelschorsch opened this issue May 9, 2016 · 24 comments
Closed

Folder download (.zip) from SMB/CIFS storage not possible #24497

Dunkelschorsch opened this issue May 9, 2016 · 24 comments

Comments

@Dunkelschorsch
Copy link

Dunkelschorsch commented May 9, 2016

Steps to reproduce

1. Upgrade to OC 8.2.4
2. Setup an SMB share
3. Try to download a folder

Expected behaviour

Filename chooser dialog should pop up.

Actual behaviour

Error message "Can't read file" appears

Server configuration

**Operating system**: CentOS 7
**Web server:** nginx 1.6.3
**Database:** MariaDB 5.5.47
**PHP version:** 5.4.16
**ownCloud version:** 8.2.4

**Updated from an older ownCloud or fresh install:** Updated all the way from 7.0.12 (intermediate step at every non-point release, of course)

**Where did you install ownCloud from:** download from owncloud.org


Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

redirects back to the files app

List of activated apps:

  - calendar: 0.8.2
  - contacts: 0.5.0.0
  - files: 1.1.10
  - files_external: 0.2.3
  - files_pdfviewer: 0.7.1
  - files_sharing: 0.6.3
  - files_texteditor: 2.0
  - files_trashbin: 0.6.3
  - gallery: 0.6.1
  - notifications: 0.1.0
  - updater: 0.6
  - user_ldap: 0.6.1.1

The content of config/config.php:

{
    "system": {
        "instanceid": "5211c6d877cd2",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "\/var\/www\/html\/drivecloud_8\/data",
        "dbtype": "mysql",
        "version": "8.2.4.2",
        "dbname": "drivecloud_8",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "forcessl": false,
        "loglevel": "2",
        "theme": "",
        "maintenance": false,
        "has_internet_connection": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "trusted_domains": [
            "drivecloud.driveinnovation.de",
            "drivecloud.corp.driveinnovation.de"
        ],
        "secret": "***REMOVED SENSITIVE VALUE***",
        "share_folder": "\/Shared",
        "mail_smtpmode": "smtp",
        "mail_from_address": "admin",
        "mail_domain": "drivemail.de",
        "mail_smtpsecure": "tls",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "smtp.1und1.de",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

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)

| hasMemberOfFilterSupport      | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| hasPagedResultSupport         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| homeFolderNamingRule          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| lastJpegPhotoLookup           | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapAgentName                 | dav-connect@corp.driveinnovation.de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapAgentPassword             | ***                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapAttributesForGroupSearch  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapAttributesForUserSearch   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapBackupHost                | ldaps://bdc1.corp.driveinnovation.de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ldapBackupPort                | 636                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapBase                      | dc=corp,dc=driveinnovation,dc=de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ldapBaseGroups                | dc=corp,dc=driveinnovation,dc=de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ldapBaseUsers                 | cn=Users,dc=corp,dc=driveinnovation,dc=de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ldapCacheTTL                  | 600                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapConfigurationActive       | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapEmailAttribute            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapExperiencedAdmin          | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapExpertUUIDGroupAttr       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapExpertUUIDUserAttr        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapExpertUsernameAttr        | sAMAccountname                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ldapGroupDisplayName          | cn                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ldapGroupFilter               | (&(|(objectclass=group))(|(cn=administrative)(cn=CEO)(cn=developer)(cn=operative)(cn=sales)(cn=student)(cn=extern)))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ldapGroupFilterGroups         | administrative;CEO;developer;operative;sales;student                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ldapGroupFilterMode           | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapGroupFilterObjectclass    | group                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ldapGroupMemberAssocAttr      | member                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ldapHost                      | ldaps://pdc.corp.driveinnovation.de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapIgnoreNamingRules         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapLoginFilter               | (&(&(|(objectclass=person))(|(memberof=CN=administrative,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=CEO,CN=Us                                                     ers,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=developer,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=operative,CN=Users,DC=corp,DC=driveinnov                                                     ation,DC=de)(memberof=CN=sales,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=student,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=extern                                                     ,CN=Users,DC=corp,DC=driveinnovation,DC=de)))(|(sAMAccountName=%uid))) |
| ldapLoginFilterAttributes     | sAMAccountName                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ldapLoginFilterEmail          | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapLoginFilterMode           | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapLoginFilterUsername       | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapNestedGroups              | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapOverrideMainServer        | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ldapPagingSize                | 500                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapPort                      | 636                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ldapQuotaAttribute            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapQuotaDefault              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapTLS                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapUserDisplayName           | samaccountname                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ldapUserDisplayName2          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ldapUserFilter                | (&(|(objectclass=person))(|(memberof=CN=administrative,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=CEO,CN=User                                                     s,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=developer,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=operative,CN=Users,DC=corp,DC=driveinnovat
ion,DC=de)(memberof=CN=sales,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=student,CN=Users,DC=corp,DC=driveinnovation,DC=de)(memberof=CN=extern,C
N=Users,DC=corp,DC=driveinnovation,DC=de)))                            |
| ldapUserFilterGroups          | administrative;CEO;developer;operative;sales;student |
| ldapUserFilterMode            | 1
                                                                       |
| ldapUserFilterObjectclass     | person
                                                                       |
| ldapUuidGroupAttribute        | auto
                                                                       |
| ldapUuidUserAttribute         | auto
                                                                       |
| turnOffCertCheck              | 0
                                                                       |
| useMemberOfToDetectMembership | 1


### Logs
#### Web server error log
no errors logged

#### ownCloud log (data/owncloud.log)
{"reqId":"H5Hx8sxPKqguPuk6MT40","remoteAddr":"10.0.0.2","app":"no app in context","message":"Exception: {\"Exception\":\"Icewind\\\\SMB\\\\Exception\\\\Exception\",\"Message\":\"Unknown error (22) for smb:\\\/\\\/biggun.corp.driveinnovation.de\\\/User\\\/scharm\\\/Documents\\\/Documents\\\/LTSpice\",\"Code\":22,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeState.php(72): Icewind\\\\SMB\\\\NativeState->handleError('smb:\\\/\\\/biggun.co...')\\n#1 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeState.php(180): Icewind\\\\SMB\\\\NativeState->testResult(false, 'smb:\\\/\\\/biggun.co...')\\n#2 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeShare.php(108): Icewind\\\\SMB\\\\NativeState->stat('smb:\\\/\\\/biggun.co...')\\n#3 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeShare.php(103): Icewind\\\\SMB\\\\NativeShare->getStat('\\\/scharm\\\/Documen...')\\n#4 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/lib\\\/smb.php(110): Icewind\\\\SMB\\\\NativeShare->stat('\\\/scharm\\\/Documen...')\\n#5 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/lib\\\/smb.php(292): OC\\\\Files\\\\Storage\\\\SMB->getFileInfo('Documents\\\/LTSpi...')\\n#6 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(91): OC\\\\Files\\\\Storage\\\\SMB->filetype('Documents\\\/LTSpi...')\\n#7 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(99): OC\\\\Files\\\\Storage\\\\Common->is_dir('Documents\\\/LTSpi...')\\n#8 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/availability.php(104): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->is_dir('Documents\\\/LTSpi...')\\n#9 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(99): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->is_dir('Documents\\\/LTSpi...')\\n#10 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(99): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->is_dir('Documents\\\/LTSpi...')\\n#11 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/view.php(1024): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->is_dir('Documents\\\/LTSpi...')\\n#12 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files\\\/view.php(328): OC\\\\Files\\\\View->basicOperation('is_dir', '\\\/Documents\\\/\\\/Doc...')\\n#13 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files.php(194): OC\\\\Files\\\\View->is_dir('\\\/Documents\\\/\\\/Doc...')\\n#14 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/files.php(116): OC_Files::lockFiles(Object(OC\\\\Files\\\\View), '\\\/Documents', 'LTSpice')\\n#15 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files\\\/ajax\\\/download.php(53): OC_Files::get('\\\/Documents', Array, false)\\n#16 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/route\\\/route.php(154) : runtime-created function(1): require_once('\\\/var\\\/www\\\/html\\\/d...')\\n#17 [internal function]: __lambda_func(Array)\\n#18 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/private\\\/route\\\/router.php(291): call_user_func('?lambda_4018', Array)\\n#19 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/lib\\\/base.php(853): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/aja...')\\n#20 \\\/var\\\/www\\\/html\\\/drivecloud_8\\\/index.php(39): OC::handleRequest()\\n#21 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/drivecloud_8\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeState.php\",\"Line\":66}","level":3,"time":"2016-05-09T08:45:27+00:00"}

@Dunkelschorsch
Copy link
Author

The SMB uri in the owncloud.log looks rather strange. It says "Documents" twice, which is not supposed to be there (as I understand).
Downloading of regular files works flawlessly, though.

@PVince81
Copy link
Contributor

PVince81 commented May 9, 2016

Works for me with 9.0.2, I'm able to download a folder "/smb/pics" that is on an SMB storage.

Please try running occ files:scan --all on the command line in case the file cache/index is not up to date.

@Dunkelschorsch
Copy link
Author

Runnung
occ files:scan --all
consistently fails with this error message:

[Icewind\SMB\Exception\Exception]
  Unknown error (22) for smb://10.0.0.10/Gemeinsame Ordner/20_data/knowhow/Vertrieb/Skripterg%C3%A4nzung_Verkaufen_als_Prozess.pdf

The filename contains a Geman umlaut, however, I suppose this is not what causes the problem. Other files with umlauts are scanned just fine.

@PVince81
Copy link
Contributor

PVince81 commented May 9, 2016

There is a very specific case where umlauts can go wrong (#21365).

If this file was created directly on the SMB storage (without going through ownCloud) from a Mac computer, it is likely that the encoding used for umlauts is not compatible.
If that's the case, you can try removing the umlaut from a Windows or Linux computer, then adding it back (outside of ownCloud). Then try rescanning.

@Dunkelschorsch
Copy link
Author

Thanks again for the quick reply!

I renamed that file and the scanner went on this time.
However, it bails out with another error:

 [Icewind\SMB\Exception\Exception]
  Unknown error (22) for smb://10.0.0.10/Gemeinsame Ordner/90_fleet_management

The user whose files are scanned does not have permissions to open that directory, but shouldn't the scanner just skip it? And why the error code always seems to be 22, even for these seemingly unrelated issues?

@PVince81
Copy link
Contributor

PVince81 commented May 9, 2016

I'd expect the scanner to skip these, but "Unknown error" shouldn't happen. Normally the SMB library would convert known errror to PHP exceptions like "ForbiddenException" but it doesn't do here.

@icewind1991 any clues about the error code ?

@Dunkelschorsch
Copy link
Author

I encounter the same problem when trying to create new file or folder, and also when upload a file. They all trigger some "Error 22".

@PVince81
Copy link
Contributor

The error code is likely decimal, so in hex it's 0x0016. From looking at https://msdn.microsoft.com/en-us/library/ee441884.aspx it looks like it matches either "An unknown SMB command code was received by the server." or "STATUS_INVALID_DEVICE_STATE".

Please make sure you have Samba >= 4.2.8 and preferable also have the php5-libsmbclient module.

@Dunkelschorsch
Copy link
Author

The SMB server is running samba 4.2.9 (an update to 4.2.11 went horriby wrong last weekend, so I went back to that version, for the time being).
The installed smbclient on the machine running owncloud is 4.2.11.
I'm already using the php5-smbclient module, since after the upgrade to oC 8.2, SMB refused to work altogether without it.

@Dunkelschorsch
Copy link
Author

Is there a way to log the smbclient commands that owncloud is executing?
When I run smbclient on the command line there are no errors at all. I can copy and create stuff with no problems at all.

@PVince81
Copy link
Contributor

When php5-libsmbclient is installed, the Icewind/SMB library doesn't use the command line smbclient command but it uses the libsmbclient library directly.

@icewind1991 can you advice ? Any debug mode ?

@Dunkelschorsch
Copy link
Author

Can I use the Icewind/SMB library without libsmbclient installed? When I deactivate or remove it, owncloud SMB support seems to be completely unavailable.

@PVince81
Copy link
Contributor

Hmmm, not sure how it would behave. I thought the smbclient command itself would already require libsmbclient. If you don't have libsmbclient installed, then also uninstall php5-libsmbclient.
In this case the Icewind/SMB library will fall back to using the command line tool smbclient.

@Dunkelschorsch
Copy link
Author

Dunkelschorsch commented May 17, 2016

Oh, I'm sorry, of course I removed php5-libsmbclient and subsequently SMB in owncloud stopped working. libsmbclient (in our case sernet-samba-libsmbclient0) was always installed as a dependency of sernet-samba-client.

@Dunkelschorsch
Copy link
Author

Small Update:
I tried interfacing an SMB-Server running Samba 4.4.3, but the error is still the same.

@PVince81
Copy link
Contributor

PVince81 commented Sep 7, 2016

@jvillafanez @butonic

@jvillafanez
Copy link
Member

I think php5-libsmbclient converts an unexpected error to the error code 22.

Is it possible to get a .pcap file with the network trace? Wireshark can help there.
There should be some clue checking the network errors.

@orgiz
Copy link

orgiz commented Oct 7, 2016

Hi,

I got the same problem when i try to download a folder from SMB share on a fresh install:
Ubuntu 16.04
Owncloud 9.1.1

Download link generated:
http://xxx.xxx.xxx.xxx/index.php/apps/files/ajax/download.php?dir=%2FDownloads%20(X%3A)&files=Acrobat_std&downloadStartSecret=asismsfwya0f

Error code:
Exception: {"Exception":"Icewind\\SMB\\Exception\\InvalidPathException","Message":"Invalid request for Invalid path, \":\" is not allowed (InvalidPathException)","Code":0,"Trace":"#0 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/Share.php(414): Icewind\\SMB\\AbstractShare->verifyPath('\/Downloads (X:)...')\n#1 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/Share.php(131): Icewind\\SMB\\Share->escapePath('\/Downloads (X:)...')\n#2 \/var\/www\/owncloud\/apps\/files_external\/lib\/Lib\/Storage\/SMB.php(139): Icewind\\SMB\\Share->stat('\/Downloads (X:)...')\n#3 \/var\/www\/owncloud\/apps\/files_external\/lib\/Lib\/Storage\/SMB.php(508): OCA\\Files_External\\Lib\\Storage\\SMB->getFileInfo('\/Downloads (X:)...')\n#4 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Common.php(99): OCA\\Files_External\\Lib\\Storage\\SMB->filetype('Downloads (X:)\/...')\n#5 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(106): OC\\Files\\Storage\\Common->is_dir('Downloads (X:)\/...')\n#6 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Availability.php(116): OC\\Files\\Storage\\Wrapper\\Wrapper->is_dir('Downloads (X:)\/...')\n#7 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(106): OC\\Files\\Storage\\Wrapper\\Availability->is_dir('Downloads (X:)\/...')\n#8 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(106): OC\\Files\\Storage\\Wrapper\\Wrapper->is_dir('Downloads (X:)\/...')\n#9 \/var\/www\/owncloud\/lib\/private\/Files\/View.php(1119): OC\\Files\\Storage\\Wrapper\\Wrapper->is_dir('Downloads (X:)\/...')\n#10 \/var\/www\/owncloud\/lib\/private\/Files\/View.php(379): OC\\Files\\View->basicOperation('is_dir', '\/Downloads (X:)...')\n#11 \/var\/www\/owncloud\/lib\/private\/legacy\/files.php(320): OC\\Files\\View->is_dir('\/Downloads (X:)...')\n#12 \/var\/www\/owncloud\/lib\/private\/legacy\/files.php(145): OC_Files::lockFiles(Object(OC\\Files\\View), '\/Downloads (X:)', Array)\n#13 \/var\/www\/owncloud\/apps\/files\/ajax\/download.php(62): OC_Files::get('\/Downloads (X:)', 'Acrobat_std', Array)\n#14 \/var\/www\/owncloud\/lib\/private\/Route\/Route.php(154) : runtime-created function(1): require_once('\/var\/www\/ownclo...')\n#15 [internal function]: __lambda_func()\n#16 \/var\/www\/owncloud\/lib\/private\/Route\/Router.php(280): call_user_func('\\x00lambda_474', Array)\n#17 \/var\/www\/owncloud\/lib\/base.php(891): OC\\Route\\Router->match('\/apps\/files\/aja...')\n#18 \/var\/www\/owncloud\/index.php(39): OC::handleRequest()\n#19 {main}","File":"\/var\/www\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/AbstractShare.php","Line":22}

error

@orgiz
Copy link

orgiz commented Oct 10, 2016

Update:
The problems seems to be with the SMB folder naming.

Working with no errors:
Downloads (X)

Not working:
Downloads (X:)

Looks like the colon in the folder name are messing things up.

@jvillafanez
Copy link
Member

The "issue" with the colon is known. We're still figuring out the best way to handle this.

There are issues with several characters in the filenames when accessing to a windows machine. The problem is that we can't detect if we're connecting to windows or not, and in addition windows ignores filenames containing those characters.

The list of forbidden chars are: ?, <, >, :, *, |, ", \0, \n, \r. As a workaround, avoid or rename any filename with any of those chars.

@PVince81
Copy link
Contributor

@jvillafanez @SergioBertolinSG @davitol are you able to reproduce this locally ?

@PVince81 PVince81 added this to the 10.0 milestone Dec 21, 2016
@davitol
Copy link
Contributor

davitol commented Dec 23, 2016

@PVince81

Cannot reproduce the bug. oC version 8.2.4. Samba version 4.3.11-Ubuntu

1. Upgrade to OC 8.2.4
2. Setup an SMB share
3. Try to download a folder

The folder is downloaded OK in .tar (in the issue title it is said that it generates a .zip file)

OOTH about the colon symbol in the name:

Trying to create a folder in oC webUI with a colon in the name is not possible as @jvillafanez said in #24497 (comment)

This is the log generated trying to create this folder:

{"reqId":"f8pYpXf\/9Urh5s5DJfZb","remoteAddr":"82.159.139.58","app":"index","message":"Exception: {\"Exception\":\"Icewind\\\\SMB\\\\Exception\\\\InvalidPathException\",\"Message\":\"Invalid request for Invalid path, \\\":\\\" is not allowed (InvalidPathException)\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Share.php(389): Icewind\\\\SMB\\\\AbstractShare->verifyPath('\\\/pepe:')\\n#1 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Share.php(126): Icewind\\\\SMB\\\\Share->escapePath('\\\/pepe:')\\n#2 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/smb.php(110): Icewind\\\\SMB\\\\Share->stat('\\\/pepe:')\\n#3 \\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/smb.php(312): OC\\\\Files\\\\Storage\\\\SMB->getFileInfo('pepe:')\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(212): OC\\\\Files\\\\Storage\\\\SMB->file_exists('pepe:')\\n#5 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/availability.php(225): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->file_exists('pepe:')\\n#6 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(212): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->file_exists('pepe:')\\n#7 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(212): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->file_exists('pepe:')\\n#8 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1024): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->file_exists('pepe:')\\n#9 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(440): OC\\\\Files\\\\View->basicOperation('file_exists', '\\\/SMB\\\/pepe:')\\n#10 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php(688): OC\\\\Files\\\\View->file_exists('\\\/SMB\\\/pepe:')\\n#11 \\\/opt\\\/owncloud\\\/apps\\\/files\\\/ajax\\\/newfolder.php(67): OC\\\\Files\\\\Filesystem::file_exists('\\\/SMB\\\/pepe:')\\n#12 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(154) : runtime-created function(1): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#13 [internal function]: __lambda_func(Array)\\n#14 \\\/opt\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(291): call_user_func('\\\\x00lambda_43', Array)\\n#15 \\\/opt\\\/owncloud\\\/lib\\\/base.php(853): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/aja...')\\n#16 \\\/opt\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#17 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/AbstractShare.php\",\"Line\":22}","level":3,"time":"2016-12-23T10:24:33+00:00"}

If you create the folder with colon in the name in the SMB backend, it is "renamed" in oC webUI.

@PVince81
Copy link
Contributor

PVince81 commented Apr 6, 2017

likey an environment issue, please upgrade everything: Samba, libsmbclient, php-libsmbclient and try again with at least OC 9.1.4.

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants