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

"An exception occurred while executing 'INSERT INTO oc_filecache #12243

Closed
enoch85 opened this issue Nov 17, 2014 · 8 comments
Closed

"An exception occurred while executing 'INSERT INTO oc_filecache #12243

enoch85 opened this issue Nov 17, 2014 · 8 comments
Labels

Comments

@enoch85
Copy link
Member

enoch85 commented Nov 17, 2014

Found a new bug debugging another one: #12240 (comment)

Steps to reproduce

Don´t know.

Expected behaviour

No errors

Actual behaviour

I get this in owncloud.log:

{"app":"remote","message":"An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`, `mimetype`, `mtime`, `size`, `etag`, `storage_mtime`, `permissions`, `parent`, `path_hash`, `path`, `name`, `storage`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-d87d764ff169c6992b9989ee68a20b76' for key 'fs_storage_path_hash'","level":4,"time":"2014-11-17T22:23:47+00:00"}

Server configuration

Ubuntu Server 12.04

Database:
Server version: 5.5.38-0ubuntu0.12.04.1 (Ubuntu)
PHP version:
PHP 5.3.10-1ubuntu3.15 with Suhosin-Patch (cli) (built: Oct 29 2014 12:19:04)
ownCloud version: (see ownCloud admin page)
7.0.3
Updated from an older ownCloud or fresh install:
Updated from stable 5 and then later stable 6
List of activated apps:
Activity
Calender
Contacts
Deleted files
Documents
External Storage Support
First Run Wizard
Full Text Search
Music
PDF Viewer
Pictures
Share Files
Tasks
Text Editor
Updater
Versions
Video Viewer
ownCloud SMS
Music

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'datadirectory' => '/var/www/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '7.0.3.4',
  'dbname' => 'owncloud',
  'dbhost' => 'example.se',
#  'dbhost' => 'localhost.localdomain',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'maxZipInputSize' => 0,
  'allowZipDownload' => true,
  'session_lifetime' => 1800,
  'check_for_working_webdav' => false,
  'forcessl' => true,
  'updatechecker' => true,
  'loglevel' => '2',
  'theme' => '',
  'maintenance' => false,
  'trusted_domains' =>
  array (
    0 => 'example.se',
    1 => 'www.example.se',
  ),
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'appstoreenabled' => false,
);

Are you using external storage, if yes which one: local/smb/sftp/...
Dropbox
Are you using encryption: yes/no
No

Client configuration

Browser:
Version 37.0.2062.120 m
Operating system:
Windows 8.1

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

{"app":"remote","message":"An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`, `mimetype`, `mtime`, `size`, `etag`, `storage_mtime`, `permissions`, `parent`, `path_hash`, `path`, `name`, `storage`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-d87d764ff169c6992b9989ee68a20b76' for key 'fs_storage_path_hash'","level":4,"time":"2014-11-17T22:23:47+00:00"}

Browser log

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

a) The javascript console log
b) The network log 
c) ...
@enoch85
Copy link
Member Author

enoch85 commented Nov 17, 2014

CC @LukasReschke

@LukasReschke
Copy link
Member

@icewind1991 Any idea what can cause such exception log entries? - That looks somewhat like an unwanted behaviour to me:

{"app":"remote","message":"An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`, `mimetype`, `mtime`, `size`, `etag`, `storage_mtime`, `permissions`, `parent`, `path_hash`, `path`, `name`, `storage`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-d87d764ff169c6992b9989ee68a20b76' for key 'fs_storage_path_hash'","level":4,"time":"2014-11-17T22:23:47+00:00"}

@PVince81
Copy link
Contributor

Possibly related to #2566

@kalletabur
Copy link

Same problem here

