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

Database tables are not created for contacts and calendar #11816

Closed
pvtrifonov opened this issue Oct 13, 2018 · 8 comments
Closed

Database tables are not created for contacts and calendar #11816

pvtrifonov opened this issue Oct 13, 2018 · 8 comments

Comments

@pvtrifonov
Copy link

Steps to reproduce

  1. Install Contacts or Calendar apps
  2. Try to create a new address book
  3. Get an error "Address book could not be created"

Expected behaviour

An address book should be created

Actual behaviour

The following message is logged;

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT id, uri, displayname, principaluri, description, synctoken FROM oc_addressbooks WHERE principaluri = ?' with params ["principals/users/admin"]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_addressbooks' doesn't exist

This table indeed does not exist. Disabling, removing and re-enabling the app does not help
Similar messages mentioning oc_calendars and oc_oauth2_clients tables were also observed in the log file.

Server configuration

Operating system: FreeBSD 11.1

Web server: Apache 2.4.27

Database: MySQL 5.7.19

PHP version: 7.1.8

Nextcloud version: 14.0.1

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

Where did you install Nextcloud from: FreeBSD ports

Signing status: No errors have been found.

List of activated apps:

Enabled: - admin_audit: 1.4.0 - bruteforcesettings: 1.1.0 - cloud_federation_api: true - contacts: 2.1.6 - dav: true - dropit: 0.1.1 - federatedfilesharing: true - files: true - files_external: 1.5.0 - files_fulltextsearch: 1.0.1 - files_pdfviewer: 1.3.2 - files_sharing: 1.6.2 - files_texteditor: 2.6.0 - files_trashbin: 1.4.1 - files_versions: 1.7.1 - firstrunwizard: 2.3.0 - fulltextsearch: 1.0.1 - logreader: 2.0.0 - lookup_server_connector: true - mail: 0.10.0 - notifications: 2.2.1 - oauth2: true - provisioning_api: true - quota_warning: 1.3.0 - ransomware_protection: 1.2.0 - tasks: 0.9.7 - twofactor_backupcodes: 1.3.1 - user_ldap: 1.4.0 - workflowengine: true Disabled: - accessibility - activity - calendar - comments - encryption - federation - files_accesscontrol - files_videoplayer - gallery - nextcloud_announcements - password_policy - richdocuments - serverinfo - sharebymail - support - survey_client - systemtags - theming - updatenotification - user_external

Nextcloud configuration:

{ "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "dcn.icc.spbstu.ru" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "14.0.1.1", "overwrite.cli.url": "https:\/\/dcn.icc.spbstu.ru\/nextcloud\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "logfile": "\/var\/log\/nextcloud\/nextcloud.log", "loglevel": "2", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "debug": true, "apps_paths": [ { "path": "\/usr\/local\/www\/nextcloud\/apps", "url": "\/apps", "writable": true }, { "path": "\/usr\/local\/www\/nextcloud\/apps-pkg", "url": "\/apps-pkg", "writable": false } ], "memcache.local": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379 }, "memcache.locking": "\\OC\\Memcache\\Redis", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpauthtype": "PLAIN", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "ldapIgnoreNamingRules": false, "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory", "maintenance": false } }

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: ActiveDirectory

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #410 (Birthday calendar not generated for shared contacts), #758 (drop old calendar and contacts tables), #3003 (Disable birthday contacts calendar generation for user), #1662 (Calendar and Contacts Trashbin), and #2859 (Tables aren’t re-created when re-adding the Contacts app).

@MorrisJobke
Copy link
Member

cc @nextcloud/calendar @nextcloud/contacts

@tcitworld
Copy link
Member

@MorrisJobke If the oc_oauth2_clients doesn't exist too it's probably not linked to calendar/contacts in particular ?

@pvtrifonov Maybe you could list all tables for the database ?

@pvtrifonov
Copy link
Author

Yes, I have seen this problem for many other extensions and tables. Here is the list of tables in the database:
+-----------------------------+
| Tables_in_nextcloud |
+-----------------------------+
| oc_accounts |
| oc_appconfig |
| oc_authtoken |
| oc_bruteforce_attempts |
| oc_comments |
| oc_comments_read_markers |
| oc_credentials |
| oc_external_applicable |
| oc_external_config |
| oc_external_mounts |
| oc_external_options |
| oc_file_locks |
| oc_filecache |
| oc_files_trash |
| oc_fulltextsearch_indexes |
| oc_fulltextsearch_ticks |
| oc_group_admin |
| oc_group_user |
| oc_groups |
| oc_jobs |
| oc_ldap_group_mapping |
| oc_ldap_group_members |
| oc_ldap_user_mapping |
| oc_mail_accounts |
| oc_mail_aliases |
| oc_mail_attachments |
| oc_mail_collected_addresses |
| oc_migrations |
| oc_mimetypes |
| oc_mounts |
| oc_notifications |
| oc_notifications_pushtokens |
| oc_preferences |
| oc_properties |
| oc_richdocuments_member |
| oc_richdocuments_wopi |
| oc_share |
| oc_share_external |
| oc_storages |
| oc_systemtag |
| oc_systemtag_group |
| oc_systemtag_object_mapping |
| oc_twofactor_backupcodes |
| oc_twofactor_providers |
| oc_users |
| oc_vcategory |
| oc_vcategory_to_object |
| oc_whats_new |
+-----------------------------+

@georgehrke
Copy link
Member

@pvtrifonov enabling / disabling contacts / calendar will indeed have no effect, because they don’t store the actual data. The data is stored in the dav app (which you can’t disable)

Can you please check your nextcloud.log if there are any error messages from back when you installed Nextcloud?

@pvtrifonov
Copy link
Author

The very first error message in the log file is
An exception occurred while executing 'SELECT * FROM oc_flow_operations WHERE class = ?' with params ["OCA\\FilesAccessControl\\Operation"]:\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_flow_operations' doesn't exist"

@ghost
Copy link

ghost commented Nov 26, 2018

Had the same issue.
This fixed it:
sudo -u www php occ app:enable dav
source: https://help.nextcloud.com/t/freebsd-an-exception-occurred-while-executing-insert-into-oc-calendars/30574/7

@MorrisJobke
Copy link
Member

The very first error message in the log file is
An exception occurred while executing 'SELECT * FROM oc_flow_operations WHERE class = ?' with params ["OCA\FilesAccessControl\Operation"]:\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_flow_operations' doesn't exist"

Enabling the files_access_control app should fix the issue here. Don't know how it could get disabled.

Let's close this here for now. if this is after enabling still happening we can reopen the ticket and have another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants