Dropbox sync fails. File locked.

elishnevsky

Dropbox sync fails. File locked.

Postby elishnevsky » Thu Jul 22, 2010 3:40 pm

Hi! Great little piece of software. Trying to use it now, so far so good. I am only having a small issue with Dropbox sync.
CintaNotes is open on my work computer all the time (I almost never shut it down). When I come home, turn on my PC, the db file is synced and I can see the changes I made at work. I make more changes, and when I am done with it, the file is synced back to Dropbox, so everything is good so far. However, when I come to work the next day, I notice, that the Dropbox service can't download the db file, it says it is locked. CintaNotes was running, remember? When I open it, I don't see any changes I made at home. Only when I kill CintaNotes, then the file is immediately synchronizes, so after I restart it, it's back to normal. I thought it is supposed to sync the db back and forth without closing the app. Am I doing something wrong?

I'm running Windows 7 x64 on both computers. CintaNotes v1.2. Dropbox v0.8.89. But I remember I had the same problem with CintaNotes v1.1C and and earlier versions of Dropbox.
elishnevsky
Posts: 4
Joined: Thu Jul 22, 2010 3:44 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby elishnevsky » Thu Jul 22, 2010 4:02 pm

Forgot to mention that I'm using the portable version of CintaNotes v1.2. Also maybe these lines from my settings file will help you determine the problem:
notebook.disconnect.enabled = 1
notebook.disconnect.timeout.seconds = 30
notebook.file = D:\My Dropbox\CintaNotesData\cintanotes.db
notebook.reload.graceperiod.seconds = 30
search.exact = 1
sqlite.pragma.cache_size = 1000
sqlite.pragma.encoding = UTF-8
sqlite.pragma.journal_mode = MEMORY
sqlite.pragma.page_size = 4096
sqlite.pragma.synchronous = OFF
sqlite.pragma.temp_store = MEMORY
elishnevsky
Posts: 4
Joined: Thu Jul 22, 2010 3:44 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby elishnevsky » Thu Jul 22, 2010 4:12 pm

Just checked the timestamp of the db file. It looks like it was downloaded by Dropbox to my work computer when I modified it from home, but the Dropbox service has also made a copy of my db at work, because of a conflict. And CintaNotes wouldn't show me the changes in the db, when I opened it. So it seems that CintaNotes kept the file locked regardless of the settings.
User avatar
CintaNotes Developer
Site Admin
Posts: 5003
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby CintaNotes Developer » Mon Jul 26, 2010 4:17 am

Hi and thanks for reporting this!

How steady is your internet connection at home and at work?
Can you reproduce this situation or it was just one time?

If there was a conflict, then it's possible that DropBox kept your work file as "cintanotes.db" and put your home file as "conflicted".
In this case all you have to do is import the conflicted file and delete it afterwards.
Alex
elishnevsky
Posts: 4
Joined: Thu Jul 22, 2010 3:44 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby elishnevsky » Tue Jul 27, 2010 1:46 am

Hi,
Thanks for replying. The connection is very steady both at home and at work. Here's an interesting problem too. When I got home today I turned on my PC and immediately noticed, that Dropbox can't download cintanotes.db, so I took a screenshot, see below. CintaNotes is set to run at system startup. Tomorrow morning I will check if I can reproduce the problem, described in my first post, again.
Attachments
20100726_201710.png
20100726_201710.png (61.85 KiB) Viewed 22432 times
User avatar
CintaNotes Developer
Site Admin
Posts: 5003
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby CintaNotes Developer » Thu Aug 05, 2010 5:40 am

So, could you reproduce the problem?
If yes, please do the following:

1) Download the free Process Explorer from http://download.cnet.com/Process-Explor ... 23605.html
2) While DropBox says "can't sync cintanotes.db", run process explorer
3) Press Ctrl+F, enter "cintanotes.db" and press "Search"
4) Tell me what the output is.

Thanks
Alex
User avatar
CintaNotes Developer
Site Admin
Posts: 5003
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby CintaNotes Developer » Thu Aug 05, 2010 5:45 am

Added the problem to the roadmap, anyone who is experiencing it please vote:

http://roadmap.cintanotes.com/feedback/ ... file-busy/
Alex
elishnevsky
Posts: 4
Joined: Thu Jul 22, 2010 3:44 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby elishnevsky » Wed Aug 11, 2010 2:07 pm

Attached the screenshots of the process explorer.
Attachments
procex_main.png
procex_main.png (103.01 KiB) Viewed 22265 times
procex_search.png
procex_search.png (26.42 KiB) Viewed 22267 times
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: Dropbox sync fails. File locked.

Postby gunars » Sat Jan 11, 2014 9:19 am

CintaNotes Developer wrote:Added the problem to the roadmap, anyone who is experiencing it please vote:

http://roadmap.cintanotes.com/feedback/ ... file-busy/

The roadmap item is now http://roadmap.cintanotes.com/topic/4723-dropbox-sync-fails-file-busy/.