{"reqId":"54bcd13042fc8","app":"remote","message":"An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`, `mimetype`, `mtime`, `size`, `etag`, `storage_mtime`, `permissions`, `parent`, `path_hash`, `path`, `name`, `storage`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '19-9c7b828db1a4bb600285824a0e3d535d' for key 'fs_storage_path_hash'","level":4,"time":"2015-01-19T11:41:04+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}
{"reqId":"54bcd13042fc8","app":"PHP","message":"Session has been closed - no further changes to the session as allowed at \/var\/www\/owncloud\/lib\/private\/session\/memory.php#80","level":3,"time":"2015-01-19T11:41:04+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}

Client had to remove this file from owncloud. Now if he wants to add it again he gets error:
The server did not acknowledge last chunk. (No e-tag were present).
Server log is as follows

{"reqId":"54eaf3756e050","app":"user_ldap","message":"Turned off SSL certificate validation successfully.","level":2,"time":"2015-02-23T11:31:33+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}
{"reqId":"54eaf3756e050","app":"user_ldap","message":"initializing paged search for  Filter objectClass=* base Array\n(\n    [0] => cn=silsal,ou=ee,ou=srsites,dc=srs,dc=local\n)\n attr Array\n(\n    [0] => \n)\n limit 1 offset 0","level":0,"time":"2015-02-23T11:31:33+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}
{"reqId":"54eaf3756e050","app":"user_ldap","message":"Ready for a paged search","level":1,"time":"2015-02-23T11:31:33+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}
{"reqId":"54eaf3756e050","app":"user_ldap","message":"readAttribute: cn=silsal,ou=ee,ou=srsites,dc=srs,dc=local found","level":0,"time":"2015-02-23T11:31:33+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}
{"reqId":"54eaf3756e050","app":"user_ldap","message":"initializing paged search for  Filter objectClass=* base Array\n(\n    [0] => cn=silsal,ou=ee,ou=srsites,dc=srs,dc=local\n)\n attr Array\n(\n    [0] => displayname\n)\n limit 1 offset 0","level":0,"time":"2015-02-23T11:31:33+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}
{"reqId":"54eaf3756e050","app":"user_ldap","message":"Ready for a paged search","level":1,"time":"2015-02-23T11:31:33+02:00","method":"PUT","url":"\/remote.php\/webdav\/Urmas\/Kasp\/Codes.txt"}

Server configuration

Operating system:
Debian 7.7
Web server:
nginx
Database:
MySQL
PHP version:
php5-fpm
ownCloud version: (see ownCloud admin page)
ownCloud 7.0.4
Updated from an older ownCloud or fresh install:
Updated
List of activated apps:
activity, deleted files, documents, encryption, full text search, LDAP backend, PDF viewer, pictures, text editor, updater, versions, video viewer
The content of config/config.php:
Insert your config.php content here

 'datadirectory' => '/var/ownclouddata/',
  'dbtype' => 'mysql',
  'version' => '7.0.4.2',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'loglevel' => '0',
  'forcessl' => true,
  'maintenance' => false,
  'logtimezone' => 'Europe/Tallinn',
  'theme' => '',
  'share_folder' => '/Shared',
  'preview_libreoffice_path' => '/usr/bin/libreoffice',

Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
yes

Client configuration

owncloud client:
1.7.1
Operating system:
Windows

Client error log

The server did not acknowledge last chunk. (No e-tag were present).

@enoch85
Copy link
Member Author

enoch85 commented Mar 23, 2015

@LukasReschke @PVince81 Should we start digging? :)

@PVince81
Copy link
Contributor

Duplicate entry is likely to happen in situations where the same file is uploaded at the same time. Can also happen if the first login of a user (skeleton creation?) is happening from multiple clients at the same time.

@enoch85 enoch85 closed this as completed Mar 23, 2015
@enoch85
Copy link
Member Author

enoch85 commented Mar 23, 2015

Then it's expected behavior? If not, please reopen @PVince81

@PVince81
Copy link
Contributor

So far, yes. There was work put in 8.1 to use "insertWhereExists" to avoid the messages to appear.

And in the future we'll look into a high level locking #11804

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

No branches or pull requests

4 participants