Trying to Setup Dev Environment, getting Samba errors after cloning working production VM

Steps to reproduce

  1. Clone Working Production VM,
  2. Change change.php, hostname, ip, etc to set it up as Dev
  3. Login to Owncloud (9.1.4)

Expected behaviour

Expecting an exact replica of our working production environment.

Actual behaviour

Logging in is very delayed, taking several minutes. Upon logging in, you cannot see your files. The error log shows:

{“reqId”:“W2RgMYQccR2zoVvlxed45gAAAAM”,“remoteAddr”:“192.168.1.15”,“app”:“PHP”,“message”:“smbclient_closedir() expects parameter 2 to be resource, boolean given at /var/www/html/owncloud/apps/files_external/3rdparty/icewind/smb/src/NativeState.php#122”,“level”:3,“time”:“2018-08-03T14:02:01+00:00”}

Server configuration

Operating system:
RHEL 7.3

Web server:
Apache 2.4.6

Database:
SQL Lite: 3.7.17

PHP version:
5.6.37

ownCloud version: (see ownCloud admin page)
9.0.0.19

Updated from an older ownCloud or fresh install:
Cloned

Where did you install ownCloud from:
yum repo

Signing status (ownCloud 9.0 and above):

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

No errors have been found.

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => 'instance',
  'passwordsalt' => 'salty',
  'secret' => 'secret',
  'trusted_domains' =>
  array (
    0 => 'ownclouddev',
    1 => 'ownclouddev.domain.local',
  ),
  'datadirectory' => '/var/www/html/owncloud/data',
  'overwrite.cli.url' => 'http://ownclouddev.domain.local/owncloud',
  'dbtype' => 'sqlite3',
  'version' => '9.0.0.19',
  'logtimezone' => 'UTC',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'theme' => 'theme',
  'loglevel' => 4,
);

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Enabled:

  • dav: 0.1.5
  • federatedfilesharing: 0.1.0
  • files: 1.4.4
  • files_external: 0.5.2
  • files_pdfviewer: 0.8
  • files_texteditor: 2.1
  • files_videoplayer: 0.9.8
  • gallery: 14.5.0
  • user_ldap: 0.8.0
    Disabled:
  • activity
  • comments
  • encryption
  • external
  • federation
  • files_sharing
  • files_trashbin
  • files_versions
  • firstrunwizard
  • notifications
  • provisioning_api
  • systemtags
  • templateeditor
  • updatenotification
  • user_external

Are you using external storage, if yes which one: local/smb/sftp/…
Yes, SMB

Are you using encryption: yes/no
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…
AD

LDAP configuration (delete this part if not used)

±------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration | |
±------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 0 |
| hasPagedResultSupport | |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | CN=OwnCloud (OwnCloud) LDAP Service Account,OU=Services,OU=User Accounts,DC=domain,DC=local |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | DC=domain,DC=local |
| ldapBaseGroups | DC=domain,DC=local |
| ldapBaseUsers | DC=domain,DC=local |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 1 |
| ldapExpertUUIDGroupAttr | sAMAccountName |
| ldapExpertUUIDUserAttr | sAMAccountName |
| ldapExpertUsernameAttr | |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (|(cn=Owncloud-Access)) |
| ldapGroupFilterGroups | |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | |
| ldapGroupMemberAssocAttr | member |
| ldapHost | ldap.domain.local |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(|(objectclass=person)))(samaccountname=%uid)(|(domainUserFlags=AD: Admin)(domainUserFlags=AD:Employee)(domainUserFlags=AD:EmployeeTest))) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | 1 GB |
| ldapTLS | 0 |
| ldapUserDisplayName | displayName |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(|(objectclass=person))(|(domainUserFlags=AD:ServerAdmin)(domainUserFlags=AD:Employee)(domainUserFlags=AD:EmployeeTest))) |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| useMemberOfToDetectMembership | 1 |
±------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------+

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:
Chrome

