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

Cannot enable LDAP app: complains that table 'oc_ldap_user_mapping' already exists #5787

Closed
9662 opened this issue Jul 19, 2017 · 4 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap

Comments

@9662
Copy link

9662 commented Jul 19, 2017

Steps to reproduce

  1. Install NC12 as per the server configuration below.
  2. Go to Apps
  3. Enable the LDAP application

Expected behaviour

The LDAP application should be enabled and life should be good.

Actual behaviour

The LDAP application wasn't enabled and life is not good.

It complains that:

An exception occurred while executing 'CREATE TABLE "oc_ldap_user_mapping" ("ldap_dn" VARCHAR(255) DEFAULT '' NOT NULL, "owncloud_name" VARCHAR(255) DEFAULT '' NOT NULL, "directory_uuid" VARCHAR(255) DEFAULT '' NOT NULL, PRIMARY KEY("owncloud_name"))': SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "oc_ldap_user_mapping" already exists

Server configuration

Operating system:

NAME="openSUSE Leap"
VERSION="42.2"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.2"
PRETTY_NAME="openSUSE Leap 42.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

Web server: nginx/1.12.0

Database: postgresql 9.4-2.2

PHP version: PHP 7.1.6 (PHP FPM)

Nextcloud version: 12.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Updated from 11 something

Where did you install Nextcloud from: Nextcloud site

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.5.2
  - admin_audit: 1.2.0
  - bruteforcesettings: 1.0.2
  - calendar: 1.5.3
  - comments: 1.2.0
  - contacts: 1.5.3
  - dav: 1.3.0
  - deck: 0.2.1
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_accesscontrol: 1.2.4
  - files_automatedtagging: 1.2.2
  - files_external: 1.3.0
  - files_markdown: 1.0.1
  - files_pdfviewer: 1.1.1
  - files_retention: 1.1.2
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - news: 11.0.5
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - tasks: 0.9.5
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - user_external: 0.4
  - workflowengine: 1.2.0
