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

[Windows] Fix sqlite3 for sync folders on FAT(?) permissions #2701

Closed
guruz opened this issue Jan 14, 2015 · 29 comments
Closed

[Windows] Fix sqlite3 for sync folders on FAT(?) permissions #2701

guruz opened this issue Jan 14, 2015 · 29 comments

Comments

@guruz
Copy link
Contributor

guruz commented Jan 14, 2015

We need to find out if WAL (that was activated for 1.7.0) is a problem and we'd need to detect FAT(?) or if there is another way.

Related:

"On Windows, Microsoft's documentation says that locking may not work under FAT filesystems if you are not running the Share.exe daemon. " https://www.sqlite.org/faq.html
A question is if setting the lock mode helps: https://www.sqlite.org/draft/pragma.html#pragma_locking_mode https://www.sqlite.org/draft/wal.html#noshm (according to someone on IRC in #sqlite no..)

I propose that for now when creating a new Journal, we'll use GetVolumeInformationW (http://msdn.microsoft.com/en-us/library/aa364993(v=vs.85).aspx) and check lpFileSystemNameBuffer if it contains ntfs. If not, then we don't enable WAL.

@guruz guruz added type:bug p2-high Escalation, on top of current planning, release blocker labels Jan 14, 2015
@guruz guruz added this to the 1.8 - UI Enhancements milestone Jan 14, 2015
@ogoffart ogoffart self-assigned this Jan 19, 2015
@ogoffart
Copy link
Contributor

I could not reproduce the problem with master and a FAT partition.

@guruz
Copy link
Contributor Author

guruz commented Jan 20, 2015

Are you using Windows 8.1 like the other reporters?

@guruz
Copy link
Contributor Author

guruz commented Jan 20, 2015

@ogoffart The reporter in #2693 mentions exFAT..

@ckamm
Copy link
Contributor

ckamm commented Jan 22, 2015

@ckamm ckamm assigned ckamm and unassigned ogoffart Jan 22, 2015
@ckamm
Copy link
Contributor

ckamm commented Jan 22, 2015

I tried with an exfat-formatted USB stick from linux and that worked fine. I will attempt the same from Windows later.

@ckamm
Copy link
Contributor

ckamm commented Jan 22, 2015

I could not reproduce the issue when syncing an owncloud folder to an exFAT-formatted USB stick in a Windows 7 guest.

@ckamm
Copy link
Contributor

ckamm commented Jan 22, 2015

@danimo and me just tried with exfat and Windows 8.1 and couldn't reproduce it either. Any other ideas?

@guruz
Copy link
Contributor Author

guruz commented Jan 26, 2015

@dragotin Shall we have Windows specific code that adds a special message when this error happens that we don't support exfat?
Alternatively we can add a message in the "Add folder" wizard.

@rudo54 and @andrewbridge had this issue, so at least for them it existed..

@ckamm
Copy link
Contributor

ckamm commented Jan 28, 2015

@guruz I'm not convinced it's related to the WAL file, look at @andrewbridge's log in #2693. Maybe the DB really is corrupt - or there's a bug in quick_check on exFAT somehow?

@guruz
Copy link
Contributor Author

guruz commented Jan 28, 2015

Yes, I'm not convinced anymore either. It's just that it happened with 1.7.0

  1. updating the sqlite3 version
  2. when enabling WAL

@dragotin close issue?

@dragotin
Copy link
Contributor

yes, I think we can close this one, as the investigations haven't lead to something. And we also remove the corrupted file so it gets recreated so I think its done.

@guruz
Copy link
Contributor Author

guruz commented Jan 28, 2015

(Although I remember one of the reporters mentioned having recreated the DB, tried a new sync dir etc..odd)

@soluxima-erik
Copy link

I know this is closed, but I could not find a solution in any of the posts. I have the following setup:

  • Windows 10 (64)
  • Latest OC client 2.1.0 (build 5683)
  • Mounted exFAT drive as target (encrypted volume by DiskCryptor)

But I get the same result as what started this thread, seams to be a locking issue.
oc_sync_error
Was the consensus just to not use exFAT target drives?

@guruz
Copy link
Contributor Author

guruz commented Dec 29, 2015

Have you also tried to contact DiskCryptor about this?

Does removing the .csync_journal* files change anything?

@soluxima-erik
Copy link

@guruz
Yes, they said its standard exFAT partition with all permissions open. I tried with a standard exFAT partition (not spawned from DiskCryptor) and the same thing happens.
No, removing any of the files fixes nothing. A new file is made by the client with the same error.

For the record, selecting a directory in the standard NTFS partition works fine, the client works flawlessly as it should. Its just the exFAT partitions providing the spanner in the works.

