nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.22k stars 4.05k forks source link

Can't add LDAP server #3074

Closed greendruid closed 7 years ago

greendruid commented 7 years ago
### Steps to reproduce 1. Install NextCloud 11 2. Install 389 Directory Server (CentOS 6.7) 3. Try add 389 Directory Server like as backend ### Expected behaviour LDAP server like as backend. ### Actual behaviour I can't add LDAP server configration. Messages from log: ``` FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'OCP\JSON' not found in /var/vhosts/nebula/www/apps/user_ldap/ajax/getConfiguration.php on line 28" while reading response header from upstream ``` ### Server configuration **Operating system**: CentOS 6.7 **Web server:** Nginx 1.6 **Database:** MySQL 5.7 (from oracle.com) **PHP version:** 5.6 **Nextcloud version:** 11.0.0 **Updated from an older Nextcloud/ownCloud or fresh install:** fresh install **Where did you install Nextcloud from:** official website **Signing status:**
Signing status ``` No errors have been found. ```
**List of activated apps:**
App list ``` Enabled: - activity: 2.4.1 - comments: 1.1.0 - dav: 1.1.1 - federatedfilesharing: 1.1.1 - federation: 1.1.1 - files: 1.6.1 - files_pdfviewer: 1.0.1 - files_sharing: 1.1.1 - files_texteditor: 2.2 - files_trashbin: 1.1.0 - files_versions: 1.4.0 - files_videoplayer: 1.0.0 - firstrunwizard: 2.0 - gallery: 16.0.0 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.0 - notifications: 1.0.1 - password_policy: 1.1.0 - provisioning_api: 1.1.0 - serverinfo: 1.1.1 - sharebymail: 1.0.1 - survey_client: 0.1.5 - systemtags: 1.1.3 - theming: 1.1.1 - twofactor_backupcodes: 1.0.0 - updatenotification: 1.1.1 - user_external: 0.4 - user_ldap: 1.1.1 - workflowengine: 1.1.1 Disabled: - admin_audit - encryption - external - files_accesscontrol - files_automatedtagging - files_external - files_retention - templateeditor - user_saml ```
**The content of config/config.php:**
Config report ``` { "system": { "instanceid": "oc13tt45eul5", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "nebula.stty.ru" ], "datadirectory": "\/var\/nextcloud", "overwrite.cli.url": "https:\/\/nebula.stty.ru", "dbtype": "mysql", "version": "11.0.0.10", "dbname": "nebula", "dbhost": "localhost", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "UTC", "installed": true, "ldapIgnoreNamingRules": false, "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory", "mail_from_address": "web", "mail_smtpmode": "php", "mail_domain": "stty.ru" } } ```
**Are you using external storage, if yes which one:** no **Are you using encryption:** no **Are you using an external user-backend, if yes which one:** try use LDAP #### LDAP configuration (delete this part if not used)
LDAP config ``` empty ```
### Client configuration **Browser:** **Operating system:** ### Logs #### Web server error log
Web server error log 2017/01/14 22:50:07 [error] 9795#0: *39 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'OCP\JSON' not found in /var/vhosts/nebula/www/apps/user_ldap/ajax/wizard.php on line 29" while reading response header from upstream, client: 79.111.227.111, server: nebula, request: "POST /apps/user_ldap/ajax/wizard.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/nebula.sock:", host: "nebula.stty.ru" 2017/01/14 22:55:34 [error] 9795#0: *167 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'OCP\JSON' not found in /var/vhosts/nebula/www/apps/user_ldap/ajax/getConfiguration.php on line 28" while reading response header from upstream, client: 79.111.227.111, server: nebula, request: "POST /apps/user_ldap/ajax/getConfiguration.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/nebula.sock:", host: "nebula.stty.ru" 2017/01/14 22:55:50 [error] 9795#0: *168 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'OCP\JSON' not found in /var/vhosts/nebula/www/apps/user_ldap/ajax/getConfiguration.php on line 28" while reading response header from upstream, client: 79.111.227.111, server: nebula, request: "POST /apps/user_ldap/ajax/getConfiguration.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/nebula.sock:", host: "nebula.stty.ru" 2017/01/14 22:56:38 [error] 9795#0: *259 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'OCP\JSON' not found in /var/vhosts/nebula/www/apps/user_ldap/ajax/getConfiguration.php on line 28" while reading response header from upstream, client: 79.111.227.111, server: nebula, request: "POST /apps/user_ldap/ajax/getConfiguration.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/nebula.sock:", host: "nebula.stty.ru"
#### Nextcloud log (data/nextcloud.log)
Nextcloud log ``` Insert your Nextcloud log here ```
#### Browser log
Browser log ``` Nothing interesting. ```
schiessle commented 7 years ago

@blizzz looks like something for you.

blizzz commented 7 years ago

@greendruid seems to me to be either an issue with the installation (not all files), or the autoloader.

On Admin → Server Settings, what do you see in Security & setup warnings?

Can you do other things, like enabling apps? This also uses the OCP\JSON class.

greendruid commented 7 years ago

@blizzz , hi I download package from official site. Then I follow the instruction (link: https://docs.nextcloud.com/server/11/admin_manual/installation/source_installation.html ) In "Security & setup warnings" only next message: "No memory cache has been configured. To enhance your performance please configure a memcache if available..." But I think that notification is not an error. (Right?) I can enable/disable application & create users & upload/download/remove files.

greendruid commented 7 years ago

I found the solution! :) I just added the one string to the files and all ok! PATH: /apps/user_ldap/ajax/ FILES: clearMappings.php, deleteConfiguration.php, getConfiguration.php, getNewServerConfigPrefix.php, setConfiguration.php, testConfiguration.php, wizard.php STRING: require_once($_SERVER['DOCUMENT_ROOT'].'/lib/base.php');

clearMappings.php for example:

<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/base.php');
/* ... CUT COMMENTS ... */
use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\Mapping\GroupMapping;
...
blizzz commented 7 years ago

This really should not be necessary, but then the issue is rather somewhere with the server setup. Likely this will haunt you after updates.

As it works for now, I close it.

thechonta commented 5 years ago

Thanx a lot @greendruid on Nextcloud 16.0.1 wirh Nginx your line is also needed! If not, you can not setup LDAP becaus there is nor responce on the adon, nothing work.