Operating system:
Windows 10

Logs

Web server error log

[Fri Aug 03 10:11:05.681373 2018] [:error] [pid 3843] [client 192.168.1.15:21289] PHP Fatal error:  Call to undefined method OC\\Files\\Node\\Folder::getContent() in /var/www/html/owncloud/apps/gallery/config/configparser.php on line 92

ownCloud log (data/owncloud.log)

{"reqId":"W2Rh-rcR6fEOSNt2Wc7VXQAAAAE","remoteAddr":"192.168.1.15","app":"PHP","message":"smbclient_closedir() expects parameter 2 to be resource, boolean given at \/var\/www\/html\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/NativeState.php#122","level":3,"time":"2018-08-03T14:10:08+00:00"}
{"reqId":"W2RiOGXx8VY2AfpFRngS7gAAAAo","remoteAddr":"192.168.1.15","app":"PHP","message":"smbclient_closedir() expects parameter 2 to be resource, boolean given at \/var\/www\/html\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/NativeState.php#122","level":3,"time":"2018-08-03T14:10:50+00:00"}
{"reqId":"W2RiOGXx8VY2AfpFRngS7gAAAAo","remoteAddr":"192.168.1.15","app":"PHP","message":"Call to undefined method OC\\Files\\Node\\Folder::getContent() at \/var\/www\/html\/owncloud\/apps\/gallery\/config\/configparser.php#92","level":3,"time":"2018-08-03T14:11:05+00:00"}
{"reqId":"W2RiODqnPCxhxJcrfWlHSgAAAAY","remoteAddr":"192.168.1.15","app":"PHP","message":"smbclient_closedir() expects parameter 2 to be resource, boolean given at \/var\/www\/html\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/NativeState.php#122","level":3,"time":"2018-08-03T14:11:05+00:00"}
{"reqId":"W2RieTqnPCxhxJcrfWlHSwAAAAY","remoteAddr":"192.168.1.15","app":"PHP","message":"smbclient_closedir() expects parameter 2 to be resource, boolean given at \/var\/www\/html\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/NativeState.php#122","level":3,"time":"2018-08-03T14:11:46+00:00"}
{"reqId":"W2RjZMrXQ1lNrPA2@ie7mAAAAAc","remoteAddr":"192.168.1.15","app":"PHP","message":"smbclient_closedir() expects parameter 2 to be resource, boolean given at \/var\/www\/html\/owncloud\/apps\/files_external\/3rdparty\/icewind\/smb\/src\/NativeState.php#122","level":3,"time":"2018-08-03T14:15:40+00:00"}

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

Hey,

it seems this:

doesn’t match whats provided later in:

and:

No matter which one of those are correct both versions looks quite outdated to me.

The 9.1.4 is what i’m seeing in yum, 9.0.0.19 is on the status page.

If i update it, yum sees the latest at 9.1.5, status page. This may be an issue w/ our internal repo. Either way though, shouldn’t cloning work? Is there anywhere else I may need to change the hostname? I changed it in config.php and on the system.

Hey,

i’m not sure how much relation is between issues after a clone of a VM and ownCloud itself. Maybe there are some issues within the underlying OS or network infrastructure like IP conflicts, accessing a wrong SMB host or even network related permission issues to the SMB server causing the messages.

This still looks to me like something you should fix ASAP. If yum has installed 9.1.4 but the actual installation is stuck at 9.0.0 then both are probably not sharing the same installation location and you’re constantly updating an installation which is unused.

The 9.0.0 version is also something which i wouldn’t run on a productive instance and the version difference seems to be the root cause of this.

Thanks Tom, i think you’re right. Our installation may just be hosed. I removed Owncloud via Yum on this test machine and it keeps running, although has the same issue. I think the whole box may be in an unhealthy state, even though the production machine is functional. I’m just going to rebuild w/ Owncloud 10. Thank you for your help.