@guruz
Copy link
Contributor Author

guruz commented Dec 29, 2015

@soluxima-erik Could you run with a logfile (see the manual on how to do that) and see if you get the log message 5cdf448#diff-0b6f105ffd4493a278873f32b7c170c1R116

FYI @ckamm

@AMDG2
Copy link

AMDG2 commented Jan 15, 2016

I get the same problem today. Here is my setup :

  • Windows 10 (32)
  • Owncloud (2.1.0, build 5683, git rev. c0c9fb3)
  • Installed on SD-Card
  • Sync folder on SD-Card
  • SD-Card format: exFat

Here is my log: (removed by @guruz)

@guruz
Copy link
Contributor Author

guruz commented Jan 15, 2016

01-15 18:42:37:456 0x49a7cc0 OCC::SqlQuery::prepare: Sqlite prepare statement error: "disk I/O error" in "PRAGMA quick_check;"
01-15 18:42:37:456 0x49a7cc0 OCC::SqlDatabase::checkDb: quick_check returned failure: ""
01-15 18:42:37:456 0x49a7cc0 OCC::SqlDatabase::openOrCreateReadWrite: Consistency check failed, removing broken db "D:/baudouin/owncloud/.csync_journal.db"
01-15 18:42:37:471 0x49a7cc0 OCC::SyncJournalDb::checkConnect: sqlite3 version "3.9.1"
01-15 18:42:37:471 0x49a7cc0 OCC::SqlQuery::prepare: Sqlite prepare statement error: "disk I/O error" in "PRAGMA journal_mode=WAL;"

@AMDG2 Does it work when you set the OWNCLOUD_SQLITE_JOURNAL_MODE environment variable to DELETE when launching oC client?

@AMDG2
Copy link

AMDG2 commented Jan 15, 2016

Yes it works. I tried to delete csync journal from Owncloud sync folder before but it doesn't work. Was it an error ?

May I help to fix the issue in Owncloud Client ?

@guruz
Copy link
Contributor Author

guruz commented Jan 15, 2016

@AMDG2 We'll give you a new build next week to try. Something is wrong with the FAT detection.
Please stay tuned :)

@guruz guruz reopened this Jan 15, 2016
@guruz guruz removed p2-high Escalation, on top of current planning, release blocker Needs info labels Jan 15, 2016
@ckamm
Copy link
Contributor

ckamm commented Jan 19, 2016

@guruz This might be a bug in the file system detection function:

QString drive = path.left(3);
if (! drive.endsWith(":\\"))
    return QString();

In the log, the path is "D:/..." so / vs \.

@ckamm
Copy link
Contributor

ckamm commented Jan 19, 2016

@AMDG2 A potential fix is in 2.1 (it didn't make it into beta1). Could you try a new nightly from http://download.owncloud.com/desktop/daily/ tomorrow?

@ckamm ckamm added the ReadyToTest QA, please validate the fix/enhancement label Jan 19, 2016
@AMDG2
Copy link

AMDG2 commented Jan 19, 2016

I will try it in the evening (GMT+2) or tomorrow.
I let you know :)

Le 19 janvier 2016 10:03:16 GMT+01:00, ckamm notifications@github.com a écrit :

@AMDG2 A potential fix is in 2.1 (it didn't make it into beta1).
Could you try a new nightly from
http://download.owncloud.com/desktop/daily/ tomorrow?


Reply to this email directly or view it on GitHub:
#2701 (comment)

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

@ZarekParker
Copy link

I upgraded to ownCloud 8.2.0 server a while back and this issue started happening - I was no longer able to sync due to the csync error. Tonight I downloaded ownCloud-2.1.1.5785-nightly20160120-setup.exe. After uninstall of my previous version and an installation of the new version, ownCloud popped up and started syncing immediately. I am unfortunately getting 'Service Unavailable'...'Operation Canceled' errors upon sync, which may be an unrelated issue.

@guruz
Copy link
Contributor Author

guruz commented Jan 20, 2016

@XianPalin Sounds unrelated. Please try 8.2.1, if issue persists create a new issue.

@guruz
Copy link
Contributor Author

guruz commented Jan 20, 2016

@Dianafg76
Copy link

@AMDG2 Could you try this: ownCloud-2.1.1.3067-nightly20160125.pkg, please?

@AMDG2
Copy link

AMDG2 commented Jan 26, 2016

@guruz this version was working. I didn't have time to try your version @Dianafg76

@guruz
Copy link
Contributor Author

guruz commented Jan 26, 2016

👍

@guruz guruz closed this as completed Jan 26, 2016
@Dianafg76 Dianafg76 removed the ReadyToTest QA, please validate the fix/enhancement label Jan 27, 2016
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

9 participants