It's been closed as not reproducible, but I ran into something like this the other day with CN 2.5. I also had CN open on both a home and a work laptop, synched via Dropbox. The internet connection is fine and I've had no problem synching back and forth when the CN instances were closed. The problem I ran into was when CN was open on both machines. Looking at one machine and the other was 5-10 minutes apart, so there was plenty of time to synch and Dropbox indicated everything was current.

In one case, I added a section on one laptop, but it wasn't visible on the other until I exited and reopened CN. In another case, when synching back to the first machine, Dropbox indicated it couldn't write back cintanotes.db due to a permissions problem (perhaps the flie-busy mentioned here). As soon as CN was closed, Dropbox had no problem synching. Note: a conflicted copy was not created in this case - DB just sat there waiting to synch. It sounds like CN temporarily releases the .db file at 30 seconds so Dropbox knows to resynch. But then, it reopens the file so CN can keep using it. In that case, Dropbox can't synch back since the file is open. Just a guess.

These descriptions are a bit sketchy since I wasn't specifically trying to find a problem. I just happened to run into this. I'll try to pin down a reproducible scenario, unless this is a known problem.

A related question: When is the cintanotes.settings file updated? Only when exiting CN? I have the portable version all in Dropbox, except for the backups. I'm just wondering when settings changes on one machine will be synched to the other and when the second machine will reread the settinngs file. It sounds like the settings file updates are also a bit problematic when in a DRopbox folder. Is that right?

Gunars
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: Dropbox sync fails. File locked.

Postby gunars » Sun Jan 12, 2014 6:51 am

I did a bit more testing with Dropbox. I created a new database and opened it on a home laptop and a work laptop sitting side by side. I then started to add notes, first on one, then the other. Each time, I would wait for the note to synch to the other laptop before proceeding. The notes just contained a line "home 1", "work 2", "home 3", etc.

Almost all the time, everything worked ok. When I entered a note on one laptop, I would relatively quickly see a Dropbox synch message on the other laptop and CN would refresh the note list, showing the new note from the other machine.

A few times, when a note was created on one laptop, the Dropbox on the other laptop showed "Downloading dropboxtest.db - Can't sync dropboxtest.db (permission denied)". If I waited long enough (several minutes), this eventually cleared up on its own and everything was ok. I did not need to restart CN or Dropbox. Why the synch usually took about 10 seconds and sometimes 5 minutes is not clear. A few days ago, I think I had a situation where it did not synch on its own even after 10 minutes, but I couldn't reproduce that today. This was only when CN was open on both laptops. If CN was open only on the machine I was using, there were no problems at all. However, I'd like to keep it open on both machines all the time.

When a note was created on one laptop and synched to the other, CN on the other laptop usually refreshed the note list and automatically displayed the new note. A few times, it did not. Switching to a different section and back usually refreshed the note list and showed the new note.

A few times, I hit the following problem in the note list. All the new notes I added were not tagged, so the tag list had the same count for All and Untagged. When a new note was added on one laptop, synched to the other and the new note did not appear there, I clicked between the All and Untagged selections. The All increased by one for the new note, but Untagged did not. So, All = Untagged +1. Furthermore, the top two notes on the note list (sorted by creation date, newest first) showed the same text. They should have been:

Work - 9
Home - 8
Work - 7
...

but instead were:

Work - 9
Work - 9
Home - 8
Work - 7
...

When I opened up the first "Work - 9" note, the text also said "Work - 9". However, when I opened up the second "Work - 9" note, the text said "Home - 8". The subsequent notes in the notes list were also off by one down to the bottom where the first note was correct. Throughout this, the All count was one greater than the Untagged count. One time, I could clear the problem by switching to a different section and back, but twice I had to exit from CN and open the file again. At that point it was ok again.

So, there seems to be a problem sometimes when CN tries to refresh after a synch and corrupts the note list (I'm guessing).

I'll let you know if I find a better way to reproduce this, but you might just try what I did - alternately add new notes from two machines.

By the way, my goal is not to be adding notes from two machines at the same time. Instead, I just want to keep CN open all the time on two machines that are used at different times with plenty of time to synch in between.

Gunars
User avatar
CintaNotes Developer
Site Admin
Posts: 5003
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: Dropbox sync fails. File locked.

Postby CintaNotes Developer » Mon Jan 13, 2014 11:37 am

Hi gunars,
thanks a lot for going to such lengths to find a way to reproduce the problem.
Right now I'm in a middle of many things, so I have to ask you to wait a little
bit till I have the possibility to get to this issue, run the tests and write a proper answer.

Please do remind me if the wait time becomes too long!
Alex
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: Dropbox sync fails. File locked.

Postby gunars » Tue Jan 14, 2014 9:02 am

No worries, Alex. I know you've got a pretty full plate already.

From what I understand, CN uses Dropbox by just noticing updated files in the DB folders (I'm guessing). Are there any plans to use the Dropbox API instead for increased stability? I did have a CN crash on one laptop earlier today that I suspect was a result of synching. The machine had been sitting idle all day, but I did use CN on another machine synched with Dropbox. Unfortunately, I don't have any more details.

Gunars

Return to “Bug Reports”