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

Upload of files crashes if we change DB structure using Sqlite as Database #32669

Open
davitol opened this issue Sep 11, 2018 · 2 comments
Open
Labels
Milestone

Comments

@davitol
Copy link
Contributor

davitol commented Sep 11, 2018

Steps to reproduce

1 - Having a oC server using sqlite as Database
2 - Upload a big file
3 - Enable EE bundle while the upload is running

Expected behaviour

File should be uploaded

Actual behaviour

The upload crashes and a yellow warning is shown

screen shot 2018-09-11 at 12 27 01

Server configuration

Operating system:
Ubuntu 16.04

Web server:
Apache

Database:
MySQL

PHP version:
7.1

ownCloud version:

ownCloud 10.0.10RC1

Updated from an older ownCloud or fresh install:
Fresh

Are you using external storage, if yes which one:
No

Are you using encryption:
No
Logs

"reqId":"5a5noUdBygYU1Wu8xM4f","level":4,"time":"2018-09-11T10:25:54+00:00","remoteAddr":"172.18.0.1","user":"aaliyah_adams","app":"webdav","method":"PUT","url":"\/remote.php\/dav\/uploads\/aaliyah_adams\/web-file-upload-94b0a5b79f2df836274c9422de5820ed-1536660307489\/4110417920","message":"Exception: HTTP\/1.1 503 Doctrine\\DBAL\\Exception\\DriverException: An exception occurred while executing 'SELECT s.*, f.\"fileid\", f.\"path\", st.\"id\" AS \"storage_string_id\" FROM \"oc_share\" s LEFT JOIN \"oc_filecache\" f ON s.\"file_source\" = f.\"fileid\" LEFT JOIN \"oc_storages\" st ON f.\"storage\" = st.\"numeric_id\" WHERE (\"share_type\" = ?) AND (\"share_with\" = ?) AND ((\"item_type\" = ?) OR (\"item_type\" = ?)) ORDER BY s.\"id\" ASC' with params [0, \"aaliyah_adams\", \"file\", \"folder\"]:\n\nSQLSTATE[HY000]: General error: 17 database schema has changed: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\ServiceUnavailable\",\"Message\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException: An exception occurred while executing 'SELECT s.*, f.\\\"fileid\\\", f.\\\"path\\\", st.\\\"id\\\" AS \\\"storage_string_id\\\" FROM \\\"oc_share\\\" s LEFT JOIN \\\"oc_filecache\\\" f ON s.\\\"file_source\\\" = f.\\\"fileid\\\" LEFT JOIN \\\"oc_storages\\\" st ON f.\\\"storage\\\" = st.\\\"numeric_id\\\" WHERE (\\\"share_type\\\" = ?) AND (\\\"share_with\\\" = ?) AND ((\\\"item_type\\\" = ?) OR (\\\"item_type\\\" = ?)) ORDER BY s.\\\"id\\\" ASC' with params [0, \\\"aaliyah_adams\\\", \\\"file\\\", \\\"folder\\\"]:\\n\\nSQLSTATE[HY000]: General error: 17 database schema has changed\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php(201): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth->check(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php(150): Sabre\\\\DAV\\\\Auth\\\\Plugin->check(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#8 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#9 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Auth.php\",\"Line\":165}"}

Client configuration

browser

Firefox

@davitol davitol added this to the backlog milestone Sep 11, 2018
@ownclouders
Copy link
Contributor

GitMate.io thinks the contributor most likely able to help you is @PVince81.

Possibly related issues are #11391 (using a db transaction when scanning (external) files with sqlite causes database locked errors), #1373 (Uploading files issue), #8346 (Trying to upload same files with no changes..), #3046 (Installer: Use proper DB instead of SQLite as standard), and #583 (Can't upload files).

@PVince81
Copy link
Contributor

Enabling apps might trigger database migrations, and this without any maintenance mode.

If there are any requests in progress, and the database like SQLite doesn't like changes to the DB while using the DB, it will fail.

Here I'd actually prefer if we could switch shortly to maintenance mode before enabling apps. Or ask the admin to switch to single user mode before being able to install apps... this ruins the web UI UX but would make sense on the CLI somehow...

Thoughts ? @DeepDiver1975 @patrickjahns @VicDeo

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

No branches or pull requests

3 participants