Disabled:
  - encryption
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.example.net"
        ],
        "datadirectory": "\/srv\/www\/htdocs\/example.net\/nextcloud\/data",
        "overwrite.cli.url": "https:\/\/cloud.example.net",
        "dbtype": "pgsql",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379
        },
        "auth.bruteforce.protection.enabled": false,
        "version": "12.0.0.29",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "appstore.experimental.enabled": false,
        "mail_smtpsecure": "ssl",
        "mail_from_address": "cloud",
        "mail_domain": "example.net",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "mail.example.net",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "production",
        "dbname": "nextcloud",
        "dbhost": "\/var\/run\/postgresql",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "data-fingerprint": "***REMOVED SENSITIVE VALUE***"
    },
    "apps": {
        "activity": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "2.5.2"
        },
        "admin_audit": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "backgroundjob": {
            "lastjob": "14"
        },
        "bruteforcesettings": {
            "installed_version": "1.0.2",
            "types": "",
            "enabled": "yes"
        },
        "calendar": {
            "installed_version": "1.5.3",
            "types": "",
            "ocsid": "168707",
            "enabled": "yes"
        },
        "comments": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "contacts": {
            "installed_version": "1.5.3",
            "types": "",
            "ocsid": "168708",
            "enabled": "yes"
        },
        "core": {
            "installedat": "1480280766.1017",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "public_files": "files_sharing\/public.php",
            "shareapi_default_expire_date": "yes",
            "shareapi_only_share_with_group_members": "yes",
            "shareapi_allow_public_notification": "yes",
            "shareapi_allow_mail_notification": "yes",
            "shareapi_exclude_groups": "yes",
            "shareapi_exclude_groups_list": "[\"One\",\"Other\"]",
            "shareapi_allow_share_dialog_user_enumeration": "yes",
            "lastcron": "1500464702",
            "repairlegacystoragesdone": "yes",
            "vendor": "nextcloud",
            "public_documents": "documents\/public.php",
            "moveavatarsdone": "yes",
            "previewsCleanedUp": "1",
            "backgroundjobs_mode": "cron",
            "umgmt_show_last_login": "true",
            "umgmt_show_storage_location": "false",
            "umgmt_show_backend": "false",
            "umgmt_show_email": "true",
            "umgmt_send_email": "false",
            "updater.secret.created": "1500159206",
            "installed.bundles": "[\"CoreBundle\"]",
            "oc.integritycheck.checker": "[]",
            "scss.variables": "c2fd59d24110888dbe30f81896f253ac",
            "lastupdateResult": "[]",
            "lastupdatedat": "1500465126"
        },
        "dav": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.3.0",
            "OCA\\DAV\\Migration\\ValueFixInsert_ran": "true",
            "buildCalendarSearchIndex": "yes"
        },
        "deck": {
            "types": "",
            "installed_version": "0.2.1",
            "enabled": "yes"
        },
        "direct_menu": {
            "installed_version": "0.10.2",
            "types": "",
            "ocsid": "169148",
            "enabled": "no"
        },
        "documents": {
            "installed_version": "0.13.1",
            "enabled": "no",
            "types": "",
            "ocsid": "168711"
        },
        "federatedfilesharing": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "federation": {
            "types": "authentication",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "files": {
            "types": "filesystem",
            "enabled": "yes",
            "cronjob_scan_files": "500",
            "installed_version": "1.7.2"
        },
        "files_accesscontrol": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.2.4"
        },
        "files_automatedtagging": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.2.2"
        },
        "files_external": {
            "ocsid": "166048",
            "types": "filesystem",
            "enabled": "yes",
            "allow_user_mounting": "yes",
            "user_mounting_backends": "dav,owncloud,sftp,amazons3,dropbox,googledrive,swift,smb,\\OC\\Files\\Storage\\SFTP_Key,\\OC\\Files\\Storage\\SMB_OC",
            "installed_version": "1.3.0"
        },
        "files_markdown": {
            "enabled": "yes",
            "installed_version": "1.0.1",
            "types": ""
        },
        "files_pdfviewer": {
            "ocsid": "166049",
            "types": "",
            "enabled": "yes",
            "installed_version": "1.1.1"
        },
        "files_retention": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.1.2"
        },
        "files_sharing": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.4.0"
        },
        "files_texteditor": {
            "ocsid": "166051",
            "types": "",
            "enabled": "yes",
            "installed_version": "2.4.1"
        },
        "files_trashbin": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "files_versions": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.5.0"
        },
        "files_videoplayer": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.1.0"
        },
        "firstrunwizard": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "2.1"
        },
        "gallery": {
            "types": "",
            "enabled": "yes",
            "installed_version": "17.0.0"
        },
        "logreader": {
            "installed_version": "2.0.0",
            "ocsid": "170871",
            "types": "",
            "enabled": "yes"
        },
        "lookup_server_connector": {
            "installed_version": "1.0.0",
            "types": "authentication",
            "enabled": "yes"
        },
        "news": {
            "types": "",
            "ocsid": "168040",
            "installed_version": "11.0.5",
            "enabled": "yes"
        },
        "nextcloud_announcements": {
            "types": "logging",
            "enabled": "yes",
            "pub_date": "Sat, 10 Dec 2016 00:00:00 +0100",
            "installed_version": "1.1"
        },
        "notifications": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "2.0.0"
        },
        "oauth2": {
            "installed_version": "1.0.5",
            "types": "authentication",
            "enabled": "yes"
        },
        "ownnote": {
            "installed_version": "1.08",
            "enabled": "no",
            "types": "",
            "ocsid": "168512",
            "disableAnnouncement": null
        },
        "password_policy": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.2.2",
            "enforceNonCommonPassword": "0"
        },
        "provisioning_api": {
            "types": "prevent_group_restriction",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "serverinfo": {
            "types": "",
            "installed_version": "1.2.0",
            "enabled": "yes"
        },
        "sharebymail": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "survey_client": {
            "types": "",
            "enabled": "[\"admin\"]",
            "installed_version": "1.0.0",
            "last_sent": "1487868418",
            "last_report": "{\"id\":\"***REMOVED SENSITIVE VALUE***\",\"items\":[[\"server\",\"version\",\"11.0.1.2\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"none\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"none\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"cron\"],[\"php\",\"version\",\"5.6.30\"],[\"php\",\"memory_limit\",536870912],[\"php\",\"max_execution_time\",3600],[\"php\",\"upload_max_filesize\",535822336],[\"database\",\"type\",\"sqlite3\"],[\"database\",\"version\",\"3.8.10\"],[\"database\",\"size\",8353792],[\"apps\",\"ownnote\",\"disabled\"],[\"apps\",\"documents\",\"disabled\"],[\"apps\",\"news\",\"disabled\"],[\"apps\",\"systemtags\",\"1.1.3\"],[\"apps\",\"files_versions\",\"1.4.0\"],[\"apps\",\"comments\",\"1.1.0\"],[\"apps\",\"federatedfilesharing\",\"1.1.1\"],[\"apps\",\"dav\",\"1.1.1\"],[\"apps\",\"files_trashbin\",\"1.1.0\"],[\"apps\",\"files_sharing\",\"1.1.1\"],[\"apps\",\"federation\",\"1.1.1\"],[\"apps\",\"files_texteditor\",\"2.2\"],[\"apps\",\"password_policy\",\"1.1.0\"],[\"apps\",\"notifications\",\"1.0.1\"],[\"apps\",\"survey_client\",\"0.1.5\"],[\"apps\",\"files\",\"1.6.1\"],[\"apps\",\"firstrunwizard\",\"2.0\"],[\"apps\",\"gallery\",\"16.0.0\"],[\"apps\",\"theming\",\"1.1.1\"],[\"apps\",\"provisioning_api\",\"1.1.0\"],[\"apps\",\"files_pdfviewer\",\"1.0.1\"],[\"apps\",\"workflowengine\",\"1.1.1\"],[\"apps\",\"files_videoplayer\",\"1.0.0\"],[\"apps\",\"serverinfo\",\"1.1.1\"],[\"apps\",\"activity\",\"2.4.1\"],[\"apps\",\"updatenotification\",\"1.1.1\"],[\"apps\",\"admin_audit\",\"1.1.0\"],[\"apps\",\"files_external\",\"1.1.2\"],[\"apps\",\"user_external\",\"0.4\"],[\"apps\",\"files_accesscontrol\",\"1.1.2\"],[\"apps\",\"files_automatedtagging\",\"1.1.1\"],[\"apps\",\"files_retention\",\"1.0.1\"],[\"apps\",\"calendar\",\"1.5.0\"],[\"apps\",\"contacts\",\"1.5.3\"],[\"apps\",\"tasks\",\"0.9.4\"],[\"apps\",\"sharebymail\",\"1.0.1\"],[\"apps\",\"logreader\",\"2.0.0\"],[\"apps\",\"lookup_server_connector\",\"1.0.0\"],[\"apps\",\"twofactor_backupcodes\",\"1.0.0\"],[\"apps\",\"nextcloud_announcements\",\"1.0\"],[\"apps\",\"direct_menu\",\"0.10.0\"],[\"apps\",\"deck\",\"0.1.1\"],[\"stats\",\"num_files\",8643],[\"stats\",\"num_users\",2],[\"stats\",\"num_storages\",12],[\"stats\",\"num_storages_local\",5],[\"stats\",\"num_storages_home\",2],[\"stats\",\"num_storages_other\",5],[\"stats\",\"num_comments\",1],[\"stats\",\"num_comment_markers\",1],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",3],[\"files_sharing\",\"num_shares_user\",3],[\"files_sharing\",\"num_shares_groups\",0],[\"files_sharing\",\"num_shares_link\",0],[\"files_sharing\",\"num_shares_link_no_password\",0],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_0_15\",\"1\"],[\"files_sharing\",\"permissions_0_17\",\"1\"],[\"files_sharing\",\"permissions_0_21\",\"1\"],[\"encryption\",\"enabled\",\"no\"],[\"encryption\",\"default_module\",\"no\"]]}"
        },
        "systemtags": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "1.2.0"
        },
        "tasks": {
            "installed_version": "0.9.5",
            "enabled": "yes",
            "types": "",
            "ocsid": "164356"
        },
        "theming": {
            "types": "logging",
            "enabled": "yes",
            "logoMime": "image\/png",
            "cachebuster": "47",
            "color": "#FAFAFA",
            "url": "https:\/\/example.net\/",
            "name": "Example",
            "slogan": "Icecream parlour",
            "installed_version": "1.3.0",
            "backgroundMime": "image\/jpeg"
        },
        "twofactor_backupcodes": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.1.1"
        },
        "updatenotification": {
            "types": "",
            "core": "11.0.3.2",
            "contacts": "1.5.1",
            "tasks": "0.9.4",
            "enabled": "[\"admin\"]",
            "installed_version": "1.2.0",
            "calendar": "1.5.3",
            "direct_menu": "0.10.2",
            "news": "10.2.0",
            "deck": "0.2.1",
            "update_check_errors": "0"
        },
        "user_external": {
            "installed_version": "0.4",
            "ocsid": "166060",
            "types": "authentication,prelogin",
            "enabled": "yes"
        },
        "workflowengine": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.2.0"
        }
    }
}

Are you using external storage, if yes which one: local
Are you using encryption: no

Are you using an external user-backend, if yes which one: no ☹

LDAP configuration (delete this part if not used)

LDAP config

                                                                  
  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  There are no commands defined in the "ldap" namespace.          
                                                                  

@MorrisJobke
Copy link
Member

cc @nickvergessen

@MorrisJobke MorrisJobke added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jul 19, 2017
@nickvergessen
Copy link
Member

Yeah well looks like the app was already installed before. Migrations will fix it. Once all apps are moved to it...

@MorrisJobke
Copy link
Member

MorrisJobke commented Sep 26, 2017

Yeah well looks like the app was already installed before. Migrations will fix it. Once all apps are moved to it...

Workaround: drop the LDAP related tables before enable it again. (of course your previous settings for LDAP will be lost and also the users, but it seems that you haven't used it before).

@Perflyst
Copy link

Perflyst commented Aug 7, 2018

Error also appears after migrating mariadb to postgres.

Maybe this is a second issue: after dropping oc_ldap_group_mapping manually same error messages appears because of this table oc_ldap_group_members. It is not listed in the error message but after dropping it I was able to enable the app.

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
Projects
None yet
Development

No branches or pull requests

